-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
7e0bd9e
commit 3170f43
Showing
3 changed files
with
39 additions
and
48 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 |
---|---|---|
|
@@ -3,32 +3,13 @@ name: Main pipeline | |
on: | ||
#to begin you want to launch this job in main and develop | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
workflow_run: | ||
workflows: | ||
- "test" | ||
types: | ||
- completed | ||
|
||
jobs: | ||
test-backend: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
#checkout your github code using actions/[email protected] | ||
- uses: actions/[email protected] | ||
|
||
#do the same with another action (actions/setup-java@v3) that enable to setup jdk 17 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: "temurin" # See 'Supported distributions' for available options | ||
java-version: "21" | ||
#finally build your app with the latest command | ||
- name: Build and test with Maven | ||
working-directory: backend-api | ||
run: mvn clean verify | ||
|
||
- name: Send to sonarcloud for static analysis | ||
working-directory: backend-api | ||
run: mvn -B verify sonar:sonar -Dsonar.projectKey=${{ vars.SONAR_PROJECT_KEY }} -Dsonar.organization=${{ vars.SONAR_ORGANIZATION }} -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_TOKEN }} | ||
|
||
# define job to build and publish docker image | ||
build-and-push-docker-image-nightly: | ||
needs: test-backend | ||
|
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,31 +1,15 @@ | ||
on: | ||
workflow_run: | ||
workflows: | ||
- "test.yml" | ||
types: | ||
- completed | ||
push: | ||
tags: | ||
- '[0-9]+.[0-9]+.[0-9]+' | ||
|
||
name: Release pipeline | ||
jobs: | ||
test-backend: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
#checkout your github code using actions/[email protected] | ||
- uses: actions/[email protected] | ||
|
||
#do the same with another action (actions/setup-java@v3) that enable to setup jdk 17 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: "temurin" # See 'Supported distributions' for available options | ||
java-version: "21" | ||
#finally build your app with the latest command | ||
- name: Build and test with Maven | ||
working-directory: backend-api | ||
run: mvn clean verify | ||
|
||
- name: Send to sonarcloud for static analysis | ||
working-directory: backend-api | ||
run: mvn -B verify sonar:sonar -Dsonar.projectKey=${{ vars.SONAR_PROJECT_KEY }} -Dsonar.organization=${{ vars.SONAR_ORGANIZATION }} -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_TOKEN }} | ||
|
||
# define job to build and publish docker image | ||
build-and-push-docker-image-release: | ||
needs: test-backend | ||
|
@@ -49,15 +33,15 @@ jobs: | |
with: | ||
# relative path to the place where source code with Dockerfile is located | ||
file: ./Dockerfile.api | ||
push: ${{ github.ref == 'refs/heads/main' }} | ||
push: true | ||
tags: ${{secrets.DOCKERHUB_USERNAME}}/api:${{ env.DOCKERHUB_TAG }} | ||
|
||
- name: Build image and push database | ||
uses: docker/build-push-action@v3 | ||
with: | ||
# relative path to the place where source code with Dockerfile is located | ||
file: ./Dockerfile.db | ||
push: ${{ github.ref == 'refs/heads/main' }} | ||
push: true | ||
tags: ${{secrets.DOCKERHUB_USERNAME}}/database:${{ env.DOCKERHUB_TAG }} | ||
|
||
|
||
|
@@ -66,5 +50,5 @@ jobs: | |
with: | ||
# relative path to the place where source code with Dockerfile is located | ||
file: ./Dockerfile.http | ||
push: ${{ github.ref == 'refs/heads/main' }} | ||
push: true | ||
tags: ${{secrets.DOCKERHUB_USERNAME}}/httpd:${{ env.DOCKERHUB_TAG }} |
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,26 @@ | ||
name: Tests | ||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
test-backend: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
#checkout your github code using actions/[email protected] | ||
- uses: actions/[email protected] | ||
|
||
#do the same with another action (actions/setup-java@v3) that enable to setup jdk 17 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: "temurin" # See 'Supported distributions' for available options | ||
java-version: "21" | ||
#finally build your app with the latest command | ||
- name: Build and test with Maven | ||
working-directory: backend-api | ||
run: mvn clean verify | ||
|
||
- name: Send to sonarcloud for static analysis | ||
working-directory: backend-api | ||
run: mvn -B verify sonar:sonar -Dsonar.projectKey=${{ vars.SONAR_PROJECT_KEY }} -Dsonar.organization=${{ vars.SONAR_ORGANIZATION }} -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_TOKEN }} |