Created
June 24, 2019 15:17
-
-
Save sanchezl/7d38ec1f488da8ca4722721d0fb41ea2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
operator=kube-apiserver-operator | |
org=sanchezl | |
repository=${org}/origin-cluster-${operator} | |
tag=$(date --utc +%Y%m%d_%H%M%SZ) | |
echo "Building ${repository} image..." | |
IMAGE_ORG=${org} make images | tee make-images.log >/dev/null | |
image="${repository}:${tag}" | |
docker tag ${repository}:latest ${image} | |
echo "Pushing ${image} to DockerHub..." | |
docker push ${image} | |
echo "Backing up deployment/${operator}..." | |
oc get --namespace openshift-${operator} deployment/${operator} --output yaml > deployment.${operator}.${tag}.yaml | |
echo "Patching deployment/${operator}..." | |
patch="--- | |
spec: | |
template: | |
spec: | |
containers: | |
- name: kube-apiserver-operator | |
image: ${image} | |
env: | |
- name: OPERATOR_IMAGE | |
value: ${image} | |
" | |
oc patch --namespace openshift-${operator} deployment/${operator} --patch "${patch}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment