dev/actions #26

Merged
tom_trgr merged 41 commits from dev/actions into dev/main 2025-08-29 15:36:00 +02:00
6 changed files with 49 additions and 26 deletions
Showing only changes of commit 34bd44db5c - Show all commits

View File

@@ -1,8 +1,6 @@
module arbeitszeitmessung
go 1.23.0
toolchain go1.24.5
go 1.24.5
require github.com/lib/pq v1.10.9

View File

@@ -20,7 +20,7 @@ services:
- 8001:8080
backend:
build: ../Backend
image: git.letsstein.de/tom/arbeitszeit-backend:0.1.1
image: git.letsstein.de/tom/arbeitszeitmessung
restart: unless-stopped
env_file:
- .env

View File

@@ -7,7 +7,6 @@ services:
- .env.test
environment:
PGDATA: /var/lib/postgresql/data/pg_data
volumes:
- ${POSTGRES_PATH}/initdb:/docker-entrypoint-initdb.d
# volumes: //- ${POSTGRES_PATH}/initdb:/docker-entrypoint-initdb.d
ports:
- 5433:5432

View File

@@ -17,7 +17,7 @@ services:
- 5432:5432
backend:
image: git.letsstein.de/tom/arbeitszeit-backend
image: git.letsstein.de/tom/arbeitszeitmessung
env_file:
- .env
environment:

32
Jenkinsfile vendored
View File

@@ -3,6 +3,9 @@ pipeline {
DOCKER_USERNAME = 'jenkins'
DOCKER_PASSWORD = credentials('gitea_jenkins')
SONAR_TOKEN = credentials('sonarcube_token')
POSTGRES_USER = 'postgres'
POSTGRES_PASSWORD = 'password'
POSTGRES_DB = 'arbeitszeitmessung'
}
agent any
@@ -11,12 +14,35 @@ pipeline {
stage('Test') {
agent {
docker {
image 'golang:alpine'
image ''
args ''
args ''
}
}
steps {
sh 'cd Backend && go mod download && go mod verify'
sh 'make test'
script {
sh '''
docker run -d --rm \
--name test-db \
-e POSTGRES_USER={$POSTGRES_USER} \
-e POSTGRES_PASSWORD={$POSTGRES_PASSWORD} \
-e POSTGRES_DB={$POSTGRES_DB} \
-v ./DB/initdb:/docker-entrypoint-initdb.d\
-p "5432:5432" \
postgres:16
'''
// docker.image('golang:1.24.5').withRun(
// '-u root:root --network=host'
// ) { go ->
// // wait for DB to start
// sh '''
// cd Backend \
// go mod download && go mod tidy \
// go test ./... -v
// '''
// }
}
}
}
stage('SonarCube Analysis') {