-
Notifications
You must be signed in to change notification settings - Fork 8
/
.gitlab-ci.yml
37 lines (29 loc) · 1.09 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
# This template does the following:
#
# 1. Builds the project while resolving the dependencies from Artifactory
# 2. Uploads the build artifact to Artifactory
# 3. Publishes the build-info to Artifactory
#
# Requirements:
# Configure the following variables with the names of Go repositories in JFrog Artifactory:
# 'ARTIFACTORY_VIRTUAL_REPO', and 'ARTIFACTORY_LOCAL_REPO'.
default:
image: golang
include:
- remote: "https://releases.jfrog.io/artifactory/jfrog-cli/gitlab/v2/.setup-jfrog-unix.yml"
# For Windows agents:
#- remote: "https://releases.jfrog.io/artifactory/jfrog-cli/gitlab/v2/.setup-jfrog-windows.yml"
jfrog-go-build:
script:
- !reference [.setup_jfrog, script]
# Configure JFrog Artifactory repositories
- jf go-config --repo-resolve $ARTIFACTORY_VIRTUAL_REPO --repo-deploy $ARTIFACTORY_LOCAL_REPO
# Build Go project
- jf go build
# Create and upload the Go package to JFrog Artifactory
- jf go-publish v1.0.0
# Publish build-info to JFrog Artifactory
- jf rt build-publish
after_script:
# Cleanup
- !reference [.cleanup_jfrog, script]