chore: allow overwriting Docker images (#4850)

Allow Docker images to be overwritten, which is required to update
dependencies in the base image when the upstream vendor resolves
security issues.
This commit is contained in:
Jonathan Yu 2022-02-11 09:32:02 -08:00 committed by GitHub
parent 8135d2ecc3
commit 03c62242ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 16 deletions

View File

@ -1,28 +1,12 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -euo pipefail set -euo pipefail
# See if this version already exists on Docker Hub.
function version_exists() {
local output
output=$(curl --silent "https://index.docker.io/v1/repositories/codercom/code-server/tags/$VERSION")
if [[ $output == "Tag not found" ]]; then
return 1
else
return 0
fi
}
main() { main() {
cd "$(dirname "$0")/../.." cd "$(dirname "$0")/../.."
# ci/lib.sh sets VERSION and provides download_artifact here # ci/lib.sh sets VERSION and provides download_artifact here
source ./ci/lib.sh source ./ci/lib.sh
if version_exists; then
echo "$VERSION is already pushed"
return
fi
# Download the release-packages artifact # Download the release-packages artifact
download_artifact release-packages ./release-packages download_artifact release-packages ./release-packages