From 59b3f1b0a2e61afad1a0ca0f62b10ddde5b2db97 Mon Sep 17 00:00:00 2001
From: Eduard Frankford <e.frankford@student.uibk.ac.at>
Date: Wed, 6 Jul 2022 21:18:02 +0200
Subject: [PATCH] merge ready

---
 .gitlab-ci.yml | 57 +++++++++++++++++++++++++-------------------------
 package.json   |  4 ++--
 2 files changed, 30 insertions(+), 31 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index eaeec7fc8..fdbf811b9 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -12,7 +12,7 @@ stages:
   - build
   - test
   - release
-  # - deploy
+  - deploy
   - e2e
 
 before_script:
@@ -111,9 +111,9 @@ frontend-test:
 docker-build:
   stage: release
   cache: []
-  # only:
-  #   refs:
-  #     - development
+  only:
+    refs:
+      - development
   dependencies:
     - maven-test
     - frontend-test
@@ -131,24 +131,24 @@ docker-build:
     - ssh contDeploy@codeability-austria -p 1022 "cd gitsearch2/gitsearch && git pull && ./mvnw package -DskipTests jib:build -Djib.to.image=$IMAGE_TAG -Djib.to.auth.username=gitlab-ci-token  -Djib.to.auth.password=$CI_BUILD_TOKEN -Dmaven.repo.local=$MAVEN_USER_HOME"
   when: on_success
 
-# deploy:
-#   stage: deploy
-#   cache: []
-#   # only:
-#   #   refs:
-#   #     - development
-#   dependencies:
-#     - docker-build
-#   before_script:
-#     - mkdir -p ~/.ssh
-#     - echo "${SSH_BKY_DEPLOY}" > ~/.ssh/id_rsa
-#     - chmod 700 ~/.ssh/id_rsa
-#     - eval "$(ssh-agent -s)"
-#     - ssh-add ~/.ssh/id_rsa
-#     - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
-#   script:
-#     - ssh contDeploy@codeability-austria -p 1022 "cd gitsearch2/gitsearch && git pull && cd src/main/docker/ && docker pull sharing-codeability.uibk.ac.at:5051/sharing/codeability-sharing-platform/gitsearch && GIT_BRANCH=`git rev-parse --abbrev-ref HEAD` COMMIT_ID=`git rev-parse HEAD` SPRING_PROFILES_ACTIVE=staging,swagger docker-compose -f gitsearch.yml up  -d --no-deps --build --force-recreate gitsearch-app && exit"
-#   when: on_success
+deploy:
+  stage: deploy
+  cache: []
+  only:
+    refs:
+      - development
+  dependencies:
+    - docker-build
+  before_script:
+    - mkdir -p ~/.ssh
+    - echo "${SSH_BKY_DEPLOY}" > ~/.ssh/id_rsa
+    - chmod 700 ~/.ssh/id_rsa
+    - eval "$(ssh-agent -s)"
+    - ssh-add ~/.ssh/id_rsa
+    - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
+  script:
+    - ssh contDeploy@codeability-austria -p 1022 "cd gitsearch2/gitsearch && git pull && cd src/main/docker/ && docker pull sharing-codeability.uibk.ac.at:5051/sharing/codeability-sharing-platform/gitsearch && GIT_BRANCH=`git rev-parse --abbrev-ref HEAD` COMMIT_ID=`git rev-parse HEAD` SPRING_PROFILES_ACTIVE=staging,swagger docker-compose -f gitsearch.yml up  -d --no-deps --build --force-recreate gitsearch-app && exit"
+  when: on_success
 
 e2e-test:
   stage: e2e
@@ -157,13 +157,13 @@ e2e-test:
     <<: *global_cache
     # override the policy
     policy: pull
-  # only:
-  #   refs:
-  #     - development
+  only:
+    refs:
+      - development
   services:
     - selenium/standalone-chrome
-  # dependencies:
-  #   - deploy
+  dependencies:
+    - deploy
   before_script:
     - mkdir -p ~/.ssh
     - echo "${SSH_BKY_DEPLOY}" > ~/.ssh/id_rsa
@@ -172,12 +172,11 @@ e2e-test:
     - ssh-add ~/.ssh/id_rsa
     - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
   script:
-    - ssh contDeploy@codeability-austria -p 1022 "cd gitsearch2/gitsearch && git pull && npm install && npm run e2e:ci --host=selenium__standalone-chrome && exit"
+    - ssh contDeploy@codeability-austria -p 1022 "cd gitsearch2/gitsearch && git pull && npm install && export E2E_PASSWORD=$E2E_PASSWORD && npm run e2e:ci --host=selenium__standalone-chrome && exit"
     # - npm install
     # - wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
     # - dpkg -i google-chrome*.deb
     # - export JHI_E2E_HEADLESS=true
-    # - export E2E_PASSWORD=$E2E_PASSWORD
     # - npm run e2e:ci --host=selenium__standalone-chrome
   when: on_success
 
diff --git a/package.json b/package.json
index 6ec311279..368aa951b 100644
--- a/package.json
+++ b/package.json
@@ -38,8 +38,8 @@
     "docker:others:down": "npm run docker:elasticsearch:down",
     "predocker:others:up": "",
     "docker:others:up": "npm run docker:elasticsearch:up",
-    "e2e": "export E2E_PASSWORD=aUCDc2gJ6Qq3cAgf8jUfwV69gnd5Sq; protractor --baseUrl='https://dev-exchange.codeability-austria.uibk.ac.at/'  src/test/javascript/protractor.conf.js --disableChecks",
-    "e2e:ci": "export JHI_E2E_HEADLESS=true; export E2E_PASSWORD=aUCDc2gJ6Qq3cAgf8jUfwV69gnd5Sq ; protractor --baseUrl='https://dev-exchange.codeability-austria.uibk.ac.at/' src/test/javascript/protractor.conf.js --disableChecks",
+    "e2e": "export E2E_PASSWORD=admin; protractor --baseUrl='http://localhost:8080/'  src/test/javascript/protractor.conf.js --disableChecks",
+    "e2e:ci": "export JHI_E2E_HEADLESS=true; export E2E_PASSWORD=$E2E_PASSWORD ; protractor --baseUrl='https://dev-exchange.codeability-austria.uibk.ac.at/' src/test/javascript/protractor.conf.js --disableChecks",
     "e2e:update-webdriver": "webdriver-manager update --gecko false",
     "postinstall": "npm run e2e:update-webdriver",
     "java:docker": "./mvnw -ntp verify -DskipTests -Pprod jib:dockerBuild",
-- 
GitLab