This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects
Commit ef5c7cb1 authored by Eduard Frankford's avatar Eduard Frankford
Browse files

testing

parent b3e0457e
Branches
2 merge requests!188Merging Peer Reviewing et. al to Master,!164211 peer reviewing functionality
......@@ -9,14 +9,13 @@ cache: &global_cache
stages:
- lint
# - build
# - test
# - analyze
# - release
# - deploy
- build
- test
- analyze
- release
- deploy
before_script:
- echo $PATH
- export NG_CLI_ANALYTICS="false"
- export MAVEN_USER_HOME=`pwd`/.maven
- npm ci --cache .npm --prefer-offline
......@@ -30,15 +29,13 @@ pmdCheckstylePrettierLint:
policy: pull
when: always
script:
# - 'export VERSION="6.40.0"'
# - 'wget "https://github.com/pmd/pmd/releases/download/pmd_releases%2F$VERSION/pmd-bin-$VERSION.zip"'
# - 'jar -xf "pmd-bin-$VERSION.zip"'
# - 'chmod u+x "pmd-bin-$VERSION/bin/run.sh"'
# - SUCCESS=true
# - echo "Running PMD"
# - '"pmd-bin-$VERSION/bin/run.sh" pmd -d src/main/java -f textcolor -R pmd_rules.xml 2>&1 | tee pmd.log || SUCCESS=false'
- pmd pmd -d src/main/java -f textcolor -R pmd_rules.xml 2>&1 | tee pmd.log || SUCCESS=false
- 'export VERSION="6.40.0"'
- 'wget "https://github.com/pmd/pmd/releases/download/pmd_releases%2F$VERSION/pmd-bin-$VERSION.zip"'
- 'jar -xf "pmd-bin-$VERSION.zip"'
- 'chmod u+x "pmd-bin-$VERSION/bin/run.sh"'
- SUCCESS=true
- echo "Running PMD"
- '"pmd-bin-$VERSION/bin/run.sh" pmd -d src/main/java -f textcolor -R pmd_rules.xml 2>&1 | tee pmd.log || SUCCESS=false'
- echo "Running checkstyle"
- ./mvnw -ntp checkstyle:check -Dmaven.repo.local=$MAVEN_USER_HOME || SUCCESS=false
- echo "Running prettier"
......@@ -54,133 +51,134 @@ pmdCheckstylePrettierLint:
expire_in: 30 days
paths:
- pmd.log
# maven-compile:
# stage: build
# script:
# - ./mvnw -ntp compile -P-webapp -Dmaven.repo.local=$MAVEN_USER_HOME
# artifacts:
# paths:
# - target/classes/
# - target/generated-sources/
# expire_in: 15 days
# needs: []
# maven-test:
# # DinD service is required for Testcontainers
# services:
# - docker:20-dind
# variables:
# # Instruct Testcontainers to use the daemon of DinD.
# DOCKER_HOST: 'tcp://docker:2375'
# DOCKER_TLS_CERTDIR: ''
# stage: test
# cache:
# # inherit all global cache settings
# <<: *global_cache
# # override the policy
# policy: pull
# script:
# - ./mvnw -ntp verify -P-webapp -Dmaven.repo.local=$MAVEN_USER_HOME -Dspring.profiles.active=testcontainers
# allow_failure: true
# artifacts:
# reports:
# junit:
# - target/surefire-reports/TEST-*.xml
# - target/failsafe-reports/TEST-*.xml
# paths:
# - target/surefire-reports
# - target/failsafe-reports
# - target/site
# when: always
# expire_in: 15 days
# needs: []
maven-compile:
stage: build
script:
- ./mvnw -ntp compile -P-webapp -Dmaven.repo.local=$MAVEN_USER_HOME
artifacts:
paths:
- target/classes/
- target/generated-sources/
expire_in: 15 days
needs: []
# frontend-test:
# stage: test
# cache:
# # inherit all global cache settings
# <<: *global_cache
# # override the policy
# policy: pull
# script:
# - npm test
# artifacts:
# reports:
# junit: target/test-results/TESTS-results-jest.xml
# paths:
# - target/test-results
# - target/jacoco
# when: always
# expire_in: 15 days
# needs: []
maven-test:
# DinD service is required for Testcontainers
services:
- docker:20-dind
variables:
# Instruct Testcontainers to use the daemon of DinD.
DOCKER_HOST: 'tcp://docker:2375'
DOCKER_TLS_CERTDIR: ''
stage: test
cache:
# inherit all global cache settings
<<: *global_cache
# override the policy
policy: pull
script:
- ./mvnw -ntp verify -P-webapp -Dmaven.repo.local=$MAVEN_USER_HOME -Dspring.profiles.active=testcontainers
allow_failure: true
artifacts:
reports:
junit:
- target/surefire-reports/TEST-*.xml
- target/failsafe-reports/TEST-*.xml
paths:
- target/surefire-reports
- target/failsafe-reports
- target/site
when: always
expire_in: 15 days
needs: []
# e2e-test:
# stage: test
# cache:
# # inherit all global cache settings
# <<: *global_cache
# # override the policy
# policy: pull
# only:
# refs:
# - development
# services:
# - selenium/standalone-chrome
# dependencies:
# - frontend-test
# script:
# - 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 --host=selenium__standalone-chrome
frontend-test:
stage: test
cache:
# inherit all global cache settings
<<: *global_cache
# override the policy
policy: pull
script:
- npm test
artifacts:
reports:
junit: target/test-results/TESTS-results-jest.xml
paths:
- target/test-results
- target/jacoco
when: always
expire_in: 15 days
needs: []
e2e-test:
stage: test
cache:
# inherit all global cache settings
<<: *global_cache
# override the policy
policy: pull
only:
refs:
- development
services:
- selenium/standalone-chrome
dependencies:
- frontend-test
script:
- 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 --host=selenium__standalone-chrome
# sonar-analyze:
# stage: analyze
# cache:
# # inherit all global cache settings
# <<: *global_cache
# # override the policy
# policy: pull
# dependencies:
# - maven-test
# - frontend-test
# script:
# - ./mvnw -ntp org.jacoco:jacoco-maven-plugin:prepare-agent initialize sonar:sonar -Dsonar.organization=codeAbility -Dsonar.host.url=https://qe-sonarqube.uibk.ac.at/ -Dsonar.login=${SONAR_TOKEN_QE} -Dmaven.repo.local=$MAVEN_USER_HOME
# # - ./mvnw -ntp org.jacoco:jacoco-maven-plugin:prepare-agent initialize sonar:sonar -Dsonar.organization=codeAbility -Dsonar.host.url=https://server.arctis.at/sonar/ -Dsonar.login=${SONAR_TOKEN} -Dmaven.repo.local=$MAVEN_USER_HOME
# allow_failure: true
sonar-analyze:
stage: analyze
cache:
# inherit all global cache settings
<<: *global_cache
# override the policy
policy: pull
dependencies:
- maven-test
- frontend-test
script:
- ./mvnw -ntp org.jacoco:jacoco-maven-plugin:prepare-agent initialize sonar:sonar -Dsonar.organization=codeAbility -Dsonar.host.url=https://qe-sonarqube.uibk.ac.at/ -Dsonar.login=${SONAR_TOKEN_QE} -Dmaven.repo.local=$MAVEN_USER_HOME
# - ./mvnw -ntp org.jacoco:jacoco-maven-plugin:prepare-agent initialize sonar:sonar -Dsonar.organization=codeAbility -Dsonar.host.url=https://server.arctis.at/sonar/ -Dsonar.login=${SONAR_TOKEN} -Dmaven.repo.local=$MAVEN_USER_HOME
allow_failure: true
# # Uncomment the following line to use gitlabs container registry. You need to adapt the REGISTRY_URL in case you are not using gitlab.com
# docker-push:
# stage: release
# only:
# refs:
# - development
# variables:
# REGISTRY_URL: sharing-codeability.uibk.ac.at:5051
# IMAGE_TAG: sharing-codeability.uibk.ac.at:5051/sharing/codeability-sharing-platform
# script:
# - ./mvnw package -Pprod verify -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: always
# Uncomment the following line to use gitlabs container registry. You need to adapt the REGISTRY_URL in case you are not using gitlab.com
docker-push:
stage: release
only:
refs:
- development
variables:
REGISTRY_URL: sharing-codeability.uibk.ac.at:5051
IMAGE_TAG: sharing-codeability.uibk.ac.at:5051/sharing/codeability-sharing-platform
script:
- ./mvnw package -Pprod verify -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: always
# deploy:
# stage: deploy
# only:
# refs:
# - development
# dependencies:
# - 'docker-push'
# image: ubuntu:20.04
# before_script:
# - apt-get update -qy
# - apt-get install -y rsync openssh-client
# - 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 /home/michael/gitsearch && git pull && cd src/main/docker/ && docker pull sharing-codeability.uibk.ac.at:5051/sharing/codeability-sharing-platform && 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: always
deploy:
stage: deploy
only:
refs:
- development
dependencies:
- 'docker-push'
image: ubuntu:20.04
before_script:
- apt-get update -qy
- apt-get install -y rsync openssh-client
- 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 /home/michael/gitsearch && git pull && cd src/main/docker/ && docker pull sharing-codeability.uibk.ac.at:5051/sharing/codeability-sharing-platform && 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: always
......@@ -4,6 +4,4 @@ USER root
ARG VERSION=6.40.0
RUN apt update && apt install -y default-jre xvfb zip wget ca-certificates libnss3-dev libasound2 libxss1 libappindicator3-1 libindicator7 gconf-service libgconf-2-4 libpango1.0-0 xdg-utils fonts-liberation libgbm1 bash
RUN export VERSION=6.40.0 && wget https://github.com/pmd/pmd/releases/download/pmd_releases%2F$VERSION/pmd-bin-$VERSION.zip && jar -xf pmd-bin-$VERSION.zip && chmod u+x pmd-bin-$VERSION/bin/run.sh && ln -s pmd-bin-$VERSION/bin/run.sh /usr/bin/pmd
\ No newline at end of file
RUN apt update && apt install -y default-jre xvfb zip wget ca-certificates libnss3-dev libasound2 libxss1 libappindicator3-1 libindicator7 gconf-service libgconf-2-4 libpango1.0-0 xdg-utils fonts-liberation libgbm1 bash
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment