From 10c94f2a1d2fd2a20cbf7b7f965dbd1ef1339457 Mon Sep 17 00:00:00 2001 From: Raphix Date: Fri, 24 Feb 2023 14:15:02 +0000 Subject: [PATCH 01/73] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..ef470f3 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,41 @@ +# This file is a template, and might need editing before it works on your project. +# You can copy and paste this template into a new `.gitlab-ci.yml` file. +# You should not add this template to an existing `.gitlab-ci.yml` file by using the `include:` keyword. +# +# To contribute improvements to CI/CD templates, please follow the Development guide at: +# https://docs.gitlab.com/ee/development/cicd/templates.html +# This specific template is located at: +# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Nodejs.gitlab-ci.yml + +# Official framework image. Look for the different tagged releases at: +# https://hub.docker.com/r/library/node/tags/ +image: node:latest + +# Pick zero or more services to be used on all builds. +# Only needed when using a docker container to run your tests in. +# Check out: https://docs.gitlab.com/ee/ci/services/index.html +services: + - mysql:latest + - redis:latest + - postgres:latest + +# This folder is cached between builds +# https://docs.gitlab.com/ee/ci/yaml/index.html#cache +cache: + paths: + - node_modules/ + +test_async: + script: + - npm install + - node ./specs/start.js ./specs/async.spec.js + +test_db: + script: + - npm install + - node ./specs/start.js ./specs/db-postgres.spec.js + +deploy: + stage: deploy + script: echo "Define your deployment script!" + environment: production -- 2.30.2 From 92551093f524012620b613533cba2a95660bcdbb Mon Sep 17 00:00:00 2001 From: Raphix Date: Fri, 24 Feb 2023 14:15:53 +0000 Subject: [PATCH 02/73] Delete .gitlab-ci.yml --- .gitlab-ci.yml | 41 ----------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index ef470f3..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,41 +0,0 @@ -# This file is a template, and might need editing before it works on your project. -# You can copy and paste this template into a new `.gitlab-ci.yml` file. -# You should not add this template to an existing `.gitlab-ci.yml` file by using the `include:` keyword. -# -# To contribute improvements to CI/CD templates, please follow the Development guide at: -# https://docs.gitlab.com/ee/development/cicd/templates.html -# This specific template is located at: -# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Nodejs.gitlab-ci.yml - -# Official framework image. Look for the different tagged releases at: -# https://hub.docker.com/r/library/node/tags/ -image: node:latest - -# Pick zero or more services to be used on all builds. -# Only needed when using a docker container to run your tests in. -# Check out: https://docs.gitlab.com/ee/ci/services/index.html -services: - - mysql:latest - - redis:latest - - postgres:latest - -# This folder is cached between builds -# https://docs.gitlab.com/ee/ci/yaml/index.html#cache -cache: - paths: - - node_modules/ - -test_async: - script: - - npm install - - node ./specs/start.js ./specs/async.spec.js - -test_db: - script: - - npm install - - node ./specs/start.js ./specs/db-postgres.spec.js - -deploy: - stage: deploy - script: echo "Define your deployment script!" - environment: production -- 2.30.2 From f4779190b16aec3ad08b2710d1a02a0bf17c9250 Mon Sep 17 00:00:00 2001 From: Raphix Date: Sat, 18 Mar 2023 18:20:17 +0100 Subject: [PATCH 03/73] Add of Jenknis File and setup repo --- Jenkinsfile | 16 ++++++++++++++++ public/templates/files.html | 6 +++--- users/0cee5da6-6812-49d8-97f5-2df5c1d78191.json | 6 +++--- 3 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..013cfc0 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,16 @@ +pipeline { + agent any + + stages { + stage('Testing Express Node JS') { + steps { + echo "Testing Neutral" + } + } + stage('Deploy Neutral') { + steps { + echo "Deploying Neutral" + } + } + } +} \ No newline at end of file diff --git a/public/templates/files.html b/public/templates/files.html index c769207..36a8849 100644 --- a/public/templates/files.html +++ b/public/templates/files.html @@ -239,7 +239,7 @@ last_dir.addEventListener("click", () => { - var cdSplit = currentDir.value.split("\\") + var cdSplit = currentDir.value.split("/") if(cdSplit.slice(-1) == "") { @@ -253,7 +253,7 @@ } - currentDir.value = cdSplit.join("\\") + currentDir.value = cdSplit.join("/") getDirectory(currentDir.value) @@ -294,7 +294,7 @@ if(currentDir.value.slice(-1) != "\\" && currentDir.value.slice(-1) != "/") { - currentDir.value = currentDir.value + "\\" + file.name + currentDir.value = currentDir.value + "/" + file.name } else if(currentDir.value.slice(-1) == "/") { diff --git a/users/0cee5da6-6812-49d8-97f5-2df5c1d78191.json b/users/0cee5da6-6812-49d8-97f5-2df5c1d78191.json index c810756..ae62bea 100644 --- a/users/0cee5da6-6812-49d8-97f5-2df5c1d78191.json +++ b/users/0cee5da6-6812-49d8-97f5-2df5c1d78191.json @@ -5,9 +5,9 @@ "fullname": "Raphael PICOT", "permissionLevel": 4, "token": { - "tokenID": "0c2ac628-848e-42dd-9def-aaccac08b058", + "tokenID": "748eac04-7725-4da3-a5ce-e02655e9a320", "livableToken": true, - "createdAt": 1677339339934 + "createdAt": 1677602543822 }, - "lastconnexion": 1677421147948 + "lastconnexion": 1677602755015 } \ No newline at end of file -- 2.30.2 From 962395a0ff819042ce65d1109634d450e349b2c5 Mon Sep 17 00:00:00 2001 From: Raphix Date: Sat, 18 Mar 2023 22:47:09 +0100 Subject: [PATCH 04/73] Jenkins Test Build --- Jenkinsfile | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 013cfc0..86b5ad9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,14 +2,22 @@ pipeline { agent any stages { - stage('Testing Express Node JS') { + stage('Install Neutral') { steps { - echo "Testing Neutral" + echo "[Neutral-Deploy] - Installation Stage". + ssh -i /home/raphix/sshkey/alpha raphix@alpha.raphix.fr 'pwd' + } + } + stage('Test Neutral') { + steps { + echo "[Neutral-Deploy] - Test Stage" + ssh -i /home/raphix/sshkey/alpha raphix@alpha.raphix.fr 'pwd' } } stage('Deploy Neutral') { steps { - echo "Deploying Neutral" + echo "[Neutral-Deploy] - Deploy Stage" + ssh -i /home/raphix/sshkey/alpha raphix@alpha.raphix.fr 'pwd' } } } -- 2.30.2 From 58db36735df3cf5dffe0bd63dca8b61645493f48 Mon Sep 17 00:00:00 2001 From: Raphix Date: Sat, 18 Mar 2023 22:51:27 +0100 Subject: [PATCH 05/73] Jenkins Test Build --- Jenkinsfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 86b5ad9..05c97a8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,19 +5,19 @@ pipeline { stage('Install Neutral') { steps { echo "[Neutral-Deploy] - Installation Stage". - ssh -i /home/raphix/sshkey/alpha raphix@alpha.raphix.fr 'pwd' + ssh -i /home/raphix/sshkey/alpha raphix@alpha.raphix.fr 'pwd'.execute() } } stage('Test Neutral') { steps { echo "[Neutral-Deploy] - Test Stage" - ssh -i /home/raphix/sshkey/alpha raphix@alpha.raphix.fr 'pwd' + ssh -i /home/raphix/sshkey/alpha raphix@alpha.raphix.fr 'pwd'.execute() } } stage('Deploy Neutral') { steps { echo "[Neutral-Deploy] - Deploy Stage" - ssh -i /home/raphix/sshkey/alpha raphix@alpha.raphix.fr 'pwd' + "ssh -i /home/raphix/sshkey/alpha raphix@alpha.raphix.fr 'pwd'".execute() } } } -- 2.30.2 From 28e6a05863bcdf1f5732d24a0542bb6b82d02357 Mon Sep 17 00:00:00 2001 From: Raphix Date: Sat, 18 Mar 2023 22:52:14 +0100 Subject: [PATCH 06/73] Jenkins Test Build #3 --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 05c97a8..11457ab 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,13 +5,13 @@ pipeline { stage('Install Neutral') { steps { echo "[Neutral-Deploy] - Installation Stage". - ssh -i /home/raphix/sshkey/alpha raphix@alpha.raphix.fr 'pwd'.execute() + "ssh -i /home/raphix/sshkey/alpha raphix@alpha.raphix.fr 'pwd'".execute() } } stage('Test Neutral') { steps { echo "[Neutral-Deploy] - Test Stage" - ssh -i /home/raphix/sshkey/alpha raphix@alpha.raphix.fr 'pwd'.execute() + "ssh -i /home/raphix/sshkey/alpha raphix@alpha.raphix.fr 'pwd'".execute() } } stage('Deploy Neutral') { -- 2.30.2 From 2b63534d4d17b68d5c1e68a0e6dc718bf125ecca Mon Sep 17 00:00:00 2001 From: Raphix Date: Sat, 18 Mar 2023 22:53:41 +0100 Subject: [PATCH 07/73] Jenkins Test Build #4 --- Jenkinsfile | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 11457ab..cd10ab2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,20 +4,23 @@ pipeline { stages { stage('Install Neutral') { steps { - echo "[Neutral-Deploy] - Installation Stage". - "ssh -i /home/raphix/sshkey/alpha raphix@alpha.raphix.fr 'pwd'".execute() + String result = echo "[Neutral-Deploy] - Installation Stage". + "ssh -i /home/raphix/sshkey/alpha raphix@alpha.raphix.fr 'pwd'".execute().text + println result.toUpperCase() } } stage('Test Neutral') { steps { - echo "[Neutral-Deploy] - Test Stage" - "ssh -i /home/raphix/sshkey/alpha raphix@alpha.raphix.fr 'pwd'".execute() + String result = echo "[Neutral-Deploy] - Test Stage" + "ssh -i /home/raphix/sshkey/alpha raphix@alpha.raphix.fr 'pwd'".execute().text + println result.toUpperCase() } } stage('Deploy Neutral') { steps { - echo "[Neutral-Deploy] - Deploy Stage" - "ssh -i /home/raphix/sshkey/alpha raphix@alpha.raphix.fr 'pwd'".execute() + String result = echo "[Neutral-Deploy] - Deploy Stage" + "ssh -i /home/raphix/sshkey/alpha raphix@alpha.raphix.fr 'pwd'".execute().text + println result.toUpperCase() } } } -- 2.30.2 From fdc39addaea7fc5e8646abd23ee22582af748c03 Mon Sep 17 00:00:00 2001 From: Raphix Date: Sat, 18 Mar 2023 22:54:36 +0100 Subject: [PATCH 08/73] Jenkins Test Build #5 --- Jenkinsfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index cd10ab2..33a92da 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,22 +4,22 @@ pipeline { stages { stage('Install Neutral') { steps { - String result = echo "[Neutral-Deploy] - Installation Stage". - "ssh -i /home/raphix/sshkey/alpha raphix@alpha.raphix.fr 'pwd'".execute().text + echo "[Neutral-Deploy] - Installation Stage". + String result = "ssh -i /home/raphix/sshkey/alpha raphix@alpha.raphix.fr 'pwd'".execute().text println result.toUpperCase() } } stage('Test Neutral') { steps { - String result = echo "[Neutral-Deploy] - Test Stage" - "ssh -i /home/raphix/sshkey/alpha raphix@alpha.raphix.fr 'pwd'".execute().text + echo "[Neutral-Deploy] - Test Stage" + String result = "ssh -i /home/raphix/sshkey/alpha raphix@alpha.raphix.fr 'pwd'".execute().text println result.toUpperCase() } } stage('Deploy Neutral') { steps { - String result = echo "[Neutral-Deploy] - Deploy Stage" - "ssh -i /home/raphix/sshkey/alpha raphix@alpha.raphix.fr 'pwd'".execute().text + echo "[Neutral-Deploy] - Deploy Stage" + String result = "ssh -i /home/raphix/sshkey/alpha raphix@alpha.raphix.fr 'pwd'".execute().text println result.toUpperCase() } } -- 2.30.2 From b4c3c503e9c11de04d36031e0ab46c5709eee807 Mon Sep 17 00:00:00 2001 From: Raphix Date: Sat, 18 Mar 2023 22:56:33 +0100 Subject: [PATCH 09/73] Jenkins Test Build #6 --- Jenkinsfile | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 33a92da..94e3f88 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,22 +5,21 @@ pipeline { stage('Install Neutral') { steps { echo "[Neutral-Deploy] - Installation Stage". - String result = "ssh -i /home/raphix/sshkey/alpha raphix@alpha.raphix.fr 'pwd'".execute().text - println result.toUpperCase() + sh "ssh -i /home/raphix/sshkey/alpha raphix@alpha.raphix.fr 'pwd'" + } } stage('Test Neutral') { steps { echo "[Neutral-Deploy] - Test Stage" - String result = "ssh -i /home/raphix/sshkey/alpha raphix@alpha.raphix.fr 'pwd'".execute().text - println result.toUpperCase() + sh "ssh -i /home/raphix/sshkey/alpha raphix@alpha.raphix.fr 'pwd'" + } - } + }, stage('Deploy Neutral') { steps { echo "[Neutral-Deploy] - Deploy Stage" - String result = "ssh -i /home/raphix/sshkey/alpha raphix@alpha.raphix.fr 'pwd'".execute().text - println result.toUpperCase() + sh "ssh -i /home/raphix/sshkey/alpha raphix@alpha.raphix.fr 'pwd'" } } } -- 2.30.2 From f851cad4f6ef5f4f43d9951f141e8b866de4b755 Mon Sep 17 00:00:00 2001 From: Raphix Date: Sat, 18 Mar 2023 22:57:04 +0100 Subject: [PATCH 10/73] Jenkins Test Build #7 --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 94e3f88..0351f5a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -15,7 +15,7 @@ pipeline { sh "ssh -i /home/raphix/sshkey/alpha raphix@alpha.raphix.fr 'pwd'" } - }, + } stage('Deploy Neutral') { steps { echo "[Neutral-Deploy] - Deploy Stage" -- 2.30.2 From 75950073b18e54f7a86e9ac0a794b435b7f1ca45 Mon Sep 17 00:00:00 2001 From: Raphix Date: Sat, 18 Mar 2023 22:57:35 +0100 Subject: [PATCH 11/73] Jenkins Test Build #8 --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0351f5a..742c153 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,7 +4,7 @@ pipeline { stages { stage('Install Neutral') { steps { - echo "[Neutral-Deploy] - Installation Stage". + echo "[Neutral-Deploy] - Installation Stage" sh "ssh -i /home/raphix/sshkey/alpha raphix@alpha.raphix.fr 'pwd'" } -- 2.30.2 From ab506f1e5cb9cd6ddf927db7b9cad423caadbc04 Mon Sep 17 00:00:00 2001 From: Raphix Date: Sun, 19 Mar 2023 12:03:29 +0100 Subject: [PATCH 12/73] Jenkins Test #9 --- Jenkinsfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 742c153..7fe0938 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,21 +5,21 @@ pipeline { stage('Install Neutral') { steps { echo "[Neutral-Deploy] - Installation Stage" - sh "ssh -i /home/raphix/sshkey/alpha raphix@alpha.raphix.fr 'pwd'" + sh "ssh raphix@raphix.fr 'pwd'" } } stage('Test Neutral') { steps { echo "[Neutral-Deploy] - Test Stage" - sh "ssh -i /home/raphix/sshkey/alpha raphix@alpha.raphix.fr 'pwd'" + sh "ssh raphix@raphix.fr 'pwd'" } } stage('Deploy Neutral') { steps { echo "[Neutral-Deploy] - Deploy Stage" - sh "ssh -i /home/raphix/sshkey/alpha raphix@alpha.raphix.fr 'pwd'" + sh "ssh raphix@raphix.fr 'pwd'" } } } -- 2.30.2 From b1ff588c229d4aafc4668edc90943ea524213569 Mon Sep 17 00:00:00 2001 From: Raphix Date: Sun, 19 Mar 2023 12:05:56 +0100 Subject: [PATCH 13/73] Jenkins Test #10 --- Jenkinsfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7fe0938..dfddfc4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,21 +5,21 @@ pipeline { stage('Install Neutral') { steps { echo "[Neutral-Deploy] - Installation Stage" - sh "ssh raphix@raphix.fr 'pwd'" + sh "ssh -i /home/raphix/.ssh/id_rsa raphix@raphix.fr 'pwd'" } } stage('Test Neutral') { steps { - echo "[Neutral-Deploy] - Test Stage" - sh "ssh raphix@raphix.fr 'pwd'" + echo "[Neutral-Deploy] - Test Stage" + sh "ssh -i /home/raphix/.ssh/id_rsa raphix@raphix.fr 'pwd'" } } stage('Deploy Neutral') { steps { - echo "[Neutral-Deploy] - Deploy Stage" - sh "ssh raphix@raphix.fr 'pwd'" + echo "[Neutral-Deploy] - Deploy Stage" + sh "ssh -i /home/raphix/.ssh/id_rsa raphix@raphix.fr 'pwd'" } } } -- 2.30.2 From a9482fe45c62d0c6caafdd28b9bee3e708afe435 Mon Sep 17 00:00:00 2001 From: Raphix Date: Sun, 19 Mar 2023 12:11:45 +0100 Subject: [PATCH 14/73] Jenkins Test #11 --- Jenkinsfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index dfddfc4..2fbacc4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,21 +5,21 @@ pipeline { stage('Install Neutral') { steps { echo "[Neutral-Deploy] - Installation Stage" - sh "ssh -i /home/raphix/.ssh/id_rsa raphix@raphix.fr 'pwd'" + sh "ssh raphix@raphix.fr 'pwd'" } } stage('Test Neutral') { steps { echo "[Neutral-Deploy] - Test Stage" - sh "ssh -i /home/raphix/.ssh/id_rsa raphix@raphix.fr 'pwd'" + sh "ssh raphix@raphix.fr 'pwd'" } } stage('Deploy Neutral') { steps { echo "[Neutral-Deploy] - Deploy Stage" - sh "ssh -i /home/raphix/.ssh/id_rsa raphix@raphix.fr 'pwd'" + sh "ssh raphix@raphix.fr 'pwd'" } } } -- 2.30.2 From 9a354b69b5361e9207459aef23526aead11dc6ef Mon Sep 17 00:00:00 2001 From: Raphix Date: Sun, 19 Mar 2023 12:16:34 +0100 Subject: [PATCH 15/73] Jenkins Test #12 --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2fbacc4..34529a2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -19,7 +19,7 @@ pipeline { stage('Deploy Neutral') { steps { echo "[Neutral-Deploy] - Deploy Stage" - sh "ssh raphix@raphix.fr 'pwd'" + sh "ssh raphix@raphix.fr 'echo Test'" } } } -- 2.30.2 From a01851211ff12fdc899976bdd3cb2c89aee429f7 Mon Sep 17 00:00:00 2001 From: Raphix Date: Sun, 19 Mar 2023 14:23:55 +0100 Subject: [PATCH 16/73] 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" -- 2.30.2 From 75d1cd413d76d6bcd755d2caa402d58725819f4b Mon Sep 17 00:00:00 2001 From: Raphix Date: Sun, 19 Mar 2023 14:24:45 +0100 Subject: [PATCH 17/73] Fix Install Jenkins #2 --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index fe31178..921f3f9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,8 +13,8 @@ pipeline { stage('Deploy Neutral') { steps { echo "[Neutral-Deploy] - Deploy Stage" - sh "ssh raphix@raphix.fr sudo apt update" - sh "ssh raphix@raphix.fr sudo apt upgrade" + sh "ssh raphix@raphix.fr sudo apt update -y" + sh "ssh raphix@raphix.fr sudo apt upgrade -y" sh "ssh raphix@raphix.fr /home/gitlab-ci/neutral_deploy.sh" } } -- 2.30.2 From 1060ee76e5fd0306585eafd2df999d823ba2fb9f Mon Sep 17 00:00:00 2001 From: Raphix Date: Sun, 19 Mar 2023 14:26:21 +0100 Subject: [PATCH 18/73] Fix Install Jenkins #2 --- script/neutral_deploy.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/script/neutral_deploy.sh b/script/neutral_deploy.sh index 85d2acf..fd6662c 100644 --- a/script/neutral_deploy.sh +++ b/script/neutral_deploy.sh @@ -1,7 +1,8 @@ echo "[Neutral-Deploy] - Stage - Déploiement - START " echo "[Neutral-Deploy] - Arrêt de Neutral : Processing" +sudo su gitlab-ci pm2 stop Neutral -pm2 delete neutral +pm2 delete Neutral echo "[Neutral-Deploy] - Arrêt de Neutral : Success" echo "[Neutral-Deploy] - Supression de Neutral : Processing" rm -rf ./neutral -- 2.30.2 From 79257f42d12dcf15edb746ebb5eae7c0dccb414b Mon Sep 17 00:00:00 2001 From: Raphix Date: Sun, 19 Mar 2023 14:28:50 +0100 Subject: [PATCH 19/73] Fix Install Jenkins #3 --- script/neutral_deploy.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/script/neutral_deploy.sh b/script/neutral_deploy.sh index fd6662c..4c582a8 100644 --- a/script/neutral_deploy.sh +++ b/script/neutral_deploy.sh @@ -1,6 +1,7 @@ echo "[Neutral-Deploy] - Stage - Déploiement - START " echo "[Neutral-Deploy] - Arrêt de Neutral : Processing" sudo su gitlab-ci +cd /home/gitlab-ci pm2 stop Neutral pm2 delete Neutral echo "[Neutral-Deploy] - Arrêt de Neutral : Success" -- 2.30.2 From 7d2eed0e4b7ff8aa4a2cd5d16dcb64986ec6e6c0 Mon Sep 17 00:00:00 2001 From: Raphix Date: Sun, 19 Mar 2023 14:41:16 +0100 Subject: [PATCH 20/73] Fix Install Jenkins #4 --- Jenkinsfile | 2 +- script/neutral_deploy.sh | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 921f3f9..bc8a0d6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -15,7 +15,7 @@ pipeline { 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 /home/gitlab-ci/neutral_deploy.sh" + sh "ssh raphix@raphix.fr sudo -u 'gitlab-ci' /home/gitlab-ci/neutral_deploy.sh" } } } diff --git a/script/neutral_deploy.sh b/script/neutral_deploy.sh index 4c582a8..85e7611 100644 --- a/script/neutral_deploy.sh +++ b/script/neutral_deploy.sh @@ -1,6 +1,5 @@ echo "[Neutral-Deploy] - Stage - Déploiement - START " echo "[Neutral-Deploy] - Arrêt de Neutral : Processing" -sudo su gitlab-ci cd /home/gitlab-ci pm2 stop Neutral pm2 delete Neutral -- 2.30.2 From e8c5380bc91bf2f939768664a076d1774d0ed98b Mon Sep 17 00:00:00 2001 From: Raphix Date: Sun, 19 Mar 2023 14:44:21 +0100 Subject: [PATCH 21/73] Fix Install Jenkins #4 --- script/neutral_deploy.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/script/neutral_deploy.sh b/script/neutral_deploy.sh index 85e7611..9a37430 100644 --- a/script/neutral_deploy.sh +++ b/script/neutral_deploy.sh @@ -1,6 +1,7 @@ echo "[Neutral-Deploy] - Stage - Déploiement - START " echo "[Neutral-Deploy] - Arrêt de Neutral : Processing" cd /home/gitlab-ci +pwd pm2 stop Neutral pm2 delete Neutral echo "[Neutral-Deploy] - Arrêt de Neutral : Success" @@ -8,14 +9,17 @@ 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 config --global user.name "raphix" 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 +cd /home/gitlab-ci/neutral +pwd npm install echo "[Neutral-Deploy] - Installation des dépendances : Success" echo "[Neutral-Deploy] - Démarrage de Neutral : Processing" -cd .. +cd /home/gitlab-ci +pwd pm2 start neutral.config.js echo "[Neutral-Deploy] - Démarrage de Neutral : Success" echo "[Neutral-Deploy] - Stage - Déploiement - END" -- 2.30.2 From fd1270857d7dbda55cd068abdb8d7b162b982500 Mon Sep 17 00:00:00 2001 From: Raphix Date: Sun, 19 Mar 2023 14:46:50 +0100 Subject: [PATCH 22/73] Fix Install Jenkins #5 --- script/neutral_deploy.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/script/neutral_deploy.sh b/script/neutral_deploy.sh index 9a37430..ec63827 100644 --- a/script/neutral_deploy.sh +++ b/script/neutral_deploy.sh @@ -9,7 +9,6 @@ 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 config --global user.name "raphix" git clone https://git.raphix.fr/infrastructure/neutral.git echo "[Neutral-Deploy] - Installation de Neutral : Success" echo "[Neutral-Deploy] - Installation des dépendances : Processing" -- 2.30.2 From 6b8a1cb6b5c1263d27f0333719742a42aac00618 Mon Sep 17 00:00:00 2001 From: Raphix Date: Sun, 19 Mar 2023 15:48:14 +0100 Subject: [PATCH 23/73] Correct Fixes from files component + Jenkins First Ver --- Jenkinsfile | 6 +++--- neutral-functions.js | 1 - public/templates/files.html | 7 ++++++- script/neutral_deploy.sh | 3 --- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index bc8a0d6..8826449 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,7 +2,7 @@ pipeline { agent any stages { - stage('Test Neutral') { + stage('[Neutral] - Test') { steps { echo "[Neutral-Deploy] - Test Stage" // sh "git clone git clone https://git.raphix.fr/infrastructure/neutral.git neutral" @@ -10,12 +10,12 @@ pipeline { } } - stage('Deploy Neutral') { + stage('[Neutral] - Deploy') { steps { 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 -u 'gitlab-ci' /home/gitlab-ci/neutral_deploy.sh" + sh "ssh raphix@raphix.fr sudo -S -u gitlab-ci /home/gitlab-ci/neutral_deploy.sh" } } } diff --git a/neutral-functions.js b/neutral-functions.js index 1572486..dbe57bd 100644 --- a/neutral-functions.js +++ b/neutral-functions.js @@ -3,7 +3,6 @@ var uuid = require('uuid') var path = require("path") var CryptoJS = require("crypto-js") var Jimp = require("jimp") -const { compileString } = require("sass") module.exports.checkUser = () => { diff --git a/public/templates/files.html b/public/templates/files.html index 36a8849..33753b6 100644 --- a/public/templates/files.html +++ b/public/templates/files.html @@ -28,7 +28,7 @@ const currentDir = document.getElementById("fi_current_directory") const fileExplorer = document.getElementById("fileExplorer") - const fileExplorerError = fileExplorer.outerHTML + const fileExplorerError = '

