Last active
August 5, 2019 17:32
-
-
Save vfarcic/9756d98bb0a0d71bebc8281f8b699145 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
# 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 dev | |
git merge -s ours master --no-edit | |
git checkout master | |
git merge dev | |
git push | |
# Only if GKE and a branch was restored | |
cat charts/go-demo-6/Makefile \ | |
| sed -e \ | |
"s@vfarcic@$PROJECT@g" \ | |
| tee charts/go-demo-6/Makefile | |
# Only if GKE and a branch was restored | |
cat charts/preview/Makefile \ | |
| sed -e \ | |
"s@vfarcic@$PROJECT@g" \ | |
| tee charts/preview/Makefile | |
# Only if GKE and a branch was restored | |
cat skaffold.yaml \ | |
| sed -e \ | |
"s@vfarcic@$PROJECT@g" \ | |
| tee skaffold.yaml | |
jx import --batch-mode | |
jx get activities \ | |
--filter go-demo-6 \ | |
--watch | |
cat Jenkinsfile | |
git checkout -b my-pr | |
cat main.go | sed -e \ | |
"s@hello, devpod with tests@hello, PR@g" \ | |
| tee main.go | |
cat main_test.go | sed -e \ | |
"s@hello, devpod with tests@hello, PR@g" \ | |
| tee main_test.go | |
echo " | |
db: | |
enabled: false | |
preview-db: | |
persistence: | |
enabled: false" \ | |
| tee -a charts/preview/values.yaml | |
git add . | |
git commit \ | |
--message "This is a PR" | |
git push --set-upstream origin my-pr | |
jx create pullrequest \ | |
--title "My PR" \ | |
--body "This is the text that describes the PR | |
and it can span multiple lines" \ | |
--batch-mode | |
jx get previews | |
PR_ADDR=[...] | |
curl "$PR_ADDR/demo/hello" | |
jx create issue -t "Add unit tests" \ | |
--body "Add unit tests to the CD process" \ | |
-b | |
ISSUE_ID=[...] | |
git add . | |
git commit \ | |
--message "Added unit tests (fixes #$ISSUE_ID)" | |
git push | |
jx get issues -b | |
echo ' | |
functest: | |
CGO_ENABLED=$(CGO_ENABLED) $(GO) \\ | |
test -test.v --run FunctionalTest \\ | |
--cover | |
' | tee -a Makefile | |
echo ' | |
integtest: | |
DURATION=1 \\ | |
CGO_ENABLED=$(CGO_ENABLED) $(GO) \\ | |
test -test.v --run ProductionTest \\ | |
--cover | |
' | tee -a Makefile | |
git add . | |
git commit \ | |
--message "Added integration tests" | |
git push | |
jx get build logs | |
cat charts/go-demo-6/values.yaml | |
echo " | |
usePassword: false" \ | |
| tee -a charts/go-demo-6/values.yaml | |
echo " | |
usePassword: false" \ | |
| tee -a charts/preview/values.yaml | |
git add . | |
git commit \ | |
--message "Removed MongoDB password" | |
git push | |
jx get activity -f go-demo-6 -w | |
jx get applications | |
STAGING_ADDR=[...] # Replace `[...]` with the URL | |
curl "$STAGING_ADDR/demo/hello" | |
kubectl get cronjobs | |
jx get previews | |
jx gc previews | |
jx get previews | |
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