From e085db8328081a372cafca4c2c71936a68aa1a67 Mon Sep 17 00:00:00 2001 From: Panagiotis Bellias Date: Sun, 16 Jun 2024 18:05:56 +0300 Subject: [PATCH 1/2] [#103]: Set application version to v1.0.0 --- .github/workflows/ci.yaml | 2 +- Dockerfile | 2 +- README.md | 4 ++-- pom.xml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 48be8e6..5b2042e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -76,7 +76,7 @@ jobs: run: mvn -B package --file pom.xml -DskipTests - name: Docker Build - run: docker build -t ghcr.io/${{ secrets.REGISTRY_USERNAME }}/aeroplanner-rest-api:latest -t ghcr.io/${{ secrets.REGISTRY_USERNAME }}/aeroplanner-rest-api:0.0.1-SNAPSHOT . + run: docker build -t ghcr.io/${{ secrets.REGISTRY_USERNAME }}/aeroplanner-rest-api:latest -t ghcr.io/${{ secrets.REGISTRY_USERNAME }}/aeroplanner-rest-api:1.0.0 . - name: Docker login run: docker login ghcr.io -u ${{ secrets.REGISTRY_USERNAME }} -p ${{ secrets.REGISTRY_TOKEN }} diff --git a/Dockerfile b/Dockerfile index 1ab5a0e..6328744 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,4 +17,4 @@ COPY target/aeroplanner-rest-api*.jar . EXPOSE 8005 # Command to run the Spring Boot application -CMD ["java", "-jar", "aeroplanner-rest-api-0.0.1-SNAPSHOT.jar"] +CMD ["java", "-jar", "aeroplanner-rest-api-1.0.0.jar"] diff --git a/README.md b/README.md index 2227fa8..6e4eec9 100644 --- a/README.md +++ b/README.md @@ -103,9 +103,9 @@ To stop the docker containers at once run `docker compose down` and add `--volu Follow the instructions below to push the docker image in the GitHub Container Registry 1. Create personal access token in GitHub via Settings / Developer settings / Personal access tokens -2. Tag the image running `docker build -t ghcr.io/jcilacad/aeroplanner-rest-api:latest -t ghcr.io/jcilacad/aeroplanner-rest-api:0.0.1-SNAPSHOT .` +2. Tag the image running `docker build -t ghcr.io/jcilacad/aeroplanner-rest-api:latest -t ghcr.io/jcilacad/aeroplanner-rest-api:1.0.0 .` 3. Login to registry like `docker login ghcr.io -u jcilacad` providing also the personal access token when prompted -4. Push image to registry : `docker push ghcr.io/jcilacad/aeroplanner-rest-api:latest ghcr.io/jcilacad/aeroplanner-rest-api:0.0.1-SNAPSHOT` +4. Push image to registry : `docker push ghcr.io/jcilacad/aeroplanner-rest-api:latest ghcr.io/jcilacad/aeroplanner-rest-api:1.0.0` ## Run unit tests diff --git a/pom.xml b/pom.xml index 29b60e1..aea9cc6 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ com.projects aeroplanner-rest-api - 0.0.1-SNAPSHOT + 1.0.0 aeroplanner-rest-api Airline Reservation System RESTful API From 08cc8f9ba261b18e8a8bebc7183d793c19bad3b6 Mon Sep 17 00:00:00 2001 From: Panagiotis Bellias Date: Sun, 16 Jun 2024 18:09:00 +0300 Subject: [PATCH 2/2] [#103] Finalize ci workflow --- .github/workflows/ci.yaml | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5b2042e..b8891e9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -2,13 +2,7 @@ name: CI on: pull_request: - branches: - - main - - issue-101-cicd push: - branches: - - main - - issue-101-cicd jobs: build: @@ -83,32 +77,3 @@ jobs: - name: Docker push run: docker push ghcr.io/${{ secrets.REGISTRY_USERNAME }}/aeroplanner-rest-api --all-tags - -# sonar: -# runs-on: ubuntu-latest -# -# needs: test -# -# steps: -# - name: Checkout code -# uses: actions/checkout@v2 -# -# - name: Set up JDK 17 -# uses: actions/setup-java@v2 -# with: -# java-version: '17' -# distribution: 'adopt' -# architecture: 'x64' -# -# - name: Install SonarLint CLI -# run: | -# mkdir sonarlint-cli -# cd sonarlint-cli -# curl -L -o sonarlint-cli.zip https://binaries.sonarsource.com/Distribution/sonarlint-cli-1.0.zip -# ls . -# unzip sonarlint-cli.zip -# chmod +x sonarlint-cli-1.0/bin/sonarlint -# -# - name: Run SonarLint Analysis -# run: | -# ./sonarlint-cli-1.0/bin/sonarlint -Dsonar.java.binaries=target/classes -Dsonar.sources=src/main/java