Skip to content

Commit

Permalink
Merge pull request #20 from jaguililla/develop
Browse files Browse the repository at this point in the history
Update CI release
  • Loading branch information
jaguililla authored Aug 22, 2024
2 parents 2a01457 + 53b3a3a commit f5be854
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 15 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@ jobs:
run: |
source "$HOME/.sdkman/bin/sdkman-init.sh"
sdk env install
export REGISTRY_USERNAME="${GITHUB_ACTOR}"
export REGISTRY_PASSWORD="${GITHUB_TOKEN}"
export GIT_USERNAME="${GITHUB_ACTOR}"
./mvnw -B -P release
./mvnw -D image.registry=ghcr.io/jaguililla/hexagonal_spring -B -P release
- name: Publish Client
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
29 changes: 29 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@

stages:
- build
- release

services:
- name: docker:dind
command:
Expand All @@ -13,6 +17,8 @@ variables:
build:
stage: build
image: ubuntu:24.04
rules:
- if: $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH
cache:
key: build-cache
paths:
Expand All @@ -25,3 +31,26 @@ build:
script:
- sdk env install
- ./mvnw

release:
stage: release
image: ubuntu:24.04
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
before_script:
- apt update
- apt -y install curl zip unzip
- curl -s "https://get.sdkman.io?rcupdate=false" | bash
- source "$HOME/.sdkman/bin/sdkman-init.sh"
script:
- sdk env install
- export REGISTRY_USERNAME="${CI_REGISTRY_USER}"
- export REGISTRY_PASSWORD="${CI_REGISTRY_PASSWORD}"
- export GIT_USERNAME="${GITLAB_USER_NAME}"
- export CLIENT_PATH='target/generated-sources/openapi'
- export CONTROLLERS_PATH='com/github/jaguililla/appointments/http/controllers'
- export REPOSITORY='https://maven.pkg.github.com/jaguililla/hexagonal_spring'
- export ALT_REPOSITORY="altDeploymentRepository=github::default::${REPOSITORY}"
- ./mvnw -D image.registry=${CI_REGISTRY}/jaguililla/hexagonal_spring -B -P release
- rm -rf "${CLIENT_PATH}/src/main/java/${CONTROLLERS_PATH}"
- mvn -f "${CLIENT_PATH}/pom.xml" -B -D ${ALT_REPOSITORY} clean deploy
16 changes: 8 additions & 8 deletions .mvn/parent.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.3.2</version>
<version>3.3.3</version>
<relativePath/>
</parent>

Expand All @@ -24,19 +24,20 @@
<description>Common Maven settings (excluding DB and messaging)</description>

<properties>
<maven>3.9.8</maven>
<maven>3.9.9</maven>
<openApiNullable>false</openApiNullable>
<openapi.package>${project.groupId}.${project.artifactId}.http</openapi.package>
<controllers.package>${openapi.package}.controllers</controllers.package>
<client.package>${openapi.package}.client</client.package>
<image.name>${project.groupId}/${project.artifactId}</image.name>
<image.registry>docker.io</image.registry>
<release.goal>verify</release.goal> <!-- verify | deploy -->
<spring.server>undertow</spring.server> <!-- undertow | jetty -->
<openapi.integration>ui</openapi.integration> <!-- ui | api -->

<java.version>21</java.version>
<springdoc.openapi.version>2.6.0</springdoc.openapi.version>
<openapi.generator.version>7.7.0</openapi.generator.version>
<openapi.generator.version>7.8.0</openapi.generator.version>

<jacoco.version>0.8.12</jacoco.version>
<archunit.version>1.3.0</archunit.version>
Expand Down Expand Up @@ -118,8 +119,7 @@
<JAVA_TOOL_OPTIONS>
-XX:+AlwaysPreTouch -XX:+UseParallelGC -XX:+UseNUMA
</JAVA_TOOL_OPTIONS>
<BP_JVM_JLINK_ENABLED>true</BP_JVM_JLINK_ENABLED>
<BPL_JVM_CDS_ENABLED>true</BPL_JVM_CDS_ENABLED>
<BPL_SPRING_AOT_ENABLED>true</BPL_SPRING_AOT_ENABLED>
<BP_SPRING_AOT_ENABLED>true</BP_SPRING_AOT_ENABLED>
<BP_JVM_VERSION>${java.version}</BP_JVM_VERSION>
</env>
Expand Down Expand Up @@ -261,8 +261,8 @@
<configuration>
<docker>
<publishRegistry>
<username>${env.GITHUB_ACTOR}</username>
<password>${env.GITHUB_TOKEN}</password>
<username>${env.REGISTRY_USERNAME}</username>
<password>${env.REGISTRY_PASSWORD}</password>
</publishRegistry>
</docker>
<publish>true</publish>
Expand All @@ -288,7 +288,7 @@
<argument>config</argument>
<argument>--global</argument>
<argument>user.name</argument>
<argument>${env.GITHUB_ACTOR}</argument>
<argument>${env.GIT_USERNAME}</argument>
</arguments>
</configuration>
</execution>
Expand Down
2 changes: 1 addition & 1 deletion .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
# under the License.
wrapperVersion=3.3.2
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.8/apache-maven-3.9.8-bin.zip
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: appointments
services:

postgres:
image: postgres:16-alpine
image: docker.io/postgres:16-alpine
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: root
Expand All @@ -16,7 +16,7 @@ services:
- "15432:5432"

kafka:
image: apache/kafka:3.7.0
image: docker.io/apache/kafka:3.7.0
environment:
CLUSTER_ID: 4L6g3nShT-eMCtK--X86sw
KAFKA_NODE_ID: 1
Expand All @@ -40,7 +40,7 @@ services:
depends_on:
- postgres
- kafka
image: ghcr.io/jaguililla/hexagonal_spring/com.github.jaguililla/appointments
image: docker.io/com.github.jaguililla/appointments
environment:
GLOBAL_LOG_LEVEL: warn
APPLICATION_LOG_LEVEL: info
Expand Down
3 changes: 1 addition & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</parent>

<artifactId>appointments</artifactId>
<version>0.3.0</version>
<version>0.3.1</version>

<name>Appointments</name>
<description>Application to create appointments (REST API)</description>
Expand All @@ -28,7 +28,6 @@
<client.package>${openapi.package}.client</client.package>
<spring.server>undertow</spring.server>
<openapi.integration>ui</openapi.integration>
<image.registry>ghcr.io/jaguililla/hexagonal_spring</image.registry>
<release.goal>deploy</release.goal>
</properties>

Expand Down

0 comments on commit f5be854

Please sign in to comment.