File tree 1 file changed +16
-0
lines changed
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
set -euo pipefail
3
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
+
4
15
# Import and push the Docker image for the provided arch.
5
16
push () {
6
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
+ fi
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
You can’t perform that action at this time.
0 commit comments