Revenir au dossier parent

' + fileExplorer.outerHTML getDirectory(currentDir.value) @@ -65,6 +65,7 @@ if(response.result == "failed") { + fileExplorerList.push('

Revenir au dossier parent

') content.innerHTML = '

Erreur de chargement des données - Erreur : ' + response.content + '

' console.log("FAILED") @@ -255,6 +256,10 @@ currentDir.value = cdSplit.join("/") + if(currentDir.value == "") { + currentDir.value = "/" + } + getDirectory(currentDir.value) diff --git a/script/neutral_deploy.sh b/script/neutral_deploy.sh index ec63827..9b3d925 100644 --- a/script/neutral_deploy.sh +++ b/script/neutral_deploy.sh @@ -1,7 +1,6 @@ echo "[Neutral-Deploy] - Stage - Déploiement - START " echo "[Neutral-Deploy] - Arrêt de Neutral : Processing" cd /home/gitlab-ci -pwd pm2 stop Neutral pm2 delete Neutral echo "[Neutral-Deploy] - Arrêt de Neutral : Success" @@ -13,12 +12,10 @@ 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 /home/gitlab-ci/neutral -pwd npm install echo "[Neutral-Deploy] - Installation des dépendances : Success" echo "[Neutral-Deploy] - Démarrage de Neutral : Processing" cd /home/gitlab-ci -pwd pm2 start neutral.config.js echo "[Neutral-Deploy] - Démarrage de Neutral : Success" echo "[Neutral-Deploy] - Stage - Déploiement - END" -- 2.30.2 From 4b85f34e943a581bbcd90b0a79d65e38f9ab7e00 Mon Sep 17 00:00:00 2001 From: Raphix Date: Sun, 19 Mar 2023 17:41:16 +0100 Subject: [PATCH 24/73] Test Neutral Pipeline --- Jenkinsfile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8826449..0d1650e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,9 +5,12 @@ pipeline { stage('[Neutral] - Test') { steps { echo "[Neutral-Deploy] - Test Stage" - // sh "git clone git clone https://git.raphix.fr/infrastructure/neutral.git neutral" - - + sh "rm -rf neutral" + sh "git clone git clone https://git.raphix.fr/infrastructure/neutral.git" + sh "cd neutral" + sh "npm i" + sh "PORT=3100 node bin/www" + } } stage('[Neutral] - Deploy') { -- 2.30.2 From 41fa6b0f2d5cc54f78d377a431ea85a5cf2fe43f Mon Sep 17 00:00:00 2001 From: Raphix Date: Sun, 19 Mar 2023 17:41:49 +0100 Subject: [PATCH 25/73] Test Neutral Pipeline #2 --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0d1650e..86c18f5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,7 +6,7 @@ pipeline { steps { echo "[Neutral-Deploy] - Test Stage" sh "rm -rf neutral" - sh "git clone git clone https://git.raphix.fr/infrastructure/neutral.git" + sh "git clone https://git.raphix.fr/infrastructure/neutral.git" sh "cd neutral" sh "npm i" sh "PORT=3100 node bin/www" -- 2.30.2 From 4bf0b260e375afbc9320e1124068052aa921a376 Mon Sep 17 00:00:00 2001 From: Raphix Date: Sun, 19 Mar 2023 17:45:55 +0100 Subject: [PATCH 26/73] Test Neutral Pipeline #3 --- Jenkinsfile | 2 +- app.js | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 86c18f5..e6d092a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,7 +9,7 @@ pipeline { sh "git clone https://git.raphix.fr/infrastructure/neutral.git" sh "cd neutral" sh "npm i" - sh "PORT=3100 node bin/www" + sh "ENV='TEST' node bin/www" } } diff --git a/app.js b/app.js index fc6ba27..81fa8a7 100644 --- a/app.js +++ b/app.js @@ -68,5 +68,13 @@ app.use(function(err, req, res, next) { ntr.checkUser() +if ("ENV" in process.env) { + if(process.env.ENV == "TEST") { + process.exit(1) + + } + +} + module.exports = app; -- 2.30.2 From 42f43129dbec11c5196a8d5aa46f22de07aaee19 Mon Sep 17 00:00:00 2001 From: Raphix Date: Sun, 19 Mar 2023 17:46:34 +0100 Subject: [PATCH 27/73] Test Neutral Pipeline #2 --- app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.js b/app.js index 81fa8a7..10fe7a4 100644 --- a/app.js +++ b/app.js @@ -70,7 +70,7 @@ ntr.checkUser() if ("ENV" in process.env) { if(process.env.ENV == "TEST") { - process.exit(1) + process.exit(0) } -- 2.30.2 From b2e1a45f414f63667d2e51ae6cab9fd5e308f48a Mon Sep 17 00:00:00 2001 From: Raphix Date: Sun, 19 Mar 2023 17:55:09 +0100 Subject: [PATCH 28/73] Test Neutral Pipeline #3 --- Jenkinsfile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index e6d092a..788725c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,11 +10,17 @@ pipeline { sh "cd neutral" sh "npm i" sh "ENV='TEST' node bin/www" - + } } stage('[Neutral] - Deploy') { steps { + def userInput = input( + 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'] + ]) echo "[Neutral-Deploy] - Deploy Stage" sh "ssh raphix@raphix.fr sudo apt update -y" sh "ssh raphix@raphix.fr sudo apt upgrade -y" -- 2.30.2 From 0c530812375cb239d644b35767e2a69f51f777c9 Mon Sep 17 00:00:00 2001 From: Raphix Date: Sun, 19 Mar 2023 17:55:55 +0100 Subject: [PATCH 29/73] Test Neutral Pipeline #4 --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 788725c..efb7012 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -15,7 +15,7 @@ pipeline { } stage('[Neutral] - Deploy') { steps { - def userInput = input( + userInput = input( id: 'userInput', message: 'Enter path of test reports:?', parameters: [ [$class: 'TextParameterDefinition', defaultValue: 'None', description: 'Path of config file', name: 'Config'], -- 2.30.2 From 0665130c3ceab54301309db3aaabd8299f95ba98 Mon Sep 17 00:00:00 2001 From: Raphix Date: Sun, 19 Mar 2023 17:56:35 +0100 Subject: [PATCH 30/73] Test Neutral Pipeline #5 --- Jenkinsfile | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index efb7012..ec38c05 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -15,12 +15,17 @@ pipeline { } stage('[Neutral] - Deploy') { steps { - userInput = input( - 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'] - ]) + script { + def userInput = input( + 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'] + ]) + echo ("IQA Sheet Path: "+userInput['Config']) + echo ("Test Info file path: "+userInput['Test']) + + } echo "[Neutral-Deploy] - Deploy Stage" sh "ssh raphix@raphix.fr sudo apt update -y" sh "ssh raphix@raphix.fr sudo apt upgrade -y" -- 2.30.2 From 4b200351e17e821dd524103cecdbaeafca18a00e Mon Sep 17 00:00:00 2001 From: Raphix Date: Sun, 19 Mar 2023 18:00:57 +0100 Subject: [PATCH 31/73] Test Neutral Pipeline #6 --- Jenkinsfile | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ec38c05..3a3d0d2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,20 +16,22 @@ pipeline { stage('[Neutral] - Deploy') { steps { script { - def userInput = input( - 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'] - ]) - echo ("IQA Sheet Path: "+userInput['Config']) - echo ("Test Info file path: "+userInput['Test']) + 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" + } } - 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" + } } } -- 2.30.2 From 45498540dde6b321f2b624c5f30daf08a8dea549 Mon Sep 17 00:00:00 2001 From: Raphix Date: Sun, 19 Mar 2023 18:02:41 +0100 Subject: [PATCH 32/73] Test Neutral Pipeline #7 --- Jenkinsfile | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3a3d0d2..6fd88b8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,19 +16,12 @@ pipeline { stage('[Neutral] - Deploy') { steps { script { - 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" - } + def doesJavaRock = input(message: 'Confirmation de Déploiement', ok: 'Lancer le déploiement') + 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" + } -- 2.30.2 From ee5746145735051621e986bae589cf75448c7b20 Mon Sep 17 00:00:00 2001 From: Raphix Date: Sun, 19 Mar 2023 18:03:57 +0100 Subject: [PATCH 33/73] Test Neutral Pipeline #8 --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6fd88b8..897112d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,7 +16,7 @@ pipeline { stage('[Neutral] - Deploy') { steps { script { - def doesJavaRock = input(message: 'Confirmation de Déploiement', ok: 'Lancer le déploiement') + 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" -- 2.30.2 From 4832e2c65b25c98e06a6ae67af10b3374e22da58 Mon Sep 17 00:00:00 2001 From: Raphix Date: Sun, 19 Mar 2023 18:18:36 +0100 Subject: [PATCH 34/73] Test Neutral Pipeline #8 --- Jenkinsfile | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 897112d..f5224e1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,6 +2,21 @@ pipeline { agent any stages { + stage('[Neutral] - Check Version') { + steps { + script { + def commit_name = sh "ssh raphix@raphix.fr sudo -S -u gitlab-ci git log -1 --pretty=%B" + if(commit_name.contains("@")) { + echo "[Neutral] - Deployement version reconnu" + + } else { + currentBuild.result = 'ABORTED' + return + + } + } + } + } stage('[Neutral] - Test') { steps { echo "[Neutral-Deploy] - Test Stage" @@ -13,7 +28,7 @@ pipeline { } } - stage('[Neutral] - Deploy') { + stage('[Neutral] - Déploiement') { steps { script { def doesJavaRock = input(message: 'Confirmation de Déploiement', ok: 'Déployer') -- 2.30.2 From 790f916372e627c12b169377128409a14502077d Mon Sep 17 00:00:00 2001 From: Raphix Date: Sun, 19 Mar 2023 18:23:52 +0100 Subject: [PATCH 35/73] Test Neutral Pipeline #9 --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index f5224e1..802e3c3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,7 +5,7 @@ pipeline { stage('[Neutral] - Check Version') { steps { script { - def commit_name = sh "ssh raphix@raphix.fr sudo -S -u gitlab-ci git log -1 --pretty=%B" + def commit_name = sh "ssh raphix@raphix.fr sudo -S -u gitlab-ci cd /neutral/ && git log -1 --pretty=%B" if(commit_name.contains("@")) { echo "[Neutral] - Deployement version reconnu" -- 2.30.2 From 85b2e36089aff356f827ce30ae04b7f7bf236434 Mon Sep 17 00:00:00 2001 From: Raphix Date: Sun, 19 Mar 2023 18:26:01 +0100 Subject: [PATCH 36/73] Test Neutral Pipeline #10 --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 802e3c3..0a03dfe 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,8 +5,8 @@ pipeline { stage('[Neutral] - Check Version') { steps { script { - def commit_name = sh "ssh raphix@raphix.fr sudo -S -u gitlab-ci cd /neutral/ && git log -1 --pretty=%B" - if(commit_name.contains("@")) { + def commit_name = env.TAG_NAME + if(commit_name) { echo "[Neutral] - Deployement version reconnu" } else { -- 2.30.2 From cf0bee146626ccf4decea0ae2dcb2fde61a43dfa Mon Sep 17 00:00:00 2001 From: Raphix Date: Sun, 19 Mar 2023 18:26:54 +0100 Subject: [PATCH 37/73] Test Neutral Pipeline #10 --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index 0a03dfe..c027160 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,6 +11,7 @@ pipeline { } else { currentBuild.result = 'ABORTED' + echo "[Neutral] - Deployement version non reconnu" return } -- 2.30.2 From cab43d1a152998eb00a1c0f2cab6a3e9853de7b0 Mon Sep 17 00:00:00 2001 From: Raphix Date: Sun, 19 Mar 2023 18:28:30 +0100 Subject: [PATCH 38/73] Test Neutral Pipeline #12 --- Jenkinsfile | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index c027160..8954080 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -20,6 +20,18 @@ pipeline { } stage('[Neutral] - Test') { steps { + script { + def commit_name = env.TAG_NAME + if(commit_name) { + echo "[Neutral] - Deployement version reconnu" + + } else { + currentBuild.result = 'ABORTED' + echo "[Neutral] - Deployement version non reconnu" + return + + } + } echo "[Neutral-Deploy] - Test Stage" sh "rm -rf neutral" sh "git clone https://git.raphix.fr/infrastructure/neutral.git" @@ -32,6 +44,18 @@ pipeline { stage('[Neutral] - Déploiement') { steps { script { + + def commit_name = env.TAG_NAME + if(commit_name) { + echo "[Neutral] - Deployement version reconnu" + + } else { + currentBuild.result = 'ABORTED' + echo "[Neutral] - Deployement version non reconnu" + return + + } + 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" -- 2.30.2 From a797e06e15c4fc7583e4a11b38449929b7c66bc4 Mon Sep 17 00:00:00 2001 From: Raphix Date: Sun, 19 Mar 2023 18:29:18 +0100 Subject: [PATCH 39/73] Test Neutral Pipeline #13 --- Jenkinsfile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8954080..ee51334 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -31,13 +31,15 @@ pipeline { return } + + 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" } - 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" + } } -- 2.30.2 From cb1e881450c125ff17473737a6b433a9546e830f Mon Sep 17 00:00:00 2001 From: Raphix Date: Sun, 19 Mar 2023 18:32:20 +0100 Subject: [PATCH 40/73] Test --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index ee51334..51186c0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -47,6 +47,7 @@ pipeline { steps { script { + def commit_name = env.TAG_NAME if(commit_name) { echo "[Neutral] - Deployement version reconnu" -- 2.30.2 From 6169272093be817a98f1f75c615cd1f3c51cb6f2 Mon Sep 17 00:00:00 2001 From: Raphix Date: Sun, 19 Mar 2023 18:37:40 +0100 Subject: [PATCH 41/73] TEST TAG --- Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 51186c0..fa81d0c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -22,6 +22,7 @@ pipeline { steps { script { def commit_name = env.TAG_NAME + echo env.TAG_NAME if(commit_name) { echo "[Neutral] - Deployement version reconnu" @@ -47,7 +48,7 @@ pipeline { steps { script { - + def commit_name = env.TAG_NAME if(commit_name) { echo "[Neutral] - Deployement version reconnu" -- 2.30.2 From 2d285f47fdb5c3645debea449ebdece3679ff442 Mon Sep 17 00:00:00 2001 From: Raphix Date: Sun, 19 Mar 2023 18:40:59 +0100 Subject: [PATCH 42/73] Jenkins Build Test Tag --- public/templates/settings.html | 1 + 1 file changed, 1 insertion(+) diff --git a/public/templates/settings.html b/public/templates/settings.html index fcd079c..1bff31a 100644 --- a/public/templates/settings.html +++ b/public/templates/settings.html @@ -182,6 +182,7 @@ user_finfo.innerHTML = "

