1
0
mirror of synced 2025-12-25 02:09:19 -05:00

check for image versions automatically in build (#948)

* add script

* remove useless cat warning

* remove unnecessary endline

* support checking core images

* add to github actions
This commit is contained in:
Jared Rhizor
2020-11-12 11:01:28 -08:00
committed by GitHub
parent 2bd8c3c850
commit 97e30c4ee7
2 changed files with 34 additions and 0 deletions

View File

@@ -64,6 +64,9 @@ jobs:
- name: Ensure no file change
run: git status --porcelain && test -z "$(git status --porcelain)"
- name: Check images exist
run: ./tools/bin/check_images_exist.sh
- name: Check documentation
if: success() && github.ref == 'refs/heads/master'
run: ./tools/site/link_checker.sh check_docs

31
tools/bin/check_images_exist.sh Executable file
View File

@@ -0,0 +1,31 @@
#!/usr/bin/env bash
set -e
function docker_tag_exists() {
URL=https://hub.docker.com/v2/repositories/"$1"/tags/"$2"
printf "\tURL: %s\n" "$URL"
curl --silent -f -lSL "$URL" > /dev/null
}
echo "Checking core images exist..."
docker-compose pull || exit 1
echo "Checking integration images exist..."
CONFIG_FILES=$(find airbyte-config/init | grep json | grep -v STANDARD_WORKSPACE | grep -v build)
[ -z "$CONFIG_FILES" ] && echo "ERROR: Could not find any config files." && exit 1
while IFS= read -r file; do
REPO=$(jq -r .dockerRepository < "$file")
TAG=$(jq -r .dockerImageTag < "$file")
echo "Checking $file..."
printf "\tREPO: %s\n" "$REPO"
printf "\tTAG: %s\n" "$TAG"
if docker_tag_exists "$REPO" "$TAG"; then
printf "\tSTATUS: found\n"
else
printf "\tERROR: not found!\n" && exit 1
fi
done <<< "$CONFIG_FILES"
echo "Success! All images exist!"