forked from jfrog/jfrog-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pipelines.yml
179 lines (164 loc) · 6.75 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
# 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 --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.0.0
environmentVariables:
readOnly:
#GOPROXY: https://gocenter.io
CI: "true"
steps:
# Repositories creators tests - should be running in serial
- name: Artifactory
type: Bash
configuration:
<<: *COMMON_CONFIGURATION
affinityGroup: repositoriesCreators
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
affinityGroup: repositoriesCreators
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
affinityGroup: repositoriesCreators
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
affinityGroup: repositoriesCreators
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
affinityGroup: repositoriesCreators
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
affinityGroup: repositoriesCreators
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
affinityGroup: repositoriesCreators
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:
<<: *COMMON_CONFIGURATION
affinityGroup: repositoriesCreators
execution:
<<: *UPDATE_COMMIT_STATUS
onExecute:
- cd $res_jfrogCliGit_resourcePath
- docker version
- *CREATE_RT_ACCESS_TOKEN
- env -i PATH=$PATH M2_HOME=$M2_HOME HOME=$HOME DOCKER_CLI_EXPERIMENTAL=enabled `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.dockerTargetRepo=docker-local -rt.dockerRemoteRepo=docker-remote
# Parallel tests
- 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
- env -i PATH=$PATH M2_HOME=$M2_HOME HOME=$HOME `which go` test -v -timeout 0 -test.plugins