add raw state of with jenkins

rapp/pick-what-you-like
Robert Rapp 2025-02-24 14:07:22 +01:00
parent 69323be965
commit 9afa8808db
4 changed files with 49 additions and 4 deletions

3
.gitignore vendored
View File

@ -2,4 +2,5 @@ volumes
apps/proxy
.DS_Store
apps/administration/*
apps/tools/app/*
apps/tools/app/*
env/secrets.env

34
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,34 @@
pipeline {
agent any
stages {
stage('Checkout Code & Submodules') {
steps {
git branch: 'main', url: 'git@github.com:your-org/my-main-repo.git', credentialsId: 'git-credentials'
sh 'git submodule update --init --recursive'
}
}
stage('Run Backend Pipeline') {
steps {
build job: 'backend-pipeline', wait: true
}
}
stage('Run Frontend Pipeline') {
steps {
build job: 'frontend-pipeline', wait: true
}
}
stage('Deploy Infrastructure') {
steps {
sshagent(['jenkins-ssh-key']) {
sh "ssh user@server 'cd /opt/myapp && git pull origin main && docker compose up -d'"
}
}
}
}
}

View File

@ -1,5 +1,4 @@
version: '3.8'
### Jenkins (./apps/frontend/docker-compose.yml)
services:
jenkins:
image: jenkins/jenkins:lts
@ -7,7 +6,10 @@ services:
ports:
- "50000:50000" # Jenkins Agent Port
volumes:
- jenkins_home:/var/jenkins_home
- ../../../volumes/develop/jenkins:/var/jenkins_home
- ./plugins.yml:/usr/share/jenkins/ref/plugins.yml
depends_on:
- jenkins-plugins
environment:
- JAVA_OPTS=-Djenkins.install.runSetupWizard=false
networks:
@ -21,6 +23,14 @@ services:
- "traefik.http.services.jenkins.loadbalancer.server.port=8080" # interner Port von Jenkins
- "traefik.docker.network=proxy"
jenkins-plugins:
image: jenkins/jenkins:lts-jdk17
command: >
jenkins-plugin-cli -f /usr/share/jenkins/ref/plugins.yml --available-updates --output txt > /usr/share/jenkins/ref/plugins.yml
volumes:
- ./plugins.yml:/usr/share/jenkins/ref/plugins.yml
restart: "no"
volumes:
jenkins_home:
driver: local

View File