diff --git a/.mci.yml b/.mci.yml index d56373a882f..e385fffc71d 100644 --- a/.mci.yml +++ b/.mci.yml @@ -1,51 +1,113 @@ -pre: - - command: git.get_project - params: - directory: "docs-mongodb" - - command: git.apply_patch - params: - directory: "docs-mongodb" - - command: shell.exec - params: - working_dir: "docs-mongodb" - script: | - rm -rf ~/venv - - virtualenv ~/venv - ${venv}/pip install -r requirements.txt - - # make the current branch always be master. - git branch -D master || true - git checkout -b master origin/master - +--- +buildvariants: + - + display_name: "Ubuntu 18.04" + expansions: + venv: ~/venv/bin + name: ubuntu1804 + run_on: + - ubuntu1804-test + tasks: + - + name: build-docs tasks: - - name: "build_manual" + - commands: - - command: shell.exec - params: - working_dir: "docs-mongodb" - script: | - . ${venv}/activate + - + command: git.get_project + params: + directory: docs-mongodb + type: setup + - + command: shell.exec + params: + script: | - giza generate source - giza sphinx --builder publish --serial_sphinx - - command: shell.exec - params: - working_dir: "docs-mongodb" - script: | - . ${venv}/activate + # install_helper(name) + install_helper() { + if [ -z "$1" ]; then + echo "No helper given to install_helper" + exit 1 + fi - giza env package --builder publish - giza packaging create --target push + printf '#!/bin/sh\n' > "~/venv/bin/$1" + printf '. ~/venv/bin/activate\n' >> "~/venv/bin/$1" + printf '~/venv/bin/%s $@\n' "$1" >> "~/venv/bin/$1" + chmod 755 "~/venv/bin/$1" + } - # TODO: deploy build/archive/* to s3 + ### Original Working Script Start ### -buildvariants: - - name: ubuntu1404-release - display_name: "Ubuntu 14.04" - run_on: - - ubuntu1404-test - expansions: - venv: "~/venv/bin" - tasks: - - name: "build_manual" + python -m pip install --user virtualenv + + rm -rf ~/venv + + virtualenv ~/venv + ${venv}/pip install -r requirements.txt + + ### Original Working Script End ### + + # Modified build for mut + ${venv}/bin/activate + + python3 -m pip install -qqq --upgrade pip || true + + cd ~/venv + mkdir dev + cd dev + git clone --depth=1 https://github.com/mongodb/mut.git + cd mut && python3 -m pip install -r requirements.txt . + + # install_helper mut + # install_helper mut-build + # install_helper mut-convert-redirects + # install_helper mut-images + # install_helper mut-index + # install_helper mut-intersphinx + # install_helper mut-lint + # install_helper mut-publish + # install_helper mut-redirects + + PATH=$PATH:~/venv/bin + + working_dir: docs-mongodb + - + command: shell.exec + params: + script: | + # remember that this script should be silent if it + # manipulates keys + mkdir ~/.config + touch ~/.config/giza-aws-authentication.conf + echo "[personal]" + echo "username=${github_author}" + echo "[authentication]" > ~/.config/giza-aws-authentication.conf + echo "accesskey=${aws_key}" >> ~/.config/giza-aws-authentication.conf + echo "secretkey=${aws_secret}" >> ~/.config/giza-aws-authentication.conf + chmod 600 ~/.config/giza-aws-authentication.conf + + # as an alternative, you could pass the aws keys to the + # makefile directly if it supports that + shell: bash + silent: true + - + command: shell.exec + loggers: + task: + - type: evergreen + - type: file + params: + script: | + ls -al ~/.config + export USER=${github_author} + + if [ "${is_patch}" != "true" ]; then + make publish + make deploy + else + make html + make stage + fi + shell: bash + working_dir: docs-mongodb + name: build-docs