35 lines
863 B
Groovy
35 lines
863 B
Groovy
|
|
|
|
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'"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|