Le nom complet ne doit pas dépasser 18 caractères

" + } else if(user_fullname.value != "") { -- 2.30.2 From 80a7ce8f196e017cd8f2e1c43e8c43176d615f12 Mon Sep 17 00:00:00 2001 From: Raphix Date: Sun, 19 Mar 2023 18:42:46 +0100 Subject: [PATCH 43/73] Final Jenkins Build --- Jenkinsfile | 43 +------------------------------------------ 1 file changed, 1 insertion(+), 42 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index fa81d0c..1d753ed 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,37 +2,9 @@ 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' - echo "[Neutral] - Deployement version non reconnu" - return - - } - } - } - } stage('[Neutral] - Test') { steps { script { - def commit_name = env.TAG_NAME - echo env.TAG_NAME - if(commit_name) { - echo "[Neutral] - Deployement version reconnu" - - } else { - currentBuild.result = 'ABORTED' - echo "[Neutral] - Deployement version non reconnu" - return - - } - echo "[Neutral-Deploy] - Test Stage" sh "rm -rf neutral" sh "git clone https://git.raphix.fr/infrastructure/neutral.git" @@ -41,25 +13,12 @@ pipeline { sh "ENV='TEST' node bin/www" } - } } stage('[Neutral] - Déploiement') { steps { script { - - - def commit_name = env.TAG_NAME - if(commit_name) { - echo "[Neutral] - Deployement version reconnu" - - } else { - currentBuild.result = 'ABORTED' - echo "[Neutral] - Deployement version non reconnu" - return - - } - + 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" -- 2.30.2 From 1aba9a71d7dbc33738eb340c4276e705b6ae10bf Mon Sep 17 00:00:00 2001 From: Raphix Date: Sun, 19 Mar 2023 22:13:04 +0100 Subject: [PATCH 44/73] Edit Default Value --- public/templates/files.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/templates/files.html b/public/templates/files.html index 33753b6..b0c4661 100644 --- a/public/templates/files.html +++ b/public/templates/files.html @@ -12,7 +12,7 @@
- +

