From a01851211ff12fdc899976bdd3cb2c89aee429f7 Mon Sep 17 00:00:00 2001 From: Raphix Date: Sun, 19 Mar 2023 14:23:55 +0100 Subject: [PATCH] Fix Install Jenkins --- Jenkinsfile | 14 +++++--------- bin/www | 2 +- script/neutral_deploy.sh | 20 ++++++++++++++++++++ 3 files changed, 26 insertions(+), 10 deletions(-) create mode 100644 script/neutral_deploy.sh diff --git a/Jenkinsfile b/Jenkinsfile index 34529a2..fe31178 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,24 +2,20 @@ pipeline { agent any stages { - stage('Install Neutral') { - steps { - echo "[Neutral-Deploy] - Installation Stage" - sh "ssh raphix@raphix.fr 'pwd'" - - } - } stage('Test Neutral') { steps { echo "[Neutral-Deploy] - Test Stage" - sh "ssh raphix@raphix.fr 'pwd'" + // sh "git clone git clone https://git.raphix.fr/infrastructure/neutral.git neutral" + } } stage('Deploy Neutral') { steps { echo "[Neutral-Deploy] - Deploy Stage" - sh "ssh raphix@raphix.fr 'echo Test'" + sh "ssh raphix@raphix.fr sudo apt update" + sh "ssh raphix@raphix.fr sudo apt upgrade" + sh "ssh raphix@raphix.fr /home/gitlab-ci/neutral_deploy.sh" } } } diff --git a/bin/www b/bin/www index 7f27a02..e0dd635 100644 --- a/bin/www +++ b/bin/www @@ -12,7 +12,7 @@ var http = require('http'); * Get port from environment and store in Express. */ -var port = normalizePort(process.env.PORT || '80'); +var port = normalizePort(process.env.PORT || '3001'); app.set('port', port); /** diff --git a/script/neutral_deploy.sh b/script/neutral_deploy.sh new file mode 100644 index 0000000..85d2acf --- /dev/null +++ b/script/neutral_deploy.sh @@ -0,0 +1,20 @@ +echo "[Neutral-Deploy] - Stage - Déploiement - START " +echo "[Neutral-Deploy] - Arrêt de Neutral : Processing" +pm2 stop Neutral +pm2 delete neutral +echo "[Neutral-Deploy] - Arrêt de Neutral : Success" +echo "[Neutral-Deploy] - Supression de Neutral : Processing" +rm -rf ./neutral +echo "[Neutral-Deploy] - Supression de Neutral : Success" +echo "[Neutral-Deploy] - Installation de Neutral : Processing" +git clone https://git.raphix.fr/infrastructure/neutral.git +echo "[Neutral-Deploy] - Installation de Neutral : Success" +echo "[Neutral-Deploy] - Installation des dépendances : Processing" +cd ./neutral +npm install +echo "[Neutral-Deploy] - Installation des dépendances : Success" +echo "[Neutral-Deploy] - Démarrage de Neutral : Processing" +cd .. +pm2 start neutral.config.js +echo "[Neutral-Deploy] - Démarrage de Neutral : Success" +echo "[Neutral-Deploy] - Stage - Déploiement - END"