neutral-old/Jenkinsfile

38 lines
1.2 KiB
Plaintext
Raw Normal View History

2023-03-18 17:20:17 +00:00
pipeline {
agent any
stages {
stage('[Neutral] - Test') {
2023-03-18 21:47:09 +00:00
steps {
2023-03-19 11:05:56 +00:00
echo "[Neutral-Deploy] - Test Stage"
2023-03-19 16:41:16 +00:00
sh "rm -rf neutral"
2023-03-19 16:41:49 +00:00
sh "git clone https://git.raphix.fr/infrastructure/neutral.git"
2023-03-19 16:41:16 +00:00
sh "cd neutral"
sh "npm i"
2023-03-19 16:45:55 +00:00
sh "ENV='TEST' node bin/www"
2023-03-19 16:55:09 +00:00
2023-03-18 17:20:17 +00:00
}
2023-03-18 21:57:04 +00:00
}
stage('[Neutral] - Deploy') {
2023-03-18 17:20:17 +00:00
steps {
2023-03-19 16:56:35 +00:00
script {
2023-03-19 17:00:57 +00:00
def doesJavaRock = input(message: 'Confirmation de Déploiement', ok: 'Yes',
parameters: [booleanParam(defaultValue: true,
description: 'Confirmation',name: 'Oui')])
if(doesJavaRock == true) {
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"
} else {
echo "aborted"
}
2023-03-19 16:56:35 +00:00
}
2023-03-19 17:00:57 +00:00
2023-03-18 17:20:17 +00:00
}
}
}
}