Le répertoire n'existe pas ou est vide.

@@ -78,7 +78,7 @@ } else if(response.content == "ERROR_NOT_PERMITTED") { - fileExplorer.innerHTML = '

Vous n\'avez pas la permission de regarder ce dossier.

' + fileExplorer.innerHTML = '

Revenir au dossier parent

' +'

Vous n\'avez pas la permission de regarder ce dossier.

' console.log("DENY") } else { -- 2.30.2 From 428963b3524ca7da392acdc48dc76243ca44cb17 Mon Sep 17 00:00:00 2001 From: Raphix Date: Sun, 19 Mar 2023 22:14:48 +0100 Subject: [PATCH 45/73] Edit Default Value --- public/templates/files.html | 57 +++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/public/templates/files.html b/public/templates/files.html index b0c4661..61ec837 100644 --- a/public/templates/files.html +++ b/public/templates/files.html @@ -74,11 +74,68 @@ if(response.content == "ERROR_NOT_EXIST") { fileExplorer.innerHTML = fileExplorerError + const last_dir = document.getElementById("last_directory") + + last_dir.addEventListener("click", () => { + + var cdSplit = currentDir.value.split("/") + + if(cdSplit.slice(-1) == "") { + + cdSplit.pop() + cdSplit.pop() + + } else { + cdSplit.pop() + + + } + + + currentDir.value = cdSplit.join("/") + + if(currentDir.value == "") { + currentDir.value = "/" + } + + getDirectory(currentDir.value) + + + }) console.log("DENY") } else if(response.content == "ERROR_NOT_PERMITTED") { fileExplorer.innerHTML = '

Revenir au dossier parent

' +'

Vous n\'avez pas la permission de regarder ce dossier.

' + const last_dir = document.getElementById("last_directory") + + last_dir.addEventListener("click", () => { + + var cdSplit = currentDir.value.split("/") + + if(cdSplit.slice(-1) == "") { + + cdSplit.pop() + cdSplit.pop() + + } else { + cdSplit.pop() + + + } + + + currentDir.value = cdSplit.join("/") + + if(currentDir.value == "") { + currentDir.value = "/" + } + + getDirectory(currentDir.value) + + + }) + console.log("DENY") } else { -- 2.30.2 From e48e9ae2fc794d70c6454c2a662a07e0102c1e2f Mon Sep 17 00:00:00 2001 From: Raphix Date: Sun, 19 Mar 2023 22:46:13 +0100 Subject: [PATCH 46/73] Add Fixed Design Files Component --- package-lock.json | 4 +-- public/stylesheets/style.css | 29 +++++++++++++------ public/templates/files.html | 1 - .../0cee5da6-6812-49d8-97f5-2df5c1d78191.json | 6 ++-- views/index.ejs | 2 +- 5 files changed, 26 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index e59d2c2..27e5c1e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "neutral", - "version": "DEV_3.0", + "version": "DEV_5.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "neutral", - "version": "DEV_3.0", + "version": "DEV_5.0", "dependencies": { "@popperjs/core": "^2.11.6", "bootstrap": "^5.2.2", diff --git a/public/stylesheets/style.css b/public/stylesheets/style.css index c7a95c6..b42d335 100644 --- a/public/stylesheets/style.css +++ b/public/stylesheets/style.css @@ -153,10 +153,6 @@ body { } - - - - .viewbar { display: block !important; @@ -216,7 +212,7 @@ body { } .edropdown-content { - text-align: center; + display: none; background-color: rgb(80, 80, 80); position: absolute; @@ -289,10 +285,26 @@ body { .sidebar-content { - text-align: center; + height: 83%; - padding-top: 50%; - padding-bottom: 50%; + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; + + } + + .middle { + + display: flex; + justify-content: start; + gap: 1vw; + flex-direction: column; + + } + + .sidebar:hover .middle { + width: 100%; } @@ -418,7 +430,6 @@ body { } .edropdown-content { - text-align: center; display: none; background-color: rgb(80, 80, 80); position: absolute; diff --git a/public/templates/files.html b/public/templates/files.html index 61ec837..103671b 100644 --- a/public/templates/files.html +++ b/public/templates/files.html @@ -485,7 +485,6 @@ background-color: rgb(32, 32, 32) ; border-radius: 1vw; padding: 1vw; - text-align: center; overflow-x: hidden; overflow-y: auto; diff --git a/users/0cee5da6-6812-49d8-97f5-2df5c1d78191.json b/users/0cee5da6-6812-49d8-97f5-2df5c1d78191.json index ae62bea..9f0686d 100644 --- a/users/0cee5da6-6812-49d8-97f5-2df5c1d78191.json +++ b/users/0cee5da6-6812-49d8-97f5-2df5c1d78191.json @@ -5,9 +5,9 @@ "fullname": "Raphael PICOT", "permissionLevel": 4, "token": { - "tokenID": "748eac04-7725-4da3-a5ce-e02655e9a320", + "tokenID": "571ecb2b-726f-442f-9ec7-bc19205847b7", "livableToken": true, - "createdAt": 1677602543822 + "createdAt": 1679260759114 }, - "lastconnexion": 1677602755015 + "lastconnexion": 1679262309689 } \ No newline at end of file diff --git a/views/index.ejs b/views/index.ejs index ef7ce91..5f4ed6c 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -8,7 +8,7 @@