Commit 84af4866 authored by Andreas Klöckner's avatar Andreas Klöckner
Browse files

Move doc wrangling into ci-support

parent 21de075b
Loading
Loading
Loading
Loading
+2 −25
Original line number Diff line number Diff line
@@ -4,28 +4,5 @@ curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/ci-support.
source ci-support.sh

build_py_project_in_venv

# https://github.com/sphinx-doc/sphinx/issues/8084
$PY_EXE -m pip install docutils "sphinx<3.2"

cd doc

cat > doc_upload_ssh_config <<END
Host doc-upload
   User doc
   IdentityFile doc_upload_key
   IdentitiesOnly yes
   Hostname marten.tiker.net
   StrictHostKeyChecking false
END

make html SPHINXOPTS="-W --keep-going -n"

if test -n "${DOC_UPLOAD_KEY}" && test "$CI_COMMIT_REF_NAME" = "master"; then
  echo "${DOC_UPLOAD_KEY}" > doc_upload_key
  chmod 0600 doc_upload_key
  RSYNC_RSH="ssh -F doc_upload_ssh_config" ./upload-docs.sh || { rm doc_upload_key; exit 1; }
  rm doc_upload_key
else
  echo "Skipping upload. DOC_UPLOAD_KEY was not provided."
fi
build_docs
maybe_upload_docs
+37 −0
Original line number Diff line number Diff line
@@ -354,4 +354,41 @@ run_examples()

# }}}


# {{{ docs

build_docs()
{
  # https://github.com/sphinx-doc/sphinx/issues/8084
  $PY_EXE -m pip install "sphinx<3.2"

  cd doc

  make html SPHINXOPTS="-W --keep-going -n"
}

maybe_upload_docs()
{
  if test -n "${DOC_UPLOAD_KEY}" && test "$CI_COMMIT_REF_NAME" = "master"; then
    cat > doc_upload_ssh_config <<END
Host doc-upload
   User doc
   IdentityFile doc_upload_key
   IdentitiesOnly yes
   Hostname marten.tiker.net
   StrictHostKeyChecking false
END

    echo "${DOC_UPLOAD_KEY}" > doc_upload_key
    chmod 0600 doc_upload_key
    RSYNC_RSH="ssh -F doc_upload_ssh_config" ./upload-docs.sh || { rm doc_upload_key; exit 1; }
    rm doc_upload_key
  else
    echo "Skipping upload. DOC_UPLOAD_KEY was not provided."
  fi
}

# }}}


# vim: foldmethod=marker