forked from yairbass/Orbitera-v2-step1
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Npm-Pipelines.yaml
161 lines (140 loc) · 4.76 KB
/
Npm-Pipelines.yaml
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
pipelines:
- name: npm_build
# Global configuration section for the entire pipeline
configuration:
environmentVariables:
readOnly:
ArtIP: $(echo ${int_artifactory_url}|awk -F '/' '{print $3}')
Version: 1.2.$run_number
steps:
- name: npm_prep
type: NpmBuild
configuration:
runtime:
type: image
image:
custom:
name: docker.bintray.io/jfrog/pipelines-u18node
tag: "10.16.3"
npmArgs: --no-progress --no-audit
repositoryName: team1-npm
sourceLocation: tutorial/step2-create-ui-pkg
integrations:
- name: artifactory
inputResources:
- name: gitRepo_code
execution:
onStart:
- pushd ${res_gitRepo_code_resourcePath}/tutorial/step2-create-ui-pkg
- npm version ${Version} --no-git-tag-version
- popd
- name: npm_compile
type: Bash
configuration:
inputSteps:
- name: npm_prep
integrations:
- name: artifactory
execution:
onStart:
- export tempStateLocation="$step_tmp_dir/npmSourceState"
# Restore file from previous step to current step
- restore_run_files npmBuildInputGitRepo $tempStateLocation
- pushd $tempStateLocation/tutorial/step2-create-ui-pkg
- npm install shelljs
- npm install
# Add files to npm pipeline target
- add_run_files $tempStateLocation/. npmBuildInputGitRepo
- popd
- name: npm_publish
type: NpmPublish
configuration:
repositoryName: team1-npm
integrations:
- name: artifactory
inputSteps:
- name: npm_compile
execution:
onStart:
- export inputNpmBuildStepName="npm_prep"
# - name: npm_scan_publish
# type: PublishBuildInfo
# configuration:
# forceXrayScan: True
# inputSteps:
# - name: npm_publish
# outputResources:
# - name: npmBuildInfo
#
# # Currently not in use
# - name: npm_promote
# type: PromoteBuild
# configuration:
# targetRepository: team1-npm-staging-us
# includeDependencies: false
# status: Passed
# comment: Artifact passed Xray Scan
# copy: true
# inputResources:
# - name: npmBuildInfo # optional
# trigger: true
# outputResources:
# - name: promoted_npmBuild_Info
#
- name: npm_docker_build
type: DockerBuild
configuration:
dockerFileLocation: tutorial/step2-create-ui-pkg
dockerFileName: Dockerfile
dockerImageName: ${ArtIP}/team1-docker-dev-us/npm-app
dockerImageTag: ${Version}
inputSteps:
- name: npm_publish
inputResources:
- name: gitRepo_code
- name: npm_fileSpec
# - name: promoted_npmBuild_Info
# trigger: true # Currently not in use
integrations:
- name: artifactory
execution:
onStart:
- pushd ${res_gitRepo_code_resourcePath}/tutorial/step2-create-ui-pkg
# Creating a Folder for the fileSpec Target
- mkdir -p npm_results
- popd
onSuccess:
- echo "Congrats The Docker image was build"
- name: Npm_docker_push
type: DockerPush
configuration:
targetRepository: team1-docker-dev-us
autoPublishBuildInfo: true
integrations:
- name: artifactory
inputSteps:
- name: npm_docker_build
outputResources:
- name: docker_npmBuild_Info
- name: npm_docker_scan
type: XrayScan
configuration:
# waitUntilFinish: true
inputResources:
- name: docker_npmBuild_Info
trigger: true
outputResources:
- name: scanned_npm_dockerBuild_Info
- name: npm_docker_promote
type: PromoteBuild
configuration:
targetRepository: team1-docker-staging-us
includeDependencies: true
status: Passed
comment: Artifact passed Xray Scan
copy: false
inputResources:
- name: scanned_npm_dockerBuild_Info
trigger: true
outputResources:
- name: final_docker_npmBuild_Info