add raw state of with jenkins
parent
69323be965
commit
9afa8808db
|
@ -2,4 +2,5 @@ volumes
|
||||||
apps/proxy
|
apps/proxy
|
||||||
.DS_Store
|
.DS_Store
|
||||||
apps/administration/*
|
apps/administration/*
|
||||||
apps/tools/app/*
|
apps/tools/app/*
|
||||||
|
env/secrets.env
|
||||||
|
|
|
@ -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'"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,5 +1,4 @@
|
||||||
version: '3.8'
|
### Jenkins (./apps/frontend/docker-compose.yml)
|
||||||
|
|
||||||
services:
|
services:
|
||||||
jenkins:
|
jenkins:
|
||||||
image: jenkins/jenkins:lts
|
image: jenkins/jenkins:lts
|
||||||
|
@ -7,7 +6,10 @@ services:
|
||||||
ports:
|
ports:
|
||||||
- "50000:50000" # Jenkins Agent Port
|
- "50000:50000" # Jenkins Agent Port
|
||||||
volumes:
|
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:
|
environment:
|
||||||
- JAVA_OPTS=-Djenkins.install.runSetupWizard=false
|
- JAVA_OPTS=-Djenkins.install.runSetupWizard=false
|
||||||
networks:
|
networks:
|
||||||
|
@ -21,6 +23,14 @@ services:
|
||||||
- "traefik.http.services.jenkins.loadbalancer.server.port=8080" # interner Port von Jenkins
|
- "traefik.http.services.jenkins.loadbalancer.server.port=8080" # interner Port von Jenkins
|
||||||
- "traefik.docker.network=proxy"
|
- "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:
|
volumes:
|
||||||
jenkins_home:
|
jenkins_home:
|
||||||
driver: local
|
driver: local
|
||||||
|
|
Loading…
Reference in New Issue