We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4cfa384 commit a32df56Copy full SHA for a32df56
1 file changed
ci/steps/push-docker-manifest.sh
@@ -1,6 +1,17 @@
1
#!/usr/bin/env bash
2
set -euo pipefail
3
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
+
15
# Import and push the Docker image for the provided arch.
16
push() {
17
local arch=$1
@@ -26,6 +37,11 @@ main() {
26
37
cd "$(dirname "$0")/../.."
27
38
source ./ci/lib.sh
28
39
40
+ if version_exists; then
41
+ echo "$VERSION is already pushed"
42
+ return
43
44
29
45
download_artifact release-images ./release-images
30
46
if [[ ${CI-} ]]; then
31
47
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
0 commit comments