Skip to content

Commit

Permalink
Merge pull request #7 from zmailloux/gcr
Browse files Browse the repository at this point in the history
Gcr 2
  • Loading branch information
zmailloux authored Feb 19, 2019
2 parents f9a2140 + 8a0d054 commit 46c5003
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 11 deletions.
5 changes: 3 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ pipeline {
sh "echo \$(jx-release-version) > VERSION"
sh "jx step tag --version \$(cat VERSION)"
sh "gradle clean build"
// Also deloy it again as latest.
sh "export VERSION=`latest` && skaffold build -f skaffold.yaml"
sh "jx step post build --image $DOCKER_REGISTRY/$ORG/$APP_NAME:\$(cat VERSION)"
sh "export VERSION=`cat VERSION` && skaffold build -f skaffold.yaml"
sh "jx step post build --image $DOCKER_REGISTRY/$ORG/$APP_NAME:\$(cat VERSION)"
// Also deloy it again as latest.
sh "jx step post build --image $DOCKER_REGISTRY/$ORG/$APP_NAME:latest"
}
}
}
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
Minimal Jenkins X demo repo based on https://spring.io/guides/gs/consuming-rest/ with the [Spring Actuator](https://spring.io/guides/gs/actuator-service) added in
Meta project Jenkins X demo repo based on https://github.com/Zebra/spring-boot-http-gradle

While the original example offers both Maven and Gradle the idea with this demo was to focus purely on Gradle, exercising a new Jenkins X Gradle build pack.

Run locally with `gradlew bootRun`

Test via http://localhost:8080/greeting
Test via http://localhost:9000/test

Health check at http://localhost:8080/actuator/health
Health check at http://localhost:9001/actuator/health

Credit: thanks to https://github.com/Cervator for the contribution of this quickstart
Credit: thanks to https://github.com/Cervator for the contribution of this quickstart

GCR Setup can be done by following the steps here: https://github.com/jenkins-x/jx/issues/400#issuecomment-398304520
4 changes: 1 addition & 3 deletions charts/meta-project/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
{{- range .Values.ingress.hosts }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.ingress.path }}
{{- end }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.host }}{{ $.Values.ingress.path }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "meta-project.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
Expand Down
2 changes: 1 addition & 1 deletion charts/meta-project/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ spec:
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ . }}
- host: {{ $fullName }}.{{ . }}
http:
paths:
- path: /
Expand Down
2 changes: 1 addition & 1 deletion charts/meta-project/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ingress:
# kubernetes.io/tls-acme: "true"
path: /
hosts:
- meta-project.zach.zebra.engineering
- zach.zebra.engineering
tls: []
# - secretName: chart-example-tls
# hosts:
Expand Down
9 changes: 9 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"credHelpers": {
"gcr.io": "gcloud",
"us.gcr.io": "gcloud",
"eu.gcr.io": "gcloud",
"asia.gcr.io": "gcloud",
"staging-k8s.gcr.io": "gcloud"
}
}

0 comments on commit 46c5003

Please sign in to comment.