Fix different env variables in schedules runs pt 2 (#15934)
authorJesse Hellemn <hellemn@fb.com>
Thu, 10 Jan 2019 21:51:59 +0000 (13:51 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Thu, 10 Jan 2019 22:09:12 +0000 (14:09 -0800)
Summary:
Unfortunately I do not know how to test this without merging it first
Pull Request resolved: https://github.com/pytorch/pytorch/pull/15934

Reviewed By: orionr

Differential Revision: D13627472

Pulled By: pjh5

fbshipit-source-id: 35eced1483bbf3c0c3f6f62fb7bbbf2f200e50e6

.circleci/config.yml

index dcfe89f..6346a32 100644 (file)
@@ -521,18 +521,11 @@ binary_linux_build: &binary_linux_build
         # Clone the Pytorch branch
         git clone https://github.com/pytorch/pytorch.git /pytorch
         pushd /pytorch
-        if [[ -n "$CIRCLE_TAG" || -n "$CIRCLE_PR_NUMBER" ]]; then
-          if [[ -n "$CIRCLE_TAG" ]]; then
-            # TODO is this needed? when does this happen?
-            git fetch --force origin "refs/tags/${CIRCLE_TAG}"
-            git reset --hard "$CIRCLE_SHA1"
-            git checkout -q "$CIRCLE_TAG"
-          else
-            # "smoke" binary build on PRs
-            git fetch --force origin "pull/${CIRCLE_PR_NUMBER}/head:remotes/origin/pull/${CIRCLE_PR_NUMBER}"
-            git reset --hard "$CIRCLE_SHA1"
-            git checkout -q -B "$CIRCLE_BRANCH"
-          fi
+        if [[ -n "$CIRCLE_PR_NUMBER" ]]; then
+          # "smoke" binary build on PRs
+          git fetch --force origin "pull/${CIRCLE_PR_NUMBER}/head:remotes/origin/pull/${CIRCLE_PR_NUMBER}"
+          git reset --hard "$CIRCLE_SHA1"
+          git checkout -q -B "$CIRCLE_BRANCH"
           git reset --hard "$CIRCLE_SHA1"
         fi
         git submodule update --init --recursive
@@ -618,18 +611,11 @@ binary_linux_test_and_upload: &binary_linux_test_and_upload
         # Clone the Pytorch branch
         git clone https://github.com/pytorch/pytorch.git /pytorch
         pushd /pytorch
-        if [[ -n "$CIRCLE_TAG" || -n "$CIRCLE_PR_NUMBER" ]]; then
-          if [[ -n "$CIRCLE_TAG" ]]; then
-            # TODO is this needed? when does this happen?
-            git fetch --force origin "refs/tags/${CIRCLE_TAG}"
-            git reset --hard "$CIRCLE_SHA1"
-            git checkout -q "$CIRCLE_TAG"
-          else
-            # "smoke" binary build on PRs
-            git fetch --force origin "pull/${CIRCLE_PR_NUMBER}/head:remotes/origin/pull/${CIRCLE_PR_NUMBER}"
-            git reset --hard "$CIRCLE_SHA1"
-            git checkout -q -B "$CIRCLE_BRANCH"
-          fi
+        if [[ -n "$CIRCLE_PR_NUMBER" ]]; then
+          # "smoke" binary build on PRs
+          git fetch --force origin "pull/${CIRCLE_PR_NUMBER}/head:remotes/origin/pull/${CIRCLE_PR_NUMBER}"
+          git reset --hard "$CIRCLE_SHA1"
+          git checkout -q -B "$CIRCLE_BRANCH"
           git reset --hard "$CIRCLE_SHA1"
         fi
         git submodule update --init --recursive