Skip to content

Commit

Permalink
feat: add a build_deploy.sh script for automated builds to quay
Browse files Browse the repository at this point in the history
  • Loading branch information
skateman committed Jul 28, 2022
1 parent 125f62f commit e58ccfa
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions build_deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
set -ex

login_container_registry() {

local USER="$1"
local PASSWORD="$2"
local REGISTRY="$3"

podman login "-u=${USER}" "--password-stdin" "$REGISTRY" <<< "$PASSWORD"
}

IMAGE_NAME="quay.io/cloudservices/envoy"
IMAGE_TAG=$(git rev-parse --short=7 HEAD)

login_container_registry "$QUAY_USER" "$QUAY_TOKEN" "quay.io"
login_container_registry "$RH_REGISTRY_USER" "$RH_REGISTRY_TOKEN" "registry.redhat.io"

podman build -t "${IMAGE_NAME}:${IMAGE_TAG}" -t "${IMAGE_NAME}:latest" .
podman push --all-tags "${IMAGE_NAME}:latest"

0 comments on commit e58ccfa

Please sign in to comment.