-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update(Dockerfile and compose file) * refactor(docker compose file) * improve Dockerfile (good practices) * create-snapshot * feat no create release * Update create-snapshot.yml * Update create-snapshot.yml * feat (trigger ci on release) --------- Co-authored-by: Jérôme Bourgeois <[email protected]>
- Loading branch information
1 parent
5ac6873
commit a762de2
Showing
4 changed files
with
105 additions
and
26 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 |
---|---|---|
@@ -0,0 +1,82 @@ | ||
name: Build release candidate | ||
|
||
on: release | ||
|
||
jobs: | ||
check-version: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
release-version: ${{ steps.version.outputs.version }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get version | ||
id: version | ||
run: echo "version=$(mvn -f pom.xml help:evaluate -Dexpression=project.version -q -DforceStdout)-SNAPSHOT" >> $GITHUB_OUTPUT | ||
|
||
- name: Print version | ||
run: echo ${{ steps.version.outputs.version }} | ||
|
||
- uses: mukunku/[email protected] | ||
name: Check tag existence | ||
id: check-tag-exists | ||
with: | ||
tag: ${{ steps.version.outputs.version }} | ||
|
||
- name: Tag verification | ||
id: check-tag | ||
run: | | ||
if [[ "${{ steps.check-tag-exists.outputs.exists }}" == "true" ]]; then | ||
echo "Nothing to tag/release, the tag ${{ steps.version.outputs.version }} already exists" | ||
exit 1 | ||
fi | ||
build-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Extract branch name | ||
shell: bash | ||
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >>$GITHUB_OUTPUT | ||
id: extract_branch | ||
|
||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ steps.extract_branch.outputs.branch }} | ||
|
||
- name: Set up JDK 21 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: "temurin" | ||
java-version: "21" | ||
|
||
- name: Build API | ||
run: mvn package -Dchangelist=-SNAPSHOT --no-transfer-progress | ||
|
||
- name: Upload API jar | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: app-jar | ||
path: target/*.jar | ||
|
||
docker: | ||
needs: | ||
- check-version | ||
- build-release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Download uploaded jar | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: app-jar | ||
path: target/ | ||
|
||
- name: Publish to Docker Hub | ||
uses: elgohr/Publish-Docker-Github-Action@v5 | ||
with: | ||
name: inseefr/bauhaus-back-office | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
tags: "latest, ${{ needs.check-version.outputs.release-version }}" |
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,12 +1,10 @@ | ||
FROM maven:3.6.2 as mvn | ||
WORKDIR /bauhaus | ||
COPY ./ /bauhaus/ | ||
RUN mvn -B -f /bauhaus/pom.xml package | ||
FROM eclipse-temurin:21-jre-alpine | ||
WORKDIR /application | ||
|
||
RUN addgroup -g 10000 javagroup | ||
RUN adduser -D -s / -u 10000 javauser -G javagroup | ||
RUN chown -R 10000:10000 /application | ||
|
||
FROM tomcat:8-jdk8 | ||
COPY --from=mvn bauhaus/target/bauhaus.war /usr/local/tomcat/webapps/ | ||
ADD ./config/start.sh /usr/local/tomcat | ||
RUN chmod +x /usr/local/tomcat/start.sh | ||
ENTRYPOINT [ "/usr/local/tomcat/start.sh"] | ||
CMD ["catalina.sh", "run"] | ||
USER 10000 | ||
COPY target/*.jar bauhaus.jar | ||
ENTRYPOINT ["java", "-jar", "/application/bauhaus.jar"] |
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,15 @@ | ||
name: bauhaus | ||
services: | ||
bauhaus-back: | ||
build: . | ||
ports: | ||
- "8080:8080" | ||
links: | ||
- graphdb:localhost | ||
graphdb: | ||
image: ontotext/graphdb:latest | ||
restart: always | ||
ports: | ||
- "7200:7200" | ||
environment: | ||
GDB_JAVA_OPTS: "-Xmx1g -Xms512M" |
This file was deleted.
Oops, something went wrong.