-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpipelines.yml
More file actions
184 lines (140 loc) · 9.85 KB
/
pipelines.yml
File metadata and controls
184 lines (140 loc) · 9.85 KB
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
template: true # required for local templates
valuesFilePath: ./values.yml
# ==========================================================
# Typically contain information needed for a step in a pipeline to execute and can also be used to store
# information produced by a step. Resources defined should be unique across all the pipelines.
# Because of that they also provide the way to link pipelines.
# ==========================================================
resources:
# ==========================================================
# GitRepo Resource
# ==========================================================
- name: git_repo # Unique name <required>
type: GitRepo # Git repo resource type <required>
# ==========================================================
# Configurations related to the Git Repo in use
# ==========================================================
configuration:
# ==========================================================
# SCM integration where the repository is located
# ==========================================================
gitProvider: {{ .Values.gitRepo.gitProvider }} # This will be replaced from values.yml
# ==========================================================
# Repository path, including org name/repo name
# ==========================================================
path: {{ .Values.gitRepo.path }} # This will be replaced from values.yml
# ==========================================================
# Specifies which branches will trigger dependent steps
# ==========================================================
branches:
# ==========================================================
# Minimally includes the master branch
# ==========================================================
include: master
# ==========================================================
# Maven specific build information
# ==========================================================
- name: project_build_info # Unique name <required>
type: BuildInfo # Build information type <required>
# ==========================================================
# Build configuration
# ==========================================================
configuration:
sourceArtifactory: # The name of the Artifactory Integration <required>
buildName: go-demoBuild # The name of the build to associate with this BuildInfo <optional>
buildNumber: 1 # The number of the build to associate with this BuildInfo <optional>
# ==========================================================
# Docker specific build information
# ==========================================================
- name: docker_build_info # Unique name <required>
type: BuildInfo # Build information type <required>
# ==========================================================
# Build configuration
# ==========================================================
configuration:
sourceArtifactory: # The name of the Artifactory Integration <required>
buildName: go-demoDockerBuild # The name of the build to associate with this BuildInfo <optional>
buildNumber: 1 # The number of the build to associate with this BuildInfo <optional>
# ==========================================================
# Provides the details of files to download the application archive from Artifactory
# ==========================================================
- name: buildArchiveFile # Unique name <required>
type: FileSpec # File spec type <required>
# ==========================================================
# Used to add a reference to a Docker image to this pipeline
# ==========================================================
- name: docker_image_resource # Unique name <required>
type: Image # Image type <required>
# ==========================================================
# Docker image configuration
# ==========================================================
configuration:
registry: # The name of a Docker Registry Integration <required>
sourceRepository: # The name of the repository in Artifactory to which the images will be published <required>
imageName: //go-demo # The file path of the Docker image, of the form imageRepo/imageName <equired>
imageTag: latest # The version tag of the initial version of the Docker image <required>
autoPull: false # When true, the image is automatically pulled to the machine running the step <default:false>
pipelines:
- name: go-demoPipeline
# =======================================================
# Docker Build Step
# =======================================================
- name: docker_build_step # Unique name <required>
type: DockerBuild # Docker build type <requierd>
# =======================================================
# Step configuration
# =======================================================
configuration:
dockerFileLocation: . # Directory containing the Dockerfile, which is the file that has Docker build configuration. <required>
dockerFileName: Dockerfile # Name of the Dockerfile <required>
dockerImageName: //go-demo # The name of the Docker image to create <required>
dockerImageTag: latest # The tag for the Docker image to create <required>
affinityGroup: shared_affinity_group # used to bind steps <optional>
integrations:
- name: # Must specify an Artifactory Integration <required>
inputResources:
- name: git_repo # Git Repo containing the Dockerfile
- name: buildArchiveFile # The archive file built during the previous build step
inputSteps:
- name: build_step # The required step of this one
# ======================================================
# execution sequences to apply before, during, and after step execution
# ======================================================
execution:
onStart:
- echo "Preparing for Docker image build..."
onSuccess:
- echo "Docker image build was successful"
onFailure:
- echo "uh oh, something went wrong with the Docker image build"
# =======================================================
# Docker Push Step
# =======================================================
- name: docker_push_step # Unique name <required>
type: DockerPush # Docker build type <requierd>
# =======================================================
# Step configuration
# =======================================================
configuration:
targetRepository: # The name of the Docker repository in Artifactory <required>
affinityGroup: shared_affinity_group # used to bind steps <optional>
forceXrayScan: true # Forces an Xray scan after publishing to Artifactory
failOnScan: false # When set to true, and when the Xray Policy RuleFail Build checkbox is checked, a failed Xray scan will result in a failure of the step
autoPublishBuildInfo: true # Publishes build info with the Docker image
integrations:
- name: # Must specify an Artifactory Integration <required>
inputSteps:
- name: docker_build_step # Must specify the named DockerBuild step in the same affinity group
outputResources:
- name: docker_build_info # required if autoPublishBuildInfo is true
- name: docker_image_resource # docker image resource
# ======================================================
# execution sequences to apply before, during, and after step execution
# ======================================================
execution:
onStart:
- echo "Preparing for Docker image push..."
onSuccess:
- echo "Docker image push was successful"
onFailure:
- echo "uh oh, something went wrong with the Docker image push"