Skip to content

Instantly share code, notes, and snippets.

@keskad
Last active March 4, 2022 09:54
Show Gist options
  • Select an option

  • Save keskad/027fb751682d74b3b8018384b3f4edc9 to your computer and use it in GitHub Desktop.

Select an option

Save keskad/027fb751682d74b3b8018384b3f4edc9 to your computer and use it in GitHub Desktop.
Building `lighthouse-tekton-controller` and swapping it on live K8s cluster running on remote machine

Building lighthouse-tekton-controller and swapping it on live K8s cluster running on remote machine

#!/bin/bash
set -x
set -e
set -o pipefail
DEPLOY_KEY_PATH=~/.ssh/deploy_key
VERSION=$(date +%s)
IMAGE="mydockerhublogin/test-lightouse-tekton-controller:${VERSION}"
# notice: You may need to edit Dockerfile and change base image to glibc based (e.g. Debian Slim)
export CC=/usr/bin/musl-gcc
make build-tekton-controller
docker build . -f ./docker/tekton/Dockerfile -t ${IMAGE}
docker push ${IMAGE}
ssh -i ${DEPLOY_KEY_PATH} ubuntu@example.org kubectl -n jx set image deployment/lighthouse-tekton-controller "*=${IMAGE}"
sleep 30
ssh -i ${DEPLOY_KEY_PATH} ubuntu@example.org kubectl -n jx logs -f deployment/lighthouse-tekton-controller
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment