mirror of
https://gitlab.com/etc404/software-engineering-project.git
synced 2026-05-10 20:52:58 +00:00
CI/CD Additions
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
name: Build Docker Container
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "stable" ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Get Metadata
|
||||
id: meta
|
||||
run: |
|
||||
echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT
|
||||
echo REPO_VERSION=$(git describe --tags --always | sed 's/^v//') >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Set up Maven
|
||||
uses: stCarolas/setup-maven@v5
|
||||
with:
|
||||
maven-version: 3.9.14
|
||||
|
||||
- name: Set up JDK 25
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: 25
|
||||
distribution: 'oracle'
|
||||
cache: 'maven'
|
||||
|
||||
- name: Build with Maven
|
||||
run: mvn clean package -Dmaven.test.skip
|
||||
|
||||
- name: Log into registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: https://git.ls-r.net
|
||||
username: etc404
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
push: true
|
||||
tags: |
|
||||
git.ls-r.net/etc404/thymecrunch:${{ steps.meta.outputs.REPO_VERSION }}
|
||||
git.ls-r.net/etc404/thymecrunch:latest
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
FROM eclipse-temurin:25
|
||||
WORKDIR /app
|
||||
COPY target/demo-0.0.1-SNAPSHOT.jar app.jar
|
||||
ENV APP_HOME /usr/src/app
|
||||
COPY target/thymecrunch-0.0.1-SNAPSHOT.jar $APP_HOME/app.jar
|
||||
EXPOSE 8080
|
||||
ENTRYPOINT ["java","-jar","app.jar"]
|
||||
ENTRYPOINT exec java -jar $APP_HOME/app.jar
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<groupId>com.example</groupId>
|
||||
<artifactId>demo</artifactId>
|
||||
<artifactId>thymecrunch</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<name>recipeDemo</name>
|
||||
<name>ThymeCrunch</name>
|
||||
<description>Software engineering recipe project</description>
|
||||
<url/>
|
||||
<licenses>
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
spring.application.name=demo
|
||||
|
||||
|
||||
spring.application.name=thymecrunch
|
||||
|
||||
spring.datasource.url=jdbc:mysql://localhost:3306/demo
|
||||
spring.datasource.username=springuser
|
||||
|
||||
Reference in New Issue
Block a user