Skip to content

Instantly share code, notes, and snippets.

@vfarcic
Last active January 18, 2022 00:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save vfarcic/39c3fe9bbe693f9072e9e41980b9337e to your computer and use it in GitHub Desktop.
Save vfarcic/39c3fe9bbe693f9072e9e41980b9337e to your computer and use it in GitHub Desktop.
# Links to gists for creating a cluster with jx
# gke-jx.sh: https://gist.github.com/86e10c8771582c4b6a5249e9c513cd18
# eks-jx.sh: https://gist.github.com/dfaf2b91819c0618faf030e6ac536eac
# aks-jx.sh: https://gist.github.com/6e01717c398a5d034ebe05b195514060
# install.sh: https://gist.github.com/3dd5592dc5d582ceeb68fb3c1cc59233
cd go-demo-6
git checkout buildpack
git merge -s ours master --no-edit
git checkout master
git merge buildpack
git push
# If GKE
cat charts/go-demo-6/Makefile \
| sed -e \
"s@vfarcic@$PROJECT@g" \
| tee charts/go-demo-6/Makefile
# If GKE
cat charts/preview/Makefile \
| sed -e \
"s@vfarcic@$PROJECT@g" \
| tee charts/preview/Makefile
# If GKE
cat skaffold.yaml \
| sed -e \
"s@vfarcic@$PROJECT@g" \
| tee skaffold.yaml
jx import --pack go --batch-mode
jx get activity -f go-demo-6 -w
cd go-demo-6
jx create devpod --batch-mode
jx rsh --devpod
cd go-demo-6
ls -1
go mod init
make linux
cat skaffold.yaml
cat skaffold.yaml \
| sed -e 's@DIGEST_HEX@UUID@g' \
| tee skaffold.yaml
echo $DOCKER_REGISTRY
env
kubectl create \
-f https://raw.githubusercontent.com/vfarcic/k8s-specs/master/helm/tiller-rbac.yml \
--record --save-config
helm init --service-account tiller
export UUID=$(uuidgen)
skaffold run --profile dev
echo $SKAFFOLD_DEPLOY_NAMESPACE
kubectl -n $SKAFFOLD_DEPLOY_NAMESPACE \
get pods
cat watch.sh
cat watch.sh | sed -e \
's@skaffold@UUID=$(uuidgen) skaffold@g' \
| tee watch.sh
chmod +x watch.sh
nohup ./watch.sh &
exit
jx get applications
URL=[...]
curl "$URL/demo/hello"
jx open
jx open [...]
curl "$URL/demo/hello"
jx delete devpod
echo 'unittest:
CGO_ENABLED=$(CGO_ENABLED) $(GO) test --run UnitTest -v
' | tee -a Makefile
cat watch.sh |
sed -e \
's@linux \&\& skaffold@linux \&\& make unittest \&\& skaffold@g' \
| sed -e \
's@skaffold@UUID=$(uuidgen) skaffold@g' \
| tee watch.sh
jx sync --daemon
jx create devpod --sync --batch-mode
jx rsh --devpod
go mod init
unset GOPATH
helm init --client-only
chmod +x watch.sh
./watch.sh
curl "$URL/demo/hello"
cat main.go | sed -e \
's@hello, world@hello, devpod with tests@g' \
| tee main.go
cat main_test.go | sed -e \
's@hello, world@hello, devpod with tests@g' \
| tee main_test.go
curl "$URL/demo/hello"
git add .
git commit \
--message "devpod"
git push
jx get activity -f go-demo-6 -w
jx get applications
STAGING_URL=[...]
curl "$STAGING_URL/demo/hello"
jx delete devpod
cd ..
GH_USER=[...]
hub delete -y \
$GH_USER/environment-jx-rocks-staging
hub delete -y \
$GH_USER/environment-jx-rocks-production
rm -rf ~/.jx/environments/$GH_USER/environment-jx-rocks-*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment