2023-03-18 18:20:17 +01:00
|
|
|
pipeline {
|
|
|
|
agent any
|
|
|
|
|
|
|
|
stages {
|
2023-03-19 15:48:14 +01:00
|
|
|
stage('[Neutral] - Test') {
|
2023-03-18 22:47:09 +01:00
|
|
|
steps {
|
2023-03-19 12:05:56 +01:00
|
|
|
echo "[Neutral-Deploy] - Test Stage"
|
2023-03-19 17:41:16 +01:00
|
|
|
sh "rm -rf neutral"
|
2023-03-19 17:41:49 +01:00
|
|
|
sh "git clone https://git.raphix.fr/infrastructure/neutral.git"
|
2023-03-19 17:41:16 +01:00
|
|
|
sh "cd neutral"
|
|
|
|
sh "npm i"
|
2023-03-19 17:45:55 +01:00
|
|
|
sh "ENV='TEST' node bin/www"
|
2023-03-19 17:55:09 +01:00
|
|
|
|
2023-03-18 18:20:17 +01:00
|
|
|
}
|
2023-03-18 22:57:04 +01:00
|
|
|
}
|
2023-03-19 15:48:14 +01:00
|
|
|
stage('[Neutral] - Deploy') {
|
2023-03-18 18:20:17 +01:00
|
|
|
steps {
|
2023-03-19 17:55:55 +01:00
|
|
|
userInput = input(
|
2023-03-19 17:55:09 +01:00
|
|
|
id: 'userInput', message: 'Enter path of test reports:?',
|
|
|
|
parameters: [
|
|
|
|
[$class: 'TextParameterDefinition', defaultValue: 'None', description: 'Path of config file', name: 'Config'],
|
|
|
|
[$class: 'TextParameterDefinition', defaultValue: 'None', description: 'Test Info file', name: 'Test']
|
|
|
|
])
|
2023-03-19 12:05:56 +01:00
|
|
|
echo "[Neutral-Deploy] - Deploy Stage"
|
2023-03-19 14:24:45 +01:00
|
|
|
sh "ssh raphix@raphix.fr sudo apt update -y"
|
|
|
|
sh "ssh raphix@raphix.fr sudo apt upgrade -y"
|
2023-03-19 15:48:14 +01:00
|
|
|
sh "ssh raphix@raphix.fr sudo -S -u gitlab-ci /home/gitlab-ci/neutral_deploy.sh"
|
2023-03-18 18:20:17 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|