-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The integration with Tekton was broken for the following reasons: - The service account integration was totally broken: so, neither private container registry could be used, nor the k8s manifests could be installed - The kaniko image used to build and push the images was not working (one missing parameter and a wrong parameter related to the context) - The extension was not supporting a multi-module project - The image-pull-secret property was not taking into account: I had to revert 1bcf751 - Added kaniko support for unsecure container registries - Updated documentation and CI
- Loading branch information
Showing
20 changed files
with
428 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 |
---|---|---|
|
@@ -146,3 +146,89 @@ jobs: | |
with: | ||
name: ci-manifests | ||
path: manifests-ocp-jvm${{ matrix.java }}.zip | ||
|
||
tekton: | ||
name: Tekton Build | ||
needs: cache | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
kubernetes: [ v1.22.2 ] | ||
tekton: [ v0.39.0 ] | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
- name: Get Date | ||
id: get-date | ||
run: | | ||
echo "::set-output name=date::$(/bin/date -u "+%Y-%m")" | ||
shell: bash | ||
- name: Cache .m2 registry | ||
uses: actions/[email protected] | ||
with: | ||
path: ~/.m2/repository | ||
key: ${{ runner.os }}-maven-${{ steps.get-date.outputs.date }} | ||
restore-keys: ${{ runner.os }}-maven- | ||
- name: Setup Minikube-Kubernetes | ||
uses: manusa/[email protected] | ||
with: | ||
minikube version: v1.23.2 | ||
kubernetes version: ${{ matrix.kubernetes }} | ||
github token: ${{ secrets.GITHUB_TOKEN }} | ||
driver: 'docker' | ||
start args: '--force' | ||
- name: Setup Java 8 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: '8' | ||
distribution: 'adopt' | ||
- name: Dockerhub login | ||
if: ${{ secrets.DOCKERIO_USERNAME != null && secrets.DOCKERIO_PASSWORD != null }} | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERIO_USERNAME }} | ||
password: ${{ secrets.DOCKERIO_PASSWORD }} | ||
- name: Install Tekton | ||
run: | | ||
kubectl apply -f https://github.com/tektoncd/pipeline/releases/download/${{ matrix.tekton }}/release.yaml | ||
- name: Build | ||
run: | | ||
./mvnw -B clean install -Dformat.skip=true -DskipTests | ||
- name: Run Tekton Integration Tests | ||
run: | | ||
kubectl create namespace tekton | ||
kubectl config set-context --current --namespace=tekton | ||
cd examples/spring-boot-with-tekton-example | ||
# Build example | ||
mvn clean install -DskipTests -Ddekorate.docker.registry=docker.io -Ddekorate.docker.group=dekorateio -Ddekorate.tekton.use-local-docker-config-json=true -Ddekorate.tekton.projectBuilderArguments=clean,install,-Pwith-examples,-DskipTests,-Dformat.skip=true,-pl,examples/spring-boot-with-tekton-example,-am | ||
# Install Tekton Task manifests | ||
kubectl apply -f target/classes/META-INF/dekorate/tekton-task.yml | ||
# Trigger Task workflow | ||
kubectl apply -f target/classes/META-INF/dekorate/tekton-task-run.yml | ||
# Wait to finish | ||
kubectl wait --for=condition=Succeeded --timeout=800s TaskRun/spring-boot-with-tekton-example-run-now | ||
# Verify application | ||
RESULT=$(kubectl exec $(kubectl get pod -l app.kubernetes.io/name=spring-boot-with-tekton-example -o name) -- wget -qO- http://localhost:9090) | ||
if [[ "$RESULT" = *"Hello world"* ]] | ||
then | ||
exit 0 | ||
fi | ||
echo "Application is not working. Result was: $RESULT" | ||
exit 1 | ||
- name: Print logs at failures | ||
if: failure() | ||
run: | | ||
kubectl config set-context --current --namespace=tekton | ||
kubectl describe TaskRun/spring-boot-with-tekton-example-run-now | ||
kubectl logs spring-boot-with-tekton-example-run-now-pod --all-containers --max-log-requests 10 | ||
kubectl logs spring-boot-with-tekton-example-run-now-pod -c step-image-build | ||
- name: Zip Artifacts | ||
if: failure() | ||
run: | | ||
zip -R manifests-tekton-jvm${{ matrix.java }}.zip 'classes/META-INF/dekorate/*' | ||
- uses: actions/upload-artifact@v1 | ||
if: failure() | ||
with: | ||
name: ci-manifests | ||
path: manifests-tekton-jvm${{ matrix.java }}.zip |
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 |
---|---|---|
|
@@ -47,6 +47,7 @@ jobs: | |
name: Kubernetes Build | ||
needs: cache | ||
runs-on: ubuntu-latest | ||
if: ${{ false }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
|
@@ -101,9 +102,9 @@ jobs: | |
with: | ||
name: ci-manifests | ||
path: manifests-k8s-jvm${{ matrix.java }}.zip | ||
|
||
openshift: | ||
name: Openshift Build | ||
if: ${{ false }} | ||
needs: cache | ||
# the action "manusa/[email protected]" only works in ubuntu-20.04 | ||
runs-on: ubuntu-20.04 | ||
|
@@ -151,3 +152,82 @@ jobs: | |
with: | ||
name: ci-manifests | ||
path: manifests-ocp-jvm${{ matrix.java }}.zip | ||
tekton: | ||
name: Tekton Build | ||
needs: cache | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
tekton: [ v0.39.0 ] | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
- name: Get Date | ||
id: get-date | ||
run: | | ||
echo "::set-output name=date::$(/bin/date -u "+%Y-%m")" | ||
shell: bash | ||
- name: Cache .m2 registry | ||
uses: actions/[email protected] | ||
with: | ||
path: ~/.m2/repository | ||
key: ${{ runner.os }}-maven-${{ steps.get-date.outputs.date }} | ||
restore-keys: ${{ runner.os }}-maven- | ||
- name: Kubernetes KinD Cluster | ||
uses: container-tools/kind-action@v1 | ||
with: | ||
version: v0.18.0 | ||
registry: true | ||
- name: Setup Java 8 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: '8' | ||
distribution: 'adopt' | ||
- name: Install Tekton | ||
run: | | ||
kubectl apply -f https://github.com/tektoncd/pipeline/releases/download/${{ matrix.tekton }}/release.yaml || true | ||
- name: Build | ||
run: | | ||
./mvnw -B clean install -Dformat.skip=true -DskipTests | ||
- name: Run Tekton Integration Tests | ||
run: | | ||
kubectl create namespace tekton | ||
kubectl config set-context --current --namespace=tekton | ||
cd examples/spring-boot-with-tekton-example | ||
# Build example | ||
mvn clean install -DskipTests -Ddekorate.docker.registry=$KIND_REGISTRY -Ddekorate.tekton.imageRegistryInsecure=true -Ddekorate.tekton.projectBuilderArguments=clean,install,-Pwith-examples,-DskipTests,-Dformat.skip=true,-pl,examples/spring-boot-with-tekton-example,-am | ||
# Install Tekton Task manifests | ||
kubectl apply -f target/classes/META-INF/dekorate/tekton-task.yml | ||
# Trigger Task workflow | ||
kubectl apply -f target/classes/META-INF/dekorate/tekton-task-run.yml | ||
# Wait to finish | ||
kubectl wait --for=condition=Succeeded --timeout=800s TaskRun/spring-boot-with-tekton-example-run-now | ||
kubectl wait deployment spring-boot-with-tekton-example --for condition=Available=True --timeout=180s | ||
# Verify application | ||
RESULT=$(kubectl exec $(kubectl get pod -l app.kubernetes.io/name=spring-boot-with-tekton-example -o name) -- wget -qO- http://localhost:9090) | ||
if [[ "$RESULT" = *"Hello world"* ]] | ||
then | ||
exit 0 | ||
fi | ||
echo "Application is not working. Result was: $RESULT" | ||
exit 1 | ||
- name: Print logs at failures | ||
if: failure() | ||
run: | | ||
kubectl config set-context --current --namespace=tekton | ||
echo "kubectl get pods: " | ||
kubectl get pods | ||
echo "kubectl describe TaskRun/spring-boot-with-tekton-example-run-now: " | ||
kubectl describe TaskRun/spring-boot-with-tekton-example-run-now | ||
echo "kubectl logs spring-boot-with-tekton-example-run-now-pod --all-containers --max-log-requests 10: " | ||
kubectl logs spring-boot-with-tekton-example-run-now-pod --all-containers --max-log-requests 10 | ||
- name: Zip Artifacts | ||
if: failure() | ||
run: | | ||
zip -R manifests-tekton-jvm${{ matrix.java }}.zip 'classes/META-INF/dekorate/*' | ||
- uses: actions/upload-artifact@v1 | ||
if: failure() | ||
with: | ||
name: ci-manifests | ||
path: manifests-tekton-jvm${{ matrix.java }}.zip |
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
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
Oops, something went wrong.