From 0b90c2f20044082858ea89279d227d5120718ba5 Mon Sep 17 00:00:00 2001 From: Stefan Kapferer Date: Thu, 25 Jan 2024 10:27:27 +0100 Subject: [PATCH 1/7] dependency updates for spring term 2024 --- .mvn/wrapper/maven-wrapper.properties | 4 ++-- pom.xml | 4 ++-- src/main/resources/templates/index.html | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties index 687668b..2f9352f 100644 --- a/.mvn/wrapper/maven-wrapper.properties +++ b/.mvn/wrapper/maven-wrapper.properties @@ -14,5 +14,5 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.5/apache-maven-3.8.5-bin.zip -wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip +wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar diff --git a/pom.xml b/pom.xml index 16aca80..cc71f3e 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.springframework.boot spring-boot-starter-parent - 2.6.3 + 2.7.18 ch.ost.cloudsolutions @@ -31,7 +31,7 @@ org.webjars bootstrap - 5.1.1 + 5.3.2 org.springframework.boot diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html index 37a796d..378eeb3 100644 --- a/src/main/resources/templates/index.html +++ b/src/main/resources/templates/index.html @@ -4,7 +4,7 @@ Self Information Demo + th:href="@{/webjars/bootstrap/5.3.2/css/bootstrap.min.css}" />
From df1d9f5b678b4d825b8e0caedd520ea50e4c938b Mon Sep 17 00:00:00 2001 From: Stefan Kapferer Date: Fri, 1 Mar 2024 16:09:13 +0100 Subject: [PATCH 2/7] Deploy docker image --- .github/workflows/master.yml | 69 ++++++++++++++++++++++++++++++++++ .github/workflows/standard.yml | 21 +++++++++++ src/main/resources/Dockerfile | 14 +++++++ 3 files changed, 104 insertions(+) create mode 100644 .github/workflows/master.yml create mode 100644 .github/workflows/standard.yml create mode 100644 src/main/resources/Dockerfile diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml new file mode 100644 index 0000000..91a4134 --- /dev/null +++ b/.github/workflows/master.yml @@ -0,0 +1,69 @@ +name: Build (master) + +on: + push: + branches: + - master + tags-ignore: + - '**' + release: + types: [ published ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --file pom.xml + - uses: actions/cache@v2 + id: target-cache + with: + path: ./target/* + key: ${{ github.sha }} + + build_and_publish_docker_image: + name: Build and Publish Docker Image + runs-on: ubuntu-latest + needs: [ build ] + steps: + - uses: actions/checkout@v3 + - uses: actions/cache@v2 + id: target-cache + with: + path: ./target/* + key: ${{ github.sha }} + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Get Project Version from POM + id: project-version + uses: CptMokoena/maven-get-version-action@1.0.3 + - name: Build and Push (latest) + if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' + uses: docker/build-push-action@v5 + with: + context: . + file: ./src/main/resources/Dockerfile + build-args: | + JAR_FILE=self-information-${{ steps.project-version.outputs.version }}.jar + push: true + tags: stefan-ka/ost-self-information-app:latest + - name: Build and Push (latest) + if: github.event_name == 'release' + uses: docker/build-push-action@v5 + with: + context: . + file: ./src/main/resources/Dockerfile + build-args: | + JAR_FILE=self-information-${{ steps.project-version.outputs.version }}.jar + push: true + tags: stefan-ka/ost-self-information-app:${{ github.event.release.tag_name }} \ No newline at end of file diff --git a/.github/workflows/standard.yml b/.github/workflows/standard.yml new file mode 100644 index 0000000..39b3449 --- /dev/null +++ b/.github/workflows/standard.yml @@ -0,0 +1,21 @@ +name: Build (non-master branch) + +on: + push: + branches-ignore: + - master + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --file pom.xml diff --git a/src/main/resources/Dockerfile b/src/main/resources/Dockerfile new file mode 100644 index 0000000..9c1607d --- /dev/null +++ b/src/main/resources/Dockerfile @@ -0,0 +1,14 @@ +FROM openjdk:17-slim-buster + +# add JAR file +ARG JAR_FILE +ADD target/${JAR_FILE} /srv/web/lib/self-information-app.jar + +RUN mkdir /srv/web/tmp +RUN mkdir /srv/web/conf + +ENV DEBUG_OPTS="" +ENV JAVA_OPTS="" + +EXPOSE 8080 +ENTRYPOINT exec java $DEBUG_OPTS $JAVA_OPTS -jar /srv/web/lib/self-information-app.jar --debug From 2e1b8e8d573d3cfb6072831e4aaef88e2c35e141 Mon Sep 17 00:00:00 2001 From: Stefan Kapferer Date: Fri, 1 Mar 2024 16:11:07 +0100 Subject: [PATCH 3/7] Release v0.0.1 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index cc71f3e..a22a686 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ ch.ost.cloudsolutions self-information - 0.0.1-SNAPSHOT + 0.0.1 self-information Demo project for Spring Boot From cf7f39a21cbdc4e17153745ffc5a21ddd9160b0e Mon Sep 17 00:00:00 2001 From: Stefan Kapferer Date: Fri, 1 Mar 2024 16:11:41 +0100 Subject: [PATCH 4/7] Bump to 0.0.2-SNAPSHOT --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a22a686..889e91d 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ ch.ost.cloudsolutions self-information - 0.0.1 + 0.0.2-SNAPSHOT self-information Demo project for Spring Boot From d74ec5d1be1def28d5a82497afe7a9f8744775d8 Mon Sep 17 00:00:00 2001 From: Stefan Kapferer Date: Fri, 1 Mar 2024 16:55:45 +0100 Subject: [PATCH 5/7] fix pipeline --- .github/workflows/master.yml | 6 +++--- .github/workflows/standard.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 91a4134..bbd7f74 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -21,7 +21,7 @@ jobs: distribution: 'temurin' cache: maven - name: Build with Maven - run: mvn -B package --file pom.xml + run: ./mvnw -B package --file pom.xml - uses: actions/cache@v2 id: target-cache with: @@ -56,7 +56,7 @@ jobs: build-args: | JAR_FILE=self-information-${{ steps.project-version.outputs.version }}.jar push: true - tags: stefan-ka/ost-self-information-app:latest + tags: stefankapferer/ost-self-information-app:latest - name: Build and Push (latest) if: github.event_name == 'release' uses: docker/build-push-action@v5 @@ -66,4 +66,4 @@ jobs: build-args: | JAR_FILE=self-information-${{ steps.project-version.outputs.version }}.jar push: true - tags: stefan-ka/ost-self-information-app:${{ github.event.release.tag_name }} \ No newline at end of file + tags: stefankapferer/ost-self-information-app:${{ github.event.release.tag_name }} \ No newline at end of file diff --git a/.github/workflows/standard.yml b/.github/workflows/standard.yml index 39b3449..a02c776 100644 --- a/.github/workflows/standard.yml +++ b/.github/workflows/standard.yml @@ -18,4 +18,4 @@ jobs: distribution: 'temurin' cache: maven - name: Build with Maven - run: mvn -B package --file pom.xml + run: ./mvnw -B package --file pom.xml From f53c68ed38276f9ec94fe550dbfd24ea2da19829 Mon Sep 17 00:00:00 2001 From: Stefan Kapferer Date: Fri, 1 Mar 2024 17:55:45 +0100 Subject: [PATCH 6/7] v0.0.1 (second try) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 889e91d..a22a686 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ ch.ost.cloudsolutions self-information - 0.0.2-SNAPSHOT + 0.0.1 self-information Demo project for Spring Boot From 2c368d6e6df46e1568f8980f68f65cb2ffc526c6 Mon Sep 17 00:00:00 2001 From: Stefan Kapferer Date: Fri, 1 Mar 2024 17:56:19 +0100 Subject: [PATCH 7/7] Bump version to 0.0.2-SNAPSHOT --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a22a686..b6d862b 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ ch.ost.cloudsolutions self-information - 0.0.1 + 0.0.2--SNAPSHOT self-information Demo project for Spring Boot