-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
69 lines (65 loc) · 1.85 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
stages:
- build
- test
- deploy
build:
stage: build
image: maven:latest
script:
- echo "Building the pipeline"
- mvn clean package
artifacts:
paths:
- target
tags:
- ugrad
test:
stage: test
image: maven:latest
artifacts:
when: always
reports:
junit:
- target/easyHomesReports/TEST_*.xml
script:
- echo "Pipeline test started"
- mvn verify
tags:
- ugrad
deploy_develop:
stage: deploy
tags:
- ugrad
artifacts:
paths:
- target
script:
- echo "dbURL=$DATABASE_TEST_URL" > config.properties
- echo "dbUserName=$DATABASE_TEST_USERNAME" >> config.properties
- echo "dbPassword=$DATABASE_TEST_PASSWORD" >> config.properties
- echo "dbDriver=$DATABASE_DRIVER" >> config.properties
- echo "Deploying the develop pipeline"
- chmod og-rwx ${DEPLOY_SSH_KEY}
- zip -r ${CI_COMMIT_SHORT_SHA}.zip target
- scp -r -o StrictHostKeyChecking=no -i "${DEPLOY_SSH_KEY}" ${CI_COMMIT_SHORT_SHA}.zip "${DEPLOY_USER}@${DEPLOY_HOST}:${DEPLOY_DIR}/${CI_PROJECT_NAME}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}.zip"
# only:
# - develop
#
#deploy_release:
# stage: deploy
# tags:
# - ugrad
# artifacts:
# paths:
# - target
# script:
# - echo "dbURL=$DATABASE_PROD_URL" > config.properties
# - echo "dbUserName=$DATABASE_PROD_USERNAME" >> config.properties
# - echo "dbPassword=$DATABASE_PROD_PASSWORD" >> config.properties
# - echo "dbDriver=$DATABASE_DRIVER" >> config.properties
# - echo "Deploying the release pipeline"
# - chmod og-rwx ${DEPLOY_PROD_SSH_KEY}
# - zip -r ${CI_COMMIT_SHORT_SHA}.zip target
# - scp -r -o StrictHostKeyChecking=no -i "${DEPLOY_PROD_SSH_KEY}" ${CI_COMMIT_SHORT_SHA}.zip "${DEPLOY_PROD_USER}@${DEPLOY_HOST}:${DEPLOY_DIR}/${CI_PROJECT_NAME}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}.zip"
# only:
# - release