add raw state of with jenkins
This commit is contained in:
34
Jenkinsfile
vendored
Normal file
34
Jenkinsfile
vendored
Normal 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'"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user