Skip to content

Commit a32df56

Browse files
committed
Skip Docker if already pushed
1 parent 4cfa384 commit a32df56

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

ci/steps/push-docker-manifest.sh

+16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
#!/usr/bin/env bash
22
set -euo pipefail
33

4+
# See if this version already exists on Docker Hub.
5+
function version_exists() {
6+
local output
7+
output=$(curl --silent "https://index.docker.io/v1/repositories/codercom/code-server/tags/$VERSION")
8+
if [[ $output == "Tag not found" ]]; then
9+
return 1
10+
else
11+
return 0
12+
fi
13+
}
14+
415
# Import and push the Docker image for the provided arch.
516
push() {
617
local arch=$1
@@ -26,6 +37,11 @@ main() {
2637
cd "$(dirname "$0")/../.."
2738
source ./ci/lib.sh
2839

40+
if version_exists; then
41+
echo "$VERSION is already pushed"
42+
return
43+
fi
44+
2945
download_artifact release-images ./release-images
3046
if [[ ${CI-} ]]; then
3147
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin

0 commit comments

Comments
 (0)