Raphix
85b2e36089
Some checks reported errors
Neutral/pipeline/head Something is wrong with the build of this commit
46 lines
1.4 KiB
Groovy
46 lines
1.4 KiB
Groovy
pipeline {
|
|
agent any
|
|
|
|
stages {
|
|
stage('[Neutral] - Check Version') {
|
|
steps {
|
|
script {
|
|
def commit_name = env.TAG_NAME
|
|
if(commit_name) {
|
|
echo "[Neutral] - Deployement version reconnu"
|
|
|
|
} else {
|
|
currentBuild.result = 'ABORTED'
|
|
return
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
stage('[Neutral] - Test') {
|
|
steps {
|
|
echo "[Neutral-Deploy] - Test Stage"
|
|
sh "rm -rf neutral"
|
|
sh "git clone https://git.raphix.fr/infrastructure/neutral.git"
|
|
sh "cd neutral"
|
|
sh "npm i"
|
|
sh "ENV='TEST' node bin/www"
|
|
|
|
}
|
|
}
|
|
stage('[Neutral] - Déploiement') {
|
|
steps {
|
|
script {
|
|
def doesJavaRock = input(message: 'Confirmation de Déploiement', ok: 'Déployer')
|
|
echo "[Neutral-Deploy] - Deploy Stage"
|
|
sh "ssh raphix@raphix.fr sudo apt update -y"
|
|
sh "ssh raphix@raphix.fr sudo apt upgrade -y"
|
|
sh "ssh raphix@raphix.fr sudo -S -u gitlab-ci /home/gitlab-ci/neutral_deploy.sh"
|
|
|
|
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
} |