-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgitlab-ci.yml
28 lines (24 loc) · 1.19 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
image: gradle:latest
before_script:
# this variable is used to tell gradle from which repository to download the build-info-extractor.jar, should be server-id/repo-name
- JFROG_CLI_EXTRACTORS_REMOTE=$ARTIFACTORY_SERVER_ID/$ARTIFCATORY_REPO
# Download JFrog CLI
- curl -fL https://install-cli.jfrog.io | sh
# configure artifactory server
- jf config add $ARTIFACTORY_SERVER_ID--url=$ARTIFACTORY_URL --user=$ARTIFACTORY_USER --password=$ARTIFACTORY_PASS
- jf config show
# configure gradle, set upload and download repos
- jf gradlec --repo-resolve $ARTIFCATORY_REPO --repo-deploy $ARTIFCATORY_REPO
gitlab-ci-gradle-build: #This job name will be used as the build info repository name in artifactory
stage: build
script:
# upload the built artifact to artifactory
- jf gradle clean artifactoryPublish -b build.gradle --build-name=$CI_JOB_NAME --build-number=$CI_JOB_ID
# Collect environment variables for the build
- jf rt bce $CI_JOB_NAME $CI_JOB_ID
# Collect VCS details from git and add them to the build
- jf rt bag $CI_JOB_NAME $CI_JOB_ID
# Publish build info
- jf rt bp $CI_JOB_NAME $CI_JOB_ID
# Scan with xray
- jf bs $CI_JOB_NAME $CI_JOB_ID