forked from jfrog/jfrog-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pipelines.yml
182 lines (166 loc) · 7.13 KB
/
pipelines.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# Set common JFrog integration and GitHub input source
commonConfiguration: &COMMON_CONFIGURATION
integrations:
- name: jfrog
inputResources:
- name: jfrogCliGit
# Create artifactory access token and save it in './rtToken'
createRtAccessToken: &CREATE_RT_ACCESS_TOKEN ./build/build.sh && ./jfrog rt atc $int_jfrog_rt_user --url=$int_jfrog_rt_url --user=$int_jfrog_rt_user --password=$int_jfrog_rt_password --grant-admin --groups admin-group --expiry 1800 | jq '.access_token' -r > rtToken
# Update commit status in GitHub
updateCommitStatus: &UPDATE_COMMIT_STATUS
onStart:
- update_commit_status jfrogCliGit --context "$step_name"
onComplete:
- update_commit_status jfrogCliGit --context "$step_name"
resources:
- name: jfrogCliGit
type: GitRepo
configuration:
path: jfrog/jfrog-cli
gitProvider: github
buildOn:
pullRequestCreate: true
pipelines:
# Global configuration
- name: test_cli
configuration:
runtime:
type: image
image:
custom:
name: releases-docker.jfrog.io/jfrog-ecosystem-integration-env
tag: 1.1.0
environmentVariables:
readOnly:
#GOPROXY: https://gocenter.io
CI: "true"
steps:
- name: Artifactory
type: Bash
configuration:
<<: *COMMON_CONFIGURATION
execution:
<<: *UPDATE_COMMIT_STATUS
onExecute:
- cd $res_jfrogCliGit_resourcePath
- *CREATE_RT_ACCESS_TOKEN
- env -i PATH=$PATH M2_HOME=$M2_HOME HOME=$HOME `which go` test -v -timeout 0 -test.artifactory -rt.url=$int_jfrog_rt_url -rt.accessToken=$(< rtToken)
- name: Npm
type: Bash
configuration:
<<: *COMMON_CONFIGURATION
execution:
<<: *UPDATE_COMMIT_STATUS
onExecute:
- cd $res_jfrogCliGit_resourcePath
- npm --version
- *CREATE_RT_ACCESS_TOKEN
- env -i PATH=$PATH M2_HOME=$M2_HOME HOME=$HOME `which go` test -v -timeout 0 -test.npm -rt.url=$int_jfrog_rt_url -rt.accessToken=$(< rtToken)
- name: Maven
type: Bash
configuration:
<<: *COMMON_CONFIGURATION
execution:
<<: *UPDATE_COMMIT_STATUS
onExecute:
- cd $res_jfrogCliGit_resourcePath
- mvn --version
- *CREATE_RT_ACCESS_TOKEN
- env -i PATH=$PATH M2_HOME=$M2_HOME HOME=$HOME `which go` test -v -timeout 0 -test.maven -rt.url=$int_jfrog_rt_url -rt.accessToken=$(< rtToken)
- name: Gradle
type: Bash
configuration:
<<: *COMMON_CONFIGURATION
execution:
<<: *UPDATE_COMMIT_STATUS
onExecute:
- cd $res_jfrogCliGit_resourcePath
- gradle --version
- *CREATE_RT_ACCESS_TOKEN
- env -i PATH=$PATH M2_HOME=$M2_HOME HOME=$HOME `which go` test -v -timeout 0 -test.gradle -rt.url=$int_jfrog_rt_url -rt.accessToken=$(< rtToken)
- name: Pip
type: Bash
configuration:
<<: *COMMON_CONFIGURATION
execution:
<<: *UPDATE_COMMIT_STATUS
onExecute:
- cd $res_jfrogCliGit_resourcePath
- pip --version
- *CREATE_RT_ACCESS_TOKEN
- env -i PATH=$PATH M2_HOME=$M2_HOME HOME=$HOME `which go` test -v -timeout 0 -test.pip -rt.url=$int_jfrog_rt_url -rt.accessToken=$(< rtToken)
- name: Go
type: Bash
configuration:
<<: *COMMON_CONFIGURATION
execution:
<<: *UPDATE_COMMIT_STATUS
onExecute:
- cd $res_jfrogCliGit_resourcePath
- go version
- *CREATE_RT_ACCESS_TOKEN
- env -i PATH=$PATH M2_HOME=$M2_HOME HOME=$HOME `which go` test -v -timeout 0 -test.go -rt.url=$int_jfrog_rt_url -rt.accessToken=$(< rtToken)
- name: Distribution
type: Bash
configuration:
<<: *COMMON_CONFIGURATION
execution:
<<: *UPDATE_COMMIT_STATUS
onExecute:
- cd $res_jfrogCliGit_resourcePath
- *CREATE_RT_ACCESS_TOKEN
- curl -X POST -u $int_jfrog_rt_user:$int_jfrog_rt_password $int_jfrog_dist_url/api/v1/security/token -d "username=$int_jfrog_rt_user" -d 'expires_in=1800' | jq '.access_token' -r > distToken
- env -i PATH=$PATH M2_HOME=$M2_HOME HOME=$HOME `which go` test -v -timeout 0 -test.distribution -rt.url=$int_jfrog_rt_url -rt.distUrl=$int_jfrog_dist_url -rt.accessToken=$(< rtToken) -rt.distAccessToken=$(< distToken)
- name: Docker
type: Bash
configuration:
runtime:
type: host
<<: *COMMON_CONFIGURATION
execution:
<<: *UPDATE_COMMIT_STATUS
onExecute:
- cd $res_jfrogCliGit_resourcePath
- docker version
# Install Golang
- curl -LO https://get.golang.org/$(uname)/go_installer && chmod +x go_installer && SHELL=bash ./go_installer && rm go_installer
- export PATH=/$HOME/.go/bin:$PATH
- go version && go mod tidy
# Install Podman
- echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_18.04/ /" | tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
- curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_18.04/Release.key | apt-key add -
- timeout 1h bash -c 'until apt update && apt -yq install podman; do sleep 10; done'
- podman version
- *CREATE_RT_ACCESS_TOKEN
- env -i PATH=$PATH HOME=$HOME `which go` test -v -timeout 0 -test.docker -rt.url=$int_jfrog_rt_url -rt.accessToken=$(< rtToken) -rt.dockerRepoDomain=ecosysjfrog-docker-virtual.jfrog.io -rt.dockerVirtualRepo=docker-virtual -rt.DockerLocalRepo=docker-local -rt.dockerRemoteRepo=docker-remote
- name: NuGet
type: Bash
configuration:
<<: *COMMON_CONFIGURATION
execution:
<<: *UPDATE_COMMIT_STATUS
onExecute:
- cd $res_jfrogCliGit_resourcePath
- nuget help 2>&1 | head -1
- apt install -yq dotnet-sdk-2.1
- *CREATE_RT_ACCESS_TOKEN
- env -i PATH=$PATH M2_HOME=$M2_HOME HOME=$HOME `which go` test -v -timeout 0 -test.nuget -rt.url=$int_jfrog_rt_url -rt.accessToken=$(< rtToken)
- name: Bintray
type: Bash
configuration:
<<: *COMMON_CONFIGURATION
execution:
<<: *UPDATE_COMMIT_STATUS
onExecute:
- cd $res_jfrogCliGit_resourcePath
- env -i PATH=$PATH M2_HOME=$M2_HOME HOME=$HOME `which go` test -v -timeout 0 -test.bintray -bt.user=$int_jfrog_bintray_user -bt.key=$int_jfrog_bintray_apikey
- name: Plugins
type: Bash
configuration:
<<: *COMMON_CONFIGURATION
execution:
<<: *UPDATE_COMMIT_STATUS
onExecute:
- cd $res_jfrogCliGit_resourcePath
- *CREATE_RT_ACCESS_TOKEN
- env -i PATH=$PATH M2_HOME=$M2_HOME HOME=$HOME `which go` test -v -timeout 0 -test.plugins -rt.url=$int_jfrog_rt_url -rt.accessToken=$(< rtToken)