From 64233e40059e57adc8883b3d6bec5a33f592c5eb Mon Sep 17 00:00:00 2001 From: Anthony Sansone Date: Fri, 14 Dec 2018 15:06:07 -0600 Subject: [PATCH 1/9] (DOCSP-3904): Updated Evergreen Config. --- .mci.yml | 113 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 62 insertions(+), 51 deletions(-) diff --git a/.mci.yml b/.mci.yml index d56373a882f..06c22de0a7b 100644 --- a/.mci.yml +++ b/.mci.yml @@ -1,51 +1,62 @@ -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 - -tasks: - - name: "build_manual" - commands: - - command: shell.exec - params: - working_dir: "docs-mongodb" - script: | - . ${venv}/activate - - giza generate source - giza sphinx --builder publish --serial_sphinx - - command: shell.exec - params: - working_dir: "docs-mongodb" - script: | - . ${venv}/activate - - giza env package --builder publish - giza packaging create --target push - - # TODO: deploy build/archive/* to s3 - -buildvariants: - - name: ubuntu1404-release - display_name: "Ubuntu 14.04" - run_on: - - ubuntu1404-test - expansions: - venv: "~/venv/bin" - tasks: - - name: "build_manual" +--- +buildvariants: + - + display_name: "Ubuntu 16.04" + expansions: + venv: ~/venv/bin + name: ubuntu1604 + run_on: + - ubuntu1604-test + tasks: + - + name: build-docs +tasks: + - + commands: + - + command: git.get_project + params: + directory: docs-mongodb + type: setup + - + command: shell.exec + params: + script: | + rm -rf ~/venv + + virtualenv ~/venv + ${venv}/pip install -r requirements.txt + 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 "${aws_key}" > ~/.config/giza-aws-authentication.conf + echo "${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 + params: + script: | + export USER=${github_author} + . ${venv}/activate + + if [ "${is_patch}" != "true" ]; then + make publish + make deploy + else + make html + make stage + fi + shell: bash + working_dir: docs-mongodb + name: build-docs From 80a81dac2bc87bf13ef834c5d6c331afe30b83b1 Mon Sep 17 00:00:00 2001 From: Anthony Sansone Date: Wed, 19 Dec 2018 22:56:48 -0600 Subject: [PATCH 2/9] Added mut install. --- .mci.yml | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 67 insertions(+), 1 deletion(-) diff --git a/.mci.yml b/.mci.yml index 06c22de0a7b..bbdd05e73a1 100644 --- a/.mci.yml +++ b/.mci.yml @@ -31,6 +31,73 @@ tasks: command: shell.exec params: script: | + + . ${venv}/activate + + python3 -m pip install -qqq --upgrade pip || true + + ( cd "~" + rm -rf dev + 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 + + if ! echo "${PATH}" | grep -q "~/bin"; then + local rc_files=() + if [ -r ~/.bash_profile ]; then + rc_files+=(~/.bash_profile) + elif [ -r ~/.bashrc ]; then + rc_files+=(~/.bashrc) + fi + + if [ -r ~/.zshenv ]; then + rc_files+=(~/.zshenv) + elif [ -r ~/.zshrc ]; then + rc_files+=(~/.zshrc) + fi + + if [ ! -z "${rc_files[0]}" ] && ask 'Add PATH environment variable?'; then + for rc in "${rc_files[@]}"; do + printf "\nPATH=\$PATH:%s/bin\n" "~" >> "${rc}" + done + + echo 'Open a new terminal to use the changes' + else + echo '' + echo "Add \"export PATH=\$PATH:~/bin\" to your PATH environment variable" + fi + fi + + echo "Installed:" + echo " mut" + echo " mut-build" + echo " mut-convert-redirects" + echo " mut-images" + echo " mut-index" + echo " mut-intersphinx" + echo " mut-lint" + echo " mut-publish" + echo " mut-redirects" + + working_dir: docs-mongodb + - + command: shell.exec + params: + script: | # remember that this script should be silent if it # manipulates keys mkdir ~/.config @@ -48,7 +115,6 @@ tasks: params: script: | export USER=${github_author} - . ${venv}/activate if [ "${is_patch}" != "true" ]; then make publish From 75cee78c0fd61bd45192dcb799d4927b7a67f04d Mon Sep 17 00:00:00 2001 From: Anthony Sansone Date: Thu, 20 Dec 2018 13:36:01 -0600 Subject: [PATCH 3/9] Modified mut script. --- .mci.yml | 95 +++++++++++++++++------------------------------- requirements.txt | 6 +++ 2 files changed, 39 insertions(+), 62 deletions(-) diff --git a/.mci.yml b/.mci.yml index bbdd05e73a1..d05fb4776bb 100644 --- a/.mci.yml +++ b/.mci.yml @@ -22,76 +22,47 @@ tasks: command: shell.exec params: script: | - rm -rf ~/venv - - virtualenv ~/venv - ${venv}/pip install -r requirements.txt - working_dir: docs-mongodb - - - command: shell.exec - params: - script: | - . ${venv}/activate - - python3 -m pip install -qqq --upgrade pip || true - - ( cd "~" - rm -rf dev - mkdir dev - cd dev - - git clone --depth=1 https://github.com/mongodb/mut.git + # install_helper(name) + install_helper() { + if [ -z "$1" ]; then + echo "No helper given to install_helper" + exit 1 + fi - ( cd mut && python3 -m pip install -r requirements.txt . ) - ) + 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" + } - 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 + rm -rf ~/venv + + virtualenv ~/venv + ${venv}/pip install -r requirements.txt - if ! echo "${PATH}" | grep -q "~/bin"; then - local rc_files=() - if [ -r ~/.bash_profile ]; then - rc_files+=(~/.bash_profile) - elif [ -r ~/.bashrc ]; then - rc_files+=(~/.bashrc) - fi + # Modified build for mut + ${venv}/bin/activate - if [ -r ~/.zshenv ]; then - rc_files+=(~/.zshenv) - elif [ -r ~/.zshrc ]; then - rc_files+=(~/.zshrc) - fi + python3 -m pip install -qqq --upgrade pip || true - if [ ! -z "${rc_files[0]}" ] && ask 'Add PATH environment variable?'; then - for rc in "${rc_files[@]}"; do - printf "\nPATH=\$PATH:%s/bin\n" "~" >> "${rc}" - done + 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 . - echo 'Open a new terminal to use the changes' - else - echo '' - echo "Add \"export PATH=\$PATH:~/bin\" to your PATH environment variable" - fi - fi + # 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 - echo "Installed:" - echo " mut" - echo " mut-build" - echo " mut-convert-redirects" - echo " mut-images" - echo " mut-index" - echo " mut-intersphinx" - echo " mut-lint" - echo " mut-publish" - echo " mut-redirects" + PATH=$PATH:~/venv/bin working_dir: docs-mongodb - diff --git a/requirements.txt b/requirements.txt index 3b93d5617b3..accadf397f5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,7 @@ giza +libxml2-dev +libyaml-dev +pkg-config +python3 +python3-pip +python3-venv From c47869bd717abc30613c038b584e4bb4a6ffe8e3 Mon Sep 17 00:00:00 2001 From: Anthony Sansone Date: Thu, 20 Dec 2018 13:44:20 -0600 Subject: [PATCH 4/9] Modified mut script again. --- .mci.yml | 4 ++++ requirements.txt | 6 ------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.mci.yml b/.mci.yml index d05fb4776bb..dac9ccaf7b3 100644 --- a/.mci.yml +++ b/.mci.yml @@ -36,11 +36,15 @@ tasks: chmod 755 "~/venv/bin/$1" } + ### Original Working Script Start ### + rm -rf ~/venv virtualenv ~/venv ${venv}/pip install -r requirements.txt + ### Original Working Script End ### + # Modified build for mut ${venv}/bin/activate diff --git a/requirements.txt b/requirements.txt index accadf397f5..3b93d5617b3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1 @@ giza -libxml2-dev -libyaml-dev -pkg-config -python3 -python3-pip -python3-venv From 8b777f25ce98d86e6c54f9441f7801a1754a5118 Mon Sep 17 00:00:00 2001 From: Anthony Sansone Date: Tue, 5 Feb 2019 22:25:38 -0600 Subject: [PATCH 5/9] Updated to Ubuntu 18.04. --- .mci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.mci.yml b/.mci.yml index dac9ccaf7b3..345eed2cecf 100644 --- a/.mci.yml +++ b/.mci.yml @@ -1,12 +1,12 @@ --- buildvariants: - - display_name: "Ubuntu 16.04" + display_name: "Ubuntu 18.04" expansions: venv: ~/venv/bin - name: ubuntu1604 + name: ubuntu1804 run_on: - - ubuntu1604-test + - ubuntu1804-test tasks: - name: build-docs From c29198b508eaad0e3e3d70316e5c938ac36bc316 Mon Sep 17 00:00:00 2001 From: Anthony Sansone Date: Mon, 6 May 2019 20:53:36 -0500 Subject: [PATCH 6/9] New test to compare to mms-docs. --- .mci.yml | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/.mci.yml b/.mci.yml index 345eed2cecf..fb72d74fb2a 100644 --- a/.mci.yml +++ b/.mci.yml @@ -1,26 +1,26 @@ ---- -buildvariants: - - +--- +buildvariants: + - display_name: "Ubuntu 18.04" - expansions: + expansions: venv: ~/venv/bin name: ubuntu1804 - run_on: + run_on: - ubuntu1804-test - tasks: - - + tasks: + - name: build-docs -tasks: - - - commands: - - +tasks: + - + commands: + - command: git.get_project - params: + params: directory: docs-mongodb type: setup - - + - command: shell.exec - params: + params: script: | # install_helper(name) @@ -39,7 +39,7 @@ tasks: ### Original Working Script Start ### rm -rf ~/venv - + virtualenv ~/venv ${venv}/pip install -r requirements.txt @@ -69,28 +69,28 @@ tasks: PATH=$PATH:~/venv/bin working_dir: docs-mongodb - - + - command: shell.exec - params: + params: script: | - # remember that this script should be silent if it + # remember that this script should be silent if it # manipulates keys mkdir ~/.config touch ~/.config/giza-aws-authentication.conf echo "${aws_key}" > ~/.config/giza-aws-authentication.conf echo "${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 - params: + params: script: | export USER=${github_author} - + if [ "${is_patch}" != "true" ]; then make publish make deploy From 9f6be6d0ac25f51ec778ff96670f10d5207d9907 Mon Sep 17 00:00:00 2001 From: Anthony Sansone Date: Mon, 6 May 2019 21:07:01 -0500 Subject: [PATCH 7/9] Fixed auth file. New test to compare to mms-docs. --- .mci.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.mci.yml b/.mci.yml index fb72d74fb2a..1a33a485ec0 100644 --- a/.mci.yml +++ b/.mci.yml @@ -77,6 +77,9 @@ tasks: # manipulates keys mkdir ~/.config touch ~/.config/giza-aws-authentication.conf + echo "[personal]" + echo "username=${github_author}" + echo "[authentication]" > ~/.config/giza-aws-authentication.conf echo "${aws_key}" > ~/.config/giza-aws-authentication.conf echo "${aws_secret}" >> ~/.config/giza-aws-authentication.conf chmod 600 ~/.config/giza-aws-authentication.conf @@ -87,6 +90,10 @@ tasks: silent: true - command: shell.exec + loggers: + task: + - type: evergreen + - type: file params: script: | export USER=${github_author} From abbe937fe9e2214743632763326b5a7be610fac7 Mon Sep 17 00:00:00 2001 From: Anthony Sansone Date: Mon, 6 May 2019 21:20:15 -0500 Subject: [PATCH 8/9] Fixed auth file #2. New test to compare to mms-docs. --- .mci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.mci.yml b/.mci.yml index 1a33a485ec0..3a91029feb2 100644 --- a/.mci.yml +++ b/.mci.yml @@ -80,8 +80,8 @@ tasks: echo "[personal]" echo "username=${github_author}" echo "[authentication]" > ~/.config/giza-aws-authentication.conf - echo "${aws_key}" > ~/.config/giza-aws-authentication.conf - echo "${aws_secret}" >> ~/.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 @@ -96,6 +96,7 @@ tasks: - type: file params: script: | + ls -al ~/.config export USER=${github_author} if [ "${is_patch}" != "true" ]; then From 1600b549f558a3f65316e92870276ac460e4b80e Mon Sep 17 00:00:00 2001 From: Anthony Sansone Date: Mon, 6 May 2019 21:22:07 -0500 Subject: [PATCH 9/9] Fixed auth file #3. New test to compare to mms-docs. --- .mci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.mci.yml b/.mci.yml index 3a91029feb2..e385fffc71d 100644 --- a/.mci.yml +++ b/.mci.yml @@ -38,6 +38,8 @@ tasks: ### Original Working Script Start ### + python -m pip install --user virtualenv + rm -rf ~/venv virtualenv ~/venv