forked from snowdrop/circuit-breaker-example
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
404 additions
and
103 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,6 +60,37 @@ jobs: | |
- name: Build Project using Helm | ||
run: | | ||
oc new-project helm | ||
./run_tests_with_helm.sh "${{ github.event.pull_request.head.repo.owner.html_url }}/${{ github.event.pull_request.head.repo.name }}" ${{ github.head_ref }} | ||
./run_tests_with_helm_in_ocp.sh "${{ github.event.pull_request.head.repo.owner.html_url }}/${{ github.event.pull_request.head.repo.name }}" ${{ github.head_ref }} | ||
- name: Delete Project using Helm | ||
run: oc delete project helm | ||
linux-build-kubernetes: | ||
name: PR - Linux - JVM ${{ matrix.java }} - Kubernetes | ||
needs: linux-build-local | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
java: [ 8 ] | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
- name: Setup Java | ||
uses: actions/[email protected] | ||
with: | ||
java-version: ${{ matrix.java }} | ||
distribution: 'adopt' | ||
cache: 'maven' | ||
- name: Kubernetes KinD Cluster | ||
uses: container-tools/kind-action@v1 | ||
with: | ||
version: v0.11.1 | ||
registry: true | ||
- name: Build Project using Helm | ||
run: | | ||
kubectl create namespace helm | ||
./run_tests_with_helm_in_k8s.sh $KIND_REGISTRY helm | ||
- name: Delete Project using Helm | ||
run: kubectl delete namespace helm | ||
# - name: Build Project using Dekorate | ||
# run: | | ||
# kubectl create namespace k8s | ||
# ./mvnw -s .github/mvn-settings.xml clean verify -Pkubernetes,kubernetes-it -Ddekorate.docker.registry=kind-registry:5000 -Dkubernetes.namespace=k8s -Ddekorate.push=true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: "Push Images" | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- sb-2.5.x | ||
jobs: | ||
push: | ||
name: Push Images to Quay.io | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
java: [ 11 ] | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
- name: Setup Java | ||
uses: actions/[email protected] | ||
with: | ||
java-version: ${{ matrix.java }} | ||
distribution: 'adopt' | ||
cache: 'maven' | ||
- name: Quay.io Login | ||
run: docker login quay.io -u="${{secrets.QUAY_USER}}" -p="${{secrets.QUAY_TOKEN}}" | ||
- name: Build | ||
run: ./mvnw -s .github/mvn-settings.xml clean package | ||
- name: Push Image to Quay.io | ||
run: | | ||
CONTAINER_REGISTRY=quay.io/snowdrop | ||
## Cute name service: | ||
NAME_IMAGE=spring-boot-cb-name-example:2.5.8 | ||
docker build ./name-service -t $NAME_IMAGE | ||
docker tag $NAME_IMAGE $CONTAINER_REGISTRY/$NAME_IMAGE | ||
docker push $CONTAINER_REGISTRY/$NAME_IMAGE | ||
## Greeting service: | ||
GREETING_IMAGE=spring-boot-cb-greeting-example:2.5.8 | ||
docker build ./greeting-service -t $GREETING_IMAGE | ||
docker tag $GREETING_IMAGE $CONTAINER_REGISTRY/$GREETING_IMAGE | ||
docker push $CONTAINER_REGISTRY/$GREETING_IMAGE |
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
dependencies: | ||
- name: spring-boot-example-app | ||
repository: http://snowdrop.github.io/helm | ||
version: 0.0.3 | ||
repository: http://localhost:8080 | ||
version: 0.0.4 | ||
- name: spring-boot-example-app | ||
repository: http://snowdrop.github.io/helm | ||
version: 0.0.3 | ||
digest: sha256:98c5ec3240851e09e5a003744cd2abd671e08bf1a30fdf603a0ac3ff856707d4 | ||
generated: "2022-02-02T09:57:36.524763302+01:00" | ||
repository: http://localhost:8080 | ||
version: 0.0.4 | ||
digest: sha256:06c0f8c009ddf8f601ab43dd9c956e5a25e642f9a04211f54bc801ce41629c92 | ||
generated: "2022-02-08T14:34:54.264266543+01:00" |
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
Binary file not shown.
Binary file not shown.
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env bash | ||
CONTAINER_REGISTRY=${1:-localhost:5000} | ||
K8S_NAMESPACE=${2:-helm} | ||
|
||
source scripts/waitFor.sh | ||
oc project $K8S_NAMESPACE | ||
|
||
# Build | ||
./mvnw -s .github/mvn-settings.xml clean package | ||
|
||
# Create docker image and tag it in registry | ||
## Name service: | ||
NAME_IMAGE=circuit-breaker-name:latest | ||
docker build ./name-service -t $NAME_IMAGE | ||
docker tag $NAME_IMAGE $CONTAINER_REGISTRY/$NAME_IMAGE | ||
docker push $CONTAINER_REGISTRY/$NAME_IMAGE | ||
|
||
## Greeting service: | ||
GREETING_IMAGE=circuit-breaker-greeting:latest | ||
docker build ./greeting-service -t $GREETING_IMAGE | ||
docker tag $GREETING_IMAGE $CONTAINER_REGISTRY/$GREETING_IMAGE | ||
docker push $CONTAINER_REGISTRY/$GREETING_IMAGE | ||
|
||
helm install circuit-breaker ./helm -n $K8S_NAMESPACE --set name-service.docker.image=$CONTAINER_REGISTRY/$NAME_IMAGE --set greeting-service.docker.image=$CONTAINER_REGISTRY/$GREETING_IMAGE | ||
if [[ $(waitFor "spring-boot-circuit-breaker-greeting" "app") -eq 1 ]] ; then | ||
echo "Application failed to deploy. Aborting" | ||
exit 1 | ||
fi | ||
|
||
# Run OpenShift Tests | ||
./mvnw -s .github/mvn-settings.xml clean verify -Pkubernetes-it -Dkubernetes.namespace=$K8S_NAMESPACE |
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
Oops, something went wrong.