This repository has been archived by the owner on Oct 3, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
.gitlab-ci.yml
37 lines (33 loc) · 1.72 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: "true"
ARTIFACTORY_REPOSITORY: "network"
ARTIFACTORY_ARTIFACT_DOMAIN: "net"
ARTIFACTORY_ARTIFACT_GROUP: "samagames"
ARTIFACTORY_ARTIFACT_NAME: "SurvivalAPI"
ARTIFACTORY_ARTIFACT_VERSION: "2.0.0"
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 [email protected]:/var/www/static/templates/dependencies/; else scp -prq target/*.jar [email protected]:/var/www/static/templates/dependencies/; fi; fi'