Skip to content

Commit a70cd28

Browse files
author
Zijian Zhang
committed
ci: fix on demand condition
1 parent 8e201ef commit a70cd28

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

ci/build_env_image.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ GIT_COMMIT_SHA=${GIT_COMMIT_SHA:?"GIT_COMMIT_SHA is not set"}
66

77
echo "GIT_COMMIT_SHA: $GIT_COMMIT_SHA"
88

9+
RUN_ID="areal-$GIT_COMMIT_SHA"
10+
cd "/tmp/$RUN_ID"
11+
912
# If there is already an image for the current environment, skip the build.
1013
ENV_SHA=$(sha256sum pyproject.toml | awk '{print $1}')
1114
if docker images --format '{{.Repository}}:{{.Tag}}' | grep -q "areal-env:$ENV_SHA"; then
1215
echo "Image areal-env already exists, skipping build."
1316
exit 0
1417
fi
1518

16-
RUN_ID="areal-$GIT_COMMIT_SHA"
17-
cd "/tmp/$RUN_ID"
18-
1919
if docker ps -a --format '{{.Names}}' | grep -q "$RUN_ID"; then
2020
docker rm -f $RUN_ID
2121
fi

0 commit comments

Comments
 (0)