Merge branch 'main' of https://git.ruff.co.il/amai.ig/otomai
This commit is contained in:
@@ -1,2 +1,2 @@
|
|||||||
FROM httpd:latest
|
FROM httpd:latest
|
||||||
COPY ./game-data/ /usr/local/apache2/htdocs
|
COPY ./game-data/ /usr/local/apache2/htdocs
|
||||||
12
Jenkinsfile
vendored
12
Jenkinsfile
vendored
@@ -57,7 +57,7 @@ pipeline {
|
|||||||
}
|
}
|
||||||
stage('Clean Old Container') {
|
stage('Clean Old Container') {
|
||||||
steps {
|
steps {
|
||||||
catchError(buildResult: 'SUCCESS',message: 'Container doesn\'t exist on host, skipping...', stageResult: 'ABORTED') {
|
catchError(buildResult: 'SUCCESS', message: 'Container doesn\'t exist on host, skipping...', stageResult: 'ABORTED') {
|
||||||
sh 'docker stop otomai'
|
sh 'docker stop otomai'
|
||||||
sh 'docker rm otomai'
|
sh 'docker rm otomai'
|
||||||
}
|
}
|
||||||
@@ -80,4 +80,14 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
post {
|
||||||
|
success {
|
||||||
|
// Trigger the deploy-prod-job on success of the build
|
||||||
|
build job: 'otomai-prod', wait: false
|
||||||
|
}
|
||||||
|
failure {
|
||||||
|
// Optionally, you can handle failure scenarios (e.g., notify team, etc.)
|
||||||
|
echo "Build failed, deployment not triggered."
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
31
Jenkinsfile-prod
Normal file
31
Jenkinsfile-prod
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
pipeline {
|
||||||
|
agent {
|
||||||
|
label 'prod' // Runs on a node labeled 'prod'
|
||||||
|
}
|
||||||
|
stages {
|
||||||
|
stage('Clean Old Container') {
|
||||||
|
steps {
|
||||||
|
script {
|
||||||
|
catchError(buildResult: 'SUCCESS', message: 'Container doesn\'t exist on host, skipping...', stageResult: 'ABORTED') {
|
||||||
|
sh 'docker stop game-pod1'
|
||||||
|
sh 'docker rm game-pod1'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Run new container in Production') {
|
||||||
|
steps {
|
||||||
|
script {
|
||||||
|
// Define registry credentials and image name
|
||||||
|
def registryCredentialsId = '7e506860-ca64-47bd-92a8-1a591dd12cba'
|
||||||
|
def imageName = 'git.ruff.co.il/amai.ig/otomai:latest'
|
||||||
|
|
||||||
|
// Login to registry and run container in prod environment
|
||||||
|
docker.withRegistry('https://git.ruff.co.il', registryCredentialsId) {
|
||||||
|
docker.image(imageName).run('-p 22443:80 --name game-pod1')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user