This is the codeAbility Sharing Platform! Learn more about the
codeAbility Sharing Platform
.
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
codeAbility Sharing Platform
Manage
Activity
Members
Labels
Plan
Issues
43
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
development
sharing
codeAbility Sharing Platform
Commits
892a246c
Commit
892a246c
authored
2 years ago
by
Eduard Frankford
Browse files
Options
Downloads
Patches
Plain Diff
e2e test
parent
46044a4a
2 merge requests
!188
Merging Peer Reviewing et. al to Master
,
!164
211 peer reviewing functionality
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+102
-103
102 additions, 103 deletions
.gitlab-ci.yml
with
102 additions
and
103 deletions
.gitlab-ci.yml
+
102
−
103
View file @
892a246c
...
...
@@ -7,7 +7,7 @@ cache:
stages
:
# - lint
# - build
-
test
2
-
test
# - analyze
# - package
# - release
...
...
@@ -17,70 +17,70 @@ before_script:
-
export NG_CLI_ANALYTICS="false"
-
export MAVEN_USER_HOME=`pwd`/.maven
pmdCheckstylePrettierLint
:
stage
:
lint
cache
:
{}
when
:
always
before_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"'
script
:
-
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"
-
npm install
-
npm run prettier:check
-
echo "Running eslint"
-
'
npm
run
lint
|
tee
lint.log'
-
"
!
grep
-qE
'✖
[0-9]+
problem'
lint.log
||
SUCCESS=false"
-
$SUCCESS
needs
:
[]
artifacts
:
when
:
on_failure
expire_in
:
30 days
paths
:
-
pmd.log
#
pmdCheckstylePrettierLint:
#
stage: lint
#
cache: {}
#
when: always
#
before_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"'
#
script:
#
- 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"
#
- npm install
#
- npm run prettier:check
#
- echo "Running eslint"
#
- 'npm run lint | tee lint.log'
#
- "! grep -qE '✖ [0-9]+ problem' lint.log || SUCCESS=false"
#
- $SUCCESS
#
needs: []
#
artifacts:
#
when: on_failure
#
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
:
10 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: 10 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
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-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
#
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: []
frontend-test
:
stage
:
test
...
...
@@ -99,20 +99,19 @@ frontend-test:
needs
:
[]
e2e-test
:
stage
:
test
2
stage
:
test
cache
:
{}
script
:
-
npm run e2e
sonar-analyze
:
stage
:
analyze
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
# 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
# maven-package:
# stage: package
...
...
@@ -120,33 +119,33 @@ sonar-analyze:
# - ./mvnw -ntp verify -Pprod -DskipTests -Dmaven.repo.local=$MAVEN_USER_HOME
# 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
variables
:
# only:
# refs:
# - development
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
#
docker-push:
#
stage: release
#
variables:
#
# only:
#
# refs:
#
# - development
#
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
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
:
-
whoami
-
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
#
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:
#
- whoami
#
- 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
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment