diff --git a/.github/workflows/novnc.yml b/.github/workflows/novnc.yml new file mode 100644 index 0000000..9c58428 --- /dev/null +++ b/.github/workflows/novnc.yml @@ -0,0 +1,68 @@ +name: novnc-docker-image-build + +on: + push: + schedule: + - cron: '0 */8 * * *' + +jobs: + novnc-docker-image-build: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: docker login + run: docker login -u ${{ secrets.DOCKERUSERNAME }} -p ${{ secrets.DOCKERAPIKEY }} + - name: treehouses novnc + run: | + export DOCKER_CLI_EXPERIMENTAL=enabled + repo="rjpadilla/novnc" + source .github/workflows/utils.sh + alpine_arm_sha=$(get_manifest_sha "treehouses/alpine:latest" "arm") + echo "alpine arm" + echo $alpine_arm_sha + novnc_arm_sha=$(get_manifest_sha "novnc:latest" "arm") + echo "novnc arm" + echo $novnc_arm_sha + flag_arm=$(is_base "treehouses/alpine@"$alpine_arm_sha "novnc@"$novnc_arm_sha) + echo "flag arm" + echo $flag_arm + alpine_amd64_sha=$(get_manifest_sha "treehouses/alpine:latest" "amd64") + echo $alpine_amd64_sha + novnc_amd64_sha=$(get_manifest_sha "novnc:latest" "amd64") + echo $novnc_amd64_sha + flag_amd64=$(is_base "treehouses/alpine@"$alpine_amd64_sha "novnc@"$novnc_amd64_sha) + echo "flag amd64" + echo $flag_amd64 + alpine_arm64_sha=$(get_manifest_sha "treehouses/alpine:latest" "arm64") + echo "alpine arm64" + echo $alpine_arm64_sha + novnc_arm64_sha=$(get_manifest_sha "novnc:latest" "arm64") + echo "novnc arm64" + echo $novnc_arm64_sha + flag_arm64=$(is_base "treehouses/alpine@"$alpine_arm64_sha "novnc@"$novnc_arm64_sha) + echo "flag arm64" + echo $flag_arm64 + version2=$(image_version novnc:latest) + echo "repo version is $version2" + docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + build_image "treehouses/alpine:latest" arm "$repo" + build_image "treehouses/alpine:latest" amd64 "$repo" + build_image "treehouses/alpine:latest" arm64 "$repo" + flag=$(compare "treehouses/alpine@"$alpine_arm_sha "novnc@"$novnc_arm_sha "treehouses/alpine@"$alpine_amd64_sha "novnc@"$novnc_amd64_sha "treehouses/alpine@"$alpine_arm64_sha "novnc@"$novnc_arm64_sha "novnc" "novnc-tags:amd64") + echo $flag + deploy_image "$repo" arm + deploy_image "$repo" amd64 + deploy_image "$repo" arm64 + tag=$(date +%Y%m%d%H%M) + tag2="latest" + echo $tag + create_manifest $repo $tag $tag2 $repo-tags:amd64 $repo-tags:arm $repo-tags:arm64 + docker manifest inspect $repo:$tag + docker manifest inspect $repo:$tag2 + if [[ $flag == true ]]; then + docker manifest push $repo:$tag; docker manifest push $repo:$tag2 + else + echo "no changes" + fi \ No newline at end of file diff --git a/utils.sh b/.github/workflows/utils.sh similarity index 100% rename from utils.sh rename to .github/workflows/utils.sh diff --git a/Dockerfile.template b/Dockerfile.template index 1ac3760..d71fa30 100755 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -5,7 +5,7 @@ ENV VNC_PORT=5900 \ NOVNC_HOME=/srv/noVNC \ GET_HOST="ip route | awk '/default/ { print \$3 }'" -RUN apk update && apk add --no-cache git python2 procps && \ +RUN apk update && apk add --no-cache git python3 bash procps && \ mkdir -p $NOVNC_HOME && \ wget -qO- https://github.com/novnc/noVNC/archive/v1.2.0.tar.gz | tar xz --strip 1 -C $NOVNC_HOME && \ chmod +x $NOVNC_HOME/utils/*.sh