This repository has been archived by the owner on Nov 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
37 lines (33 loc) · 1.69 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
stages:
- build
- deploy
variables:
HAS_TO_BE_PUT_IN_THE_DATA: "true"
HAS_TO_BE_PUBLISHED_INTO_ARTIFACTORY: "false"
ARTIFACTORY_REPOSITORY: ""
ARTIFACTORY_ARTIFACT_DOMAIN: ""
ARTIFACTORY_ARTIFACT_GROUP: ""
ARTIFACTORY_ARTIFACT_NAME: ""
ARTIFACTORY_ARTIFACT_VERSION: ""
build:
stage: build
script:
- 'if [ -f "build.gradle" ]; then gradle build install --refresh-dependencies; else mvn install; fi'
artifacts:
paths:
- build/libs/*.jar
- target/*.jar
expire_in: 1 day
deploy-developement:
stage: deploy
only:
- develop
script:
- 'if [ "$HAS_TO_BE_PUT_IN_THE_DATA" == "true" ]; then if [ -f "build.gradle" ]; then cp -f build/libs/*.jar /home/www/static/templates/dependencies/; else cp -f target/*.jar /home/www/static/templates/dependencies/; fi; fi'
- 'if [ "$HAS_TO_BE_PUBLISHED_INTO_ARTIFACTORY" == "true" ]; then if [ -f "build.gradle" ]; then artifactory-publish build/libs/${ARTIFACTORY_ARTIFACT_NAME}-${ARTIFACTORY_ARTIFACT_VERSION}.jar $ARTIFACTORY_REPOSITORY $ARTIFACTORY_ARTIFACT_DOMAIN/$ARTIFACTORY_ARTIFACT_GROUP $ARTIFACTORY_ARTIFACT_NAME $ARTIFACTORY_ARTIFACT_VERSION; else artifactory-publish target/${ARTIFACTORY_ARTIFACT_NAME}-${ARTIFACTORY_ARTIFACT_VERSION}.jar $ARTIFACTORY_REPOSITORY $ARTIFACTORY_ARTIFACT_DOMAIN/$ARTIFACTORY_ARTIFACT_GROUP $ARTIFACTORY_ARTIFACT_NAME $ARTIFACTORY_ARTIFACT_VERSION; fi ; fi'
deploy-production:
stage: deploy
only:
- master
script:
- 'if [ "$HAS_TO_BE_PUT_IN_THE_DATA" == "true" ]; then if [ -f "build.gradle" ]; then scp -prq build/libs/*.jar root@94.23.20.180:/var/www/static/templates/dependencies/; else scp -prq target/*.jar root@94.23.20.180:/var/www/static/templates/dependencies/; fi; fi'