Skip to content

Commit

Permalink
Fix different env variables in schedules runs
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: pytorch#15927

Reviewed By: orionr

Differential Revision: D13624127

Pulled By: pjh5

fbshipit-source-id: e8b14f0401b0c278a5d17af6d7979800917e3ae6
  • Loading branch information
pjh5 authored and facebook-github-bot committed Jan 10, 2019
1 parent 4edc827 commit 7f268c6
Showing 1 changed file with 25 additions and 16 deletions.
41 changes: 25 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -521,16 +521,20 @@ 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" ]; then
git fetch --force origin "refs/tags/${CIRCLE_TAG}"
git reset --hard "$CIRCLE_SHA1"
git checkout -q "$CIRCLE_TAG"
else
git fetch --force origin "pull/${CIRCLE_PR_NUMBER}/head:remotes/origin/pull/${CIRCLE_PR_NUMBER}"
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
git reset --hard "$CIRCLE_SHA1"
git checkout -q -B "$CIRCLE_BRANCH"
fi
git reset --hard "$CIRCLE_SHA1"
git submodule update --init --recursive
popd
Expand Down Expand Up @@ -614,16 +618,21 @@ 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" ]; then
git fetch --force origin "refs/tags/${CIRCLE_TAG}"
git reset --hard "$CIRCLE_SHA1"
git checkout -q "$CIRCLE_TAG"
else
git fetch --force origin "pull/${CIRCLE_PR_NUMBER}/head:remotes/origin/pull/${CIRCLE_PR_NUMBER}"
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
git reset --hard "$CIRCLE_SHA1"
git checkout -q -B "$CIRCLE_BRANCH"
fi
git reset --hard "$CIRCLE_SHA1"
git submodule update --init --recursive
popd
# Clone the Builder master repo
Expand Down

0 comments on commit 7f268c6

Please sign in to comment.