From 7837ec553ce5fb4fb6aa7381b34cba109d46b510 Mon Sep 17 00:00:00 2001 From: Will Feng Date: Fri, 19 Oct 2018 08:55:01 -0700 Subject: CircleCI: Add doc-push job Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/12833 Differential Revision: D10464815 Pulled By: yf225 fbshipit-source-id: 06a6a673b6bb32f7c252a217f9ce59db35c75e9c --- .circleci/config.yml | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) (limited to '.circleci') diff --git a/.circleci/config.yml b/.circleci/config.yml index 77ccd64a00..7431b72057 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -643,6 +643,88 @@ jobs: ((echo "export JOB_BASE_NAME=${JOB_BASE_NAME}" && echo "source ./workspace/env" && echo 'sudo chown -R jenkins workspace && cd workspace && .jenkins/pytorch/short-perf-test-gpu.sh') | docker exec -u jenkins -i "$id" bash) 2>&1 | ts + pytorch_doc_push: + environment: + JOB_BASE_NAME: pytorch-doc-push + resource_class: large + machine: + image: default + steps: + - run: + name: Prepare workspace + command: | + sudo mkdir -p /home/circleci/project/pytorch-ci-env + sudo chmod -R 777 /home/circleci/project/pytorch-ci-env + - attach_workspace: + at: /home/circleci/project/pytorch-ci-env + - run: + <<: *setup_ci_environment + - run: + name: Doc Push + no_output_timeout: "1h" + command: | + set -e + if [[ "${CIRCLE_BRANCH}" != "master" ]]; then + echo "Skipping doc push..." + exit 0 + fi + source /home/circleci/project/pytorch-ci-env/COMMIT_DOCKER_IMAGE + echo "DOCKER_IMAGE: "${COMMIT_DOCKER_IMAGE} + docker pull ${COMMIT_DOCKER_IMAGE} + id=$(docker run -t -d -w /var/lib/jenkins ${COMMIT_DOCKER_IMAGE}) + + cat >/home/circleci/project/doc_push_script.sh <& \\▼<\\/a>/g' + git add docs/master || true + git status + git config user.email "soumith+bot@pytorch.org" + git config user.name "pytorchbot" + # If there aren't changes, don't make a commit; push is no-op + git commit -m "auto-generating sphinx docs" || true + git status + git push origin site + + popd + # =================== The above code will be executed inside Docker container =================== + EOL + chmod +x /home/circleci/project/doc_push_script.sh + docker cp /home/circleci/project/doc_push_script.sh $id:/var/lib/jenkins/workspace/doc_push_script.sh + + ((echo "export JOB_BASE_NAME=${JOB_BASE_NAME}" && echo "source ./workspace/env" && echo 'sudo chown -R jenkins workspace && cd workspace && ./doc_push_script.sh') | docker exec -u jenkins -i "$id" bash) 2>&1 | ts + pytorch_macos_10_13_py3_build: macos: xcode: "9.0" @@ -946,6 +1028,9 @@ workflows: - pytorch_short_perf_test_gpu: requires: - pytorch_linux_xenial_cuda8_cudnn6_py3_build + - pytorch_doc_push: + requires: + - pytorch_linux_xenial_cuda8_cudnn6_py3_build - pytorch_linux_xenial_cuda9_cudnn7_py2_build - pytorch_linux_xenial_cuda9_cudnn7_py2_test: requires: -- cgit v1.2.3