@oncehub/eslint-config 2.1.1 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/codeql-analysis.yml +72 -0
- package/.lighthouse/jenkins-x/Kptfile +11 -0
- package/.lighthouse/jenkins-x/pullrequest.yaml +278 -0
- package/.lighthouse/jenkins-x/release.yaml +269 -0
- package/.lighthouse/jenkins-x/triggers.yaml +19 -0
- package/OWNERS +4 -0
- package/OWNERS_ALIASES +31 -0
- package/deploy.sh +19 -0
- package/package-deploy/npm-login.js +14 -0
- package/package.json +3 -2
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# For most projects, this workflow file will not need changing; you simply need
|
|
2
|
+
# to commit it to your repository.
|
|
3
|
+
#
|
|
4
|
+
# You may wish to alter this file to override the set of languages analyzed,
|
|
5
|
+
# or to provide custom queries or build logic.
|
|
6
|
+
#
|
|
7
|
+
# ******** NOTE ********
|
|
8
|
+
# We have attempted to detect the languages in your repository. Please check
|
|
9
|
+
# the `language` matrix defined below to confirm you have the correct set of
|
|
10
|
+
# supported CodeQL languages.
|
|
11
|
+
#
|
|
12
|
+
name: "CodeQL"
|
|
13
|
+
|
|
14
|
+
on:
|
|
15
|
+
push:
|
|
16
|
+
branches: [ master ]
|
|
17
|
+
pull_request:
|
|
18
|
+
# The branches below must be a subset of the branches above
|
|
19
|
+
branches: [ master ]
|
|
20
|
+
schedule:
|
|
21
|
+
- cron: '19 10 * * 0'
|
|
22
|
+
|
|
23
|
+
jobs:
|
|
24
|
+
analyze:
|
|
25
|
+
name: Analyze
|
|
26
|
+
runs-on: ubuntu-latest
|
|
27
|
+
permissions:
|
|
28
|
+
actions: read
|
|
29
|
+
contents: read
|
|
30
|
+
security-events: write
|
|
31
|
+
|
|
32
|
+
strategy:
|
|
33
|
+
fail-fast: false
|
|
34
|
+
matrix:
|
|
35
|
+
language: [ 'javascript' ]
|
|
36
|
+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
|
37
|
+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
|
|
38
|
+
|
|
39
|
+
steps:
|
|
40
|
+
- name: Checkout repository
|
|
41
|
+
uses: actions/checkout@v3
|
|
42
|
+
|
|
43
|
+
# Initializes the CodeQL tools for scanning.
|
|
44
|
+
- name: Initialize CodeQL
|
|
45
|
+
uses: github/codeql-action/init@v2
|
|
46
|
+
with:
|
|
47
|
+
languages: ${{ matrix.language }}
|
|
48
|
+
# If you wish to specify custom queries, you can do so here or in a config file.
|
|
49
|
+
# By default, queries listed here will override any specified in a config file.
|
|
50
|
+
# Prefix the list here with "+" to use these queries and those in the config file.
|
|
51
|
+
|
|
52
|
+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
|
53
|
+
# queries: security-extended,security-and-quality
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
|
57
|
+
# If this step fails, then you should remove it and run the build manually (see below)
|
|
58
|
+
- name: Autobuild
|
|
59
|
+
uses: github/codeql-action/autobuild@v2
|
|
60
|
+
|
|
61
|
+
# ℹ️ Command-line programs to run using the OS shell.
|
|
62
|
+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
|
63
|
+
|
|
64
|
+
# If the Autobuild fails above, remove it and uncomment the following three lines.
|
|
65
|
+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
|
|
66
|
+
|
|
67
|
+
# - run: |
|
|
68
|
+
# echo "Run, Build Application using script"
|
|
69
|
+
# ./location_of_script_within_repo/buildscript.sh
|
|
70
|
+
|
|
71
|
+
- name: Perform CodeQL Analysis
|
|
72
|
+
uses: github/codeql-action/analyze@v2
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
apiVersion: kpt.dev/v1alpha1
|
|
2
|
+
kind: Kptfile
|
|
3
|
+
metadata:
|
|
4
|
+
name: jenkins-x
|
|
5
|
+
upstream:
|
|
6
|
+
type: git
|
|
7
|
+
git:
|
|
8
|
+
commit: 4b44dcda8284ebcecf7eed34c00f23b54e7a9d27
|
|
9
|
+
repo: https://github.com/scheduleonce/jx3-pipeline-catalog
|
|
10
|
+
directory: /packs/eslint-config-oncehub/.lighthouse/jenkins-x
|
|
11
|
+
ref: master
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
apiVersion: tekton.dev/v1beta1
|
|
2
|
+
kind: PipelineRun
|
|
3
|
+
metadata:
|
|
4
|
+
creationTimestamp: null
|
|
5
|
+
labels:
|
|
6
|
+
branch: master
|
|
7
|
+
build: "1"
|
|
8
|
+
jenkins.io/pipelineType: build
|
|
9
|
+
owner: jenkins-x-quickstarts
|
|
10
|
+
repository: eslint-config-oncehub
|
|
11
|
+
name: eslint-pr
|
|
12
|
+
spec:
|
|
13
|
+
pipelineSpec:
|
|
14
|
+
params:
|
|
15
|
+
- description: the unique build number
|
|
16
|
+
name: BUILD_ID
|
|
17
|
+
type: string
|
|
18
|
+
- description: the name of the job which is the trigger context name
|
|
19
|
+
name: JOB_NAME
|
|
20
|
+
type: string
|
|
21
|
+
- description: the specification of the job
|
|
22
|
+
name: JOB_SPEC
|
|
23
|
+
type: string
|
|
24
|
+
- description: 'the kind of job: postsubmit or presubmit'
|
|
25
|
+
name: JOB_TYPE
|
|
26
|
+
type: string
|
|
27
|
+
- default: master
|
|
28
|
+
description: the base git reference of the pull request
|
|
29
|
+
name: PULL_BASE_REF
|
|
30
|
+
type: string
|
|
31
|
+
- description: the git sha of the base of the pull request
|
|
32
|
+
name: PULL_BASE_SHA
|
|
33
|
+
type: string
|
|
34
|
+
- default: ""
|
|
35
|
+
description: git pull request number
|
|
36
|
+
name: PULL_NUMBER
|
|
37
|
+
type: string
|
|
38
|
+
- default: ""
|
|
39
|
+
description: git pull request ref in the form 'refs/pull/$PULL_NUMBER/head'
|
|
40
|
+
name: PULL_PULL_REF
|
|
41
|
+
type: string
|
|
42
|
+
- default: master
|
|
43
|
+
description: git revision to checkout (branch, tag, sha, ref…)
|
|
44
|
+
name: PULL_PULL_SHA
|
|
45
|
+
type: string
|
|
46
|
+
- description: git pull reference strings of base and latest in the form 'master:$PULL_BASE_SHA,$PULL_NUMBER:$PULL_PULL_SHA:refs/pull/$PULL_NUMBER/head'
|
|
47
|
+
name: PULL_REFS
|
|
48
|
+
type: string
|
|
49
|
+
- description: git repository name
|
|
50
|
+
name: REPO_NAME
|
|
51
|
+
type: string
|
|
52
|
+
- description: git repository owner (user or organisation)
|
|
53
|
+
name: REPO_OWNER
|
|
54
|
+
type: string
|
|
55
|
+
- description: git url to clone
|
|
56
|
+
name: REPO_URL
|
|
57
|
+
type: string
|
|
58
|
+
tasks:
|
|
59
|
+
- name: eslint-pr
|
|
60
|
+
params:
|
|
61
|
+
- name: BUILD_ID
|
|
62
|
+
value: $(params.BUILD_ID)
|
|
63
|
+
- name: JOB_NAME
|
|
64
|
+
value: $(params.JOB_NAME)
|
|
65
|
+
- name: JOB_SPEC
|
|
66
|
+
value: $(params.JOB_SPEC)
|
|
67
|
+
- name: JOB_TYPE
|
|
68
|
+
value: $(params.JOB_TYPE)
|
|
69
|
+
- name: PULL_BASE_REF
|
|
70
|
+
value: $(params.PULL_BASE_REF)
|
|
71
|
+
- name: PULL_BASE_SHA
|
|
72
|
+
value: $(params.PULL_BASE_SHA)
|
|
73
|
+
- name: PULL_NUMBER
|
|
74
|
+
value: $(params.PULL_NUMBER)
|
|
75
|
+
- name: PULL_PULL_REF
|
|
76
|
+
value: $(params.PULL_PULL_REF)
|
|
77
|
+
- name: PULL_PULL_SHA
|
|
78
|
+
value: $(params.PULL_PULL_SHA)
|
|
79
|
+
- name: PULL_REFS
|
|
80
|
+
value: $(params.PULL_REFS)
|
|
81
|
+
- name: REPO_NAME
|
|
82
|
+
value: $(params.REPO_NAME)
|
|
83
|
+
- name: REPO_OWNER
|
|
84
|
+
value: $(params.REPO_OWNER)
|
|
85
|
+
- name: REPO_URL
|
|
86
|
+
value: $(params.REPO_URL)
|
|
87
|
+
resources: {}
|
|
88
|
+
taskSpec:
|
|
89
|
+
params:
|
|
90
|
+
- description: git url to clone
|
|
91
|
+
name: REPO_URL
|
|
92
|
+
type: string
|
|
93
|
+
- default: master
|
|
94
|
+
description: git revision to checkout (branch, tag, sha, ref…)
|
|
95
|
+
name: PULL_PULL_SHA
|
|
96
|
+
type: string
|
|
97
|
+
- default: source
|
|
98
|
+
description: subdirectory inside of /workspace to clone the git repo
|
|
99
|
+
name: subdirectory
|
|
100
|
+
type: string
|
|
101
|
+
- description: the unique build number
|
|
102
|
+
name: BUILD_ID
|
|
103
|
+
type: string
|
|
104
|
+
- description: the name of the job which is the trigger context name
|
|
105
|
+
name: JOB_NAME
|
|
106
|
+
type: string
|
|
107
|
+
- description: the specification of the job
|
|
108
|
+
name: JOB_SPEC
|
|
109
|
+
type: string
|
|
110
|
+
- description: 'the kind of job: postsubmit or presubmit'
|
|
111
|
+
name: JOB_TYPE
|
|
112
|
+
type: string
|
|
113
|
+
- default: master
|
|
114
|
+
description: the base git reference of the pull request
|
|
115
|
+
name: PULL_BASE_REF
|
|
116
|
+
type: string
|
|
117
|
+
- description: the git sha of the base of the pull request
|
|
118
|
+
name: PULL_BASE_SHA
|
|
119
|
+
type: string
|
|
120
|
+
- default: ""
|
|
121
|
+
description: git pull request number
|
|
122
|
+
name: PULL_NUMBER
|
|
123
|
+
type: string
|
|
124
|
+
- default: ""
|
|
125
|
+
description: git pull request ref in the form 'refs/pull/$PULL_NUMBER/head'
|
|
126
|
+
name: PULL_PULL_REF
|
|
127
|
+
type: string
|
|
128
|
+
- description: git pull reference strings of base and latest in the form 'master:$PULL_BASE_SHA,$PULL_NUMBER:$PULL_PULL_SHA:refs/pull/$PULL_NUMBER/head'
|
|
129
|
+
name: PULL_REFS
|
|
130
|
+
type: string
|
|
131
|
+
- description: git repository name
|
|
132
|
+
name: REPO_NAME
|
|
133
|
+
type: string
|
|
134
|
+
- description: git repository owner (user or organisation)
|
|
135
|
+
name: REPO_OWNER
|
|
136
|
+
type: string
|
|
137
|
+
stepTemplate:
|
|
138
|
+
env:
|
|
139
|
+
- name: BUILD_ID
|
|
140
|
+
value: $(params.BUILD_ID)
|
|
141
|
+
- name: JOB_NAME
|
|
142
|
+
value: $(params.JOB_NAME)
|
|
143
|
+
- name: JOB_SPEC
|
|
144
|
+
value: $(params.JOB_SPEC)
|
|
145
|
+
- name: JOB_TYPE
|
|
146
|
+
value: $(params.JOB_TYPE)
|
|
147
|
+
- name: PULL_BASE_REF
|
|
148
|
+
value: $(params.PULL_BASE_REF)
|
|
149
|
+
- name: PULL_BASE_SHA
|
|
150
|
+
value: $(params.PULL_BASE_SHA)
|
|
151
|
+
- name: PULL_NUMBER
|
|
152
|
+
value: $(params.PULL_NUMBER)
|
|
153
|
+
- name: PULL_PULL_REF
|
|
154
|
+
value: $(params.PULL_PULL_REF)
|
|
155
|
+
- name: PULL_PULL_SHA
|
|
156
|
+
value: $(params.PULL_PULL_SHA)
|
|
157
|
+
- name: PULL_REFS
|
|
158
|
+
value: $(params.PULL_REFS)
|
|
159
|
+
- name: REPO_NAME
|
|
160
|
+
value: $(params.REPO_NAME)
|
|
161
|
+
- name: REPO_OWNER
|
|
162
|
+
value: $(params.REPO_OWNER)
|
|
163
|
+
- name: REPO_URL
|
|
164
|
+
value: $(params.REPO_URL)
|
|
165
|
+
- name: DOCKER_REGISTRY
|
|
166
|
+
valueFrom:
|
|
167
|
+
configMapKeyRef:
|
|
168
|
+
name: jenkins-x-docker-registry
|
|
169
|
+
key: docker.registry
|
|
170
|
+
- name: DOCKER_REGISTRY_ORG
|
|
171
|
+
value: "kubernetes"
|
|
172
|
+
name: ""
|
|
173
|
+
resources:
|
|
174
|
+
requests:
|
|
175
|
+
cpu: 100m
|
|
176
|
+
memory: 250Mi
|
|
177
|
+
volumeMounts:
|
|
178
|
+
- mountPath: /home/jenkins
|
|
179
|
+
name: workspace-volume
|
|
180
|
+
- mountPath: /etc/podinfo
|
|
181
|
+
name: podinfo
|
|
182
|
+
readOnly: true
|
|
183
|
+
- mountPath: /merge-disabled
|
|
184
|
+
name: merge-disabled
|
|
185
|
+
readOnly: true
|
|
186
|
+
workingDir: /workspace/source
|
|
187
|
+
steps:
|
|
188
|
+
- script: |
|
|
189
|
+
#!/usr/bin/env bash
|
|
190
|
+
RED='\033[0;31m'
|
|
191
|
+
NC='\033[0m' # No Color
|
|
192
|
+
mergeDisabled=$(cat "/merge-disabled/MERGE_DISABLED")
|
|
193
|
+
if [[ $(params.PULL_BASE_REF) == "qa" && $mergeDisabled == "true" ]]; then
|
|
194
|
+
echo -e "\n ${RED}Merge is temporarly disabled for $(params.PULL_BASE_REF) branch...Please close/reopen the PR's once merge is enabled...${NC}"
|
|
195
|
+
exit 1;
|
|
196
|
+
fi
|
|
197
|
+
image: ghcr.io/jenkins-x/builder-jx:2.1.155-779
|
|
198
|
+
name: check-merge-disabled
|
|
199
|
+
- args:
|
|
200
|
+
- -c
|
|
201
|
+
- 'mkdir -p $HOME; git config --global --add user.name ${GIT_AUTHOR_NAME:-so-integrations}; git config --global --add user.email ${GIT_AUTHOR_EMAIL:-so-integrations@oncehub.com}; git config --global credential.helper store; git clone $(params.REPO_URL) $(params.subdirectory); echo cloned url: $(params.REPO_URL) to dir: $(params.subdirectory);'
|
|
202
|
+
command:
|
|
203
|
+
- /bin/sh
|
|
204
|
+
image: ghcr.io/jenkins-x/builder-jx:2.1.155-779
|
|
205
|
+
name: git-clone
|
|
206
|
+
resources: {}
|
|
207
|
+
workingDir: /workspace
|
|
208
|
+
- args:
|
|
209
|
+
- '[ -d /builder/home ] || mkdir -p /builder && ln -s /tekton/home /builder/home'
|
|
210
|
+
command:
|
|
211
|
+
- /bin/sh
|
|
212
|
+
- -c
|
|
213
|
+
image: ghcr.io/jenkins-x/builder-jx:2.1.155-779
|
|
214
|
+
name: setup-builder-home
|
|
215
|
+
resources: {}
|
|
216
|
+
- args:
|
|
217
|
+
- step
|
|
218
|
+
- git
|
|
219
|
+
- merge
|
|
220
|
+
- --verbose
|
|
221
|
+
- --baseSHA
|
|
222
|
+
- $(params.PULL_BASE_SHA)
|
|
223
|
+
- --sha
|
|
224
|
+
- $(params.PULL_PULL_SHA)
|
|
225
|
+
- --baseBranch
|
|
226
|
+
- $(params.PULL_BASE_REF)
|
|
227
|
+
command:
|
|
228
|
+
- jx
|
|
229
|
+
image: ghcr.io/jenkins-x/builder-jx:2.1.155-779
|
|
230
|
+
name: git-merge
|
|
231
|
+
resources: {}
|
|
232
|
+
- args:
|
|
233
|
+
- -c
|
|
234
|
+
- |
|
|
235
|
+
/bin/bash <<'EOF'
|
|
236
|
+
# Script to evaluate image tag.
|
|
237
|
+
branchName=$PULL_BASE_REF
|
|
238
|
+
echo "eval tag script for $branchName branch..."
|
|
239
|
+
teamBranchReg="team\/.*"
|
|
240
|
+
storyBranchReg=".*\/story\/.*"
|
|
241
|
+
if [[ $branchName =~ $teamBranchReg ]]; then
|
|
242
|
+
tag=$(echo $branchName | sed 's/team\//''/g' )
|
|
243
|
+
elif [[ $branchName =~ $storyBranchReg ]]; then
|
|
244
|
+
tag=$(echo $branchName | sed 's/\/.*/''/g' )
|
|
245
|
+
elif [[ $branchName == "master" ]]; then
|
|
246
|
+
tag="prod"
|
|
247
|
+
elif [[ $branchName == "qa" || $branchName == "staging-app2" ]]; then
|
|
248
|
+
tag=$branchName
|
|
249
|
+
else
|
|
250
|
+
tag="${branchName//\//'-'}"
|
|
251
|
+
fi
|
|
252
|
+
echo $tag > VERSION
|
|
253
|
+
EOF
|
|
254
|
+
command:
|
|
255
|
+
- /bin/sh
|
|
256
|
+
image: ghcr.io/jenkins-x/builder-go
|
|
257
|
+
name: pr-version
|
|
258
|
+
resources: {}
|
|
259
|
+
volumes:
|
|
260
|
+
- emptyDir: {}
|
|
261
|
+
name: workspace-volume
|
|
262
|
+
- downwardAPI:
|
|
263
|
+
items:
|
|
264
|
+
- fieldRef:
|
|
265
|
+
fieldPath: metadata.labels
|
|
266
|
+
path: labels
|
|
267
|
+
name: podinfo
|
|
268
|
+
- name: merge-disabled
|
|
269
|
+
secret:
|
|
270
|
+
secretName: merge-disabled
|
|
271
|
+
podTemplate:
|
|
272
|
+
ImagePullSecrets:
|
|
273
|
+
- name: tekton-container-registry-auth
|
|
274
|
+
hostNetwork: false
|
|
275
|
+
schedulerName: ""
|
|
276
|
+
serviceAccountName: tekton-bot
|
|
277
|
+
timeout: 240h0m0s
|
|
278
|
+
status: {}
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
apiVersion: tekton.dev/v1beta1
|
|
2
|
+
kind: PipelineRun
|
|
3
|
+
metadata:
|
|
4
|
+
creationTimestamp: null
|
|
5
|
+
labels:
|
|
6
|
+
branch: master
|
|
7
|
+
build: "1"
|
|
8
|
+
jenkins.io/pipelineType: build
|
|
9
|
+
owner: jenkins-x-quickstarts
|
|
10
|
+
repository: eslint-config-oncehub
|
|
11
|
+
name: eslint
|
|
12
|
+
spec:
|
|
13
|
+
pipelineSpec:
|
|
14
|
+
params:
|
|
15
|
+
- description: the unique build number
|
|
16
|
+
name: BUILD_ID
|
|
17
|
+
type: string
|
|
18
|
+
- description: the name of the job which is the trigger context name
|
|
19
|
+
name: JOB_NAME
|
|
20
|
+
type: string
|
|
21
|
+
- description: the specification of the job
|
|
22
|
+
name: JOB_SPEC
|
|
23
|
+
type: string
|
|
24
|
+
- description: 'the kind of job: postsubmit or presubmit'
|
|
25
|
+
name: JOB_TYPE
|
|
26
|
+
type: string
|
|
27
|
+
- default: master
|
|
28
|
+
description: the base git reference of the pull request
|
|
29
|
+
name: PULL_BASE_REF
|
|
30
|
+
type: string
|
|
31
|
+
- description: the git sha of the base of the pull request
|
|
32
|
+
name: PULL_BASE_SHA
|
|
33
|
+
type: string
|
|
34
|
+
- default: ""
|
|
35
|
+
description: git pull request number
|
|
36
|
+
name: PULL_NUMBER
|
|
37
|
+
type: string
|
|
38
|
+
- default: ""
|
|
39
|
+
description: git pull request ref in the form 'refs/pull/$PULL_NUMBER/head'
|
|
40
|
+
name: PULL_PULL_REF
|
|
41
|
+
type: string
|
|
42
|
+
- default: master
|
|
43
|
+
description: git revision to checkout (branch, tag, sha, ref…)
|
|
44
|
+
name: PULL_PULL_SHA
|
|
45
|
+
type: string
|
|
46
|
+
- description: git pull reference strings of base and latest in the form 'master:$PULL_BASE_SHA,$PULL_NUMBER:$PULL_PULL_SHA:refs/pull/$PULL_NUMBER/head'
|
|
47
|
+
name: PULL_REFS
|
|
48
|
+
type: string
|
|
49
|
+
- description: git repository name
|
|
50
|
+
name: REPO_NAME
|
|
51
|
+
type: string
|
|
52
|
+
- description: git repository owner (user or organisation)
|
|
53
|
+
name: REPO_OWNER
|
|
54
|
+
type: string
|
|
55
|
+
- description: git url to clone
|
|
56
|
+
name: REPO_URL
|
|
57
|
+
type: string
|
|
58
|
+
tasks:
|
|
59
|
+
- name: release
|
|
60
|
+
params:
|
|
61
|
+
- name: BUILD_ID
|
|
62
|
+
value: $(params.BUILD_ID)
|
|
63
|
+
- name: JOB_NAME
|
|
64
|
+
value: $(params.JOB_NAME)
|
|
65
|
+
- name: JOB_SPEC
|
|
66
|
+
value: $(params.JOB_SPEC)
|
|
67
|
+
- name: JOB_TYPE
|
|
68
|
+
value: $(params.JOB_TYPE)
|
|
69
|
+
- name: PULL_BASE_REF
|
|
70
|
+
value: $(params.PULL_BASE_REF)
|
|
71
|
+
- name: PULL_BASE_SHA
|
|
72
|
+
value: $(params.PULL_BASE_SHA)
|
|
73
|
+
- name: PULL_NUMBER
|
|
74
|
+
value: $(params.PULL_NUMBER)
|
|
75
|
+
- name: PULL_PULL_REF
|
|
76
|
+
value: $(params.PULL_PULL_REF)
|
|
77
|
+
- name: PULL_PULL_SHA
|
|
78
|
+
value: $(params.PULL_PULL_SHA)
|
|
79
|
+
- name: PULL_REFS
|
|
80
|
+
value: $(params.PULL_REFS)
|
|
81
|
+
- name: REPO_NAME
|
|
82
|
+
value: $(params.REPO_NAME)
|
|
83
|
+
- name: REPO_OWNER
|
|
84
|
+
value: $(params.REPO_OWNER)
|
|
85
|
+
- name: REPO_URL
|
|
86
|
+
value: $(params.REPO_URL)
|
|
87
|
+
resources: {}
|
|
88
|
+
taskSpec:
|
|
89
|
+
params:
|
|
90
|
+
- description: git url to clone
|
|
91
|
+
name: REPO_URL
|
|
92
|
+
type: string
|
|
93
|
+
- default: master
|
|
94
|
+
description: git revision to checkout (branch, tag, sha, ref…)
|
|
95
|
+
name: PULL_PULL_SHA
|
|
96
|
+
type: string
|
|
97
|
+
- default: source
|
|
98
|
+
description: subdirectory inside of /workspace to clone the git repo
|
|
99
|
+
name: subdirectory
|
|
100
|
+
type: string
|
|
101
|
+
- description: the unique build number
|
|
102
|
+
name: BUILD_ID
|
|
103
|
+
type: string
|
|
104
|
+
- description: the name of the job which is the trigger context name
|
|
105
|
+
name: JOB_NAME
|
|
106
|
+
type: string
|
|
107
|
+
- description: the specification of the job
|
|
108
|
+
name: JOB_SPEC
|
|
109
|
+
type: string
|
|
110
|
+
- description: 'the kind of job: postsubmit or presubmit'
|
|
111
|
+
name: JOB_TYPE
|
|
112
|
+
type: string
|
|
113
|
+
- default: master
|
|
114
|
+
description: the base git reference of the pull request
|
|
115
|
+
name: PULL_BASE_REF
|
|
116
|
+
type: string
|
|
117
|
+
- description: the git sha of the base of the pull request
|
|
118
|
+
name: PULL_BASE_SHA
|
|
119
|
+
type: string
|
|
120
|
+
- default: ""
|
|
121
|
+
description: git pull request number
|
|
122
|
+
name: PULL_NUMBER
|
|
123
|
+
type: string
|
|
124
|
+
- default: ""
|
|
125
|
+
description: git pull request ref in the form 'refs/pull/$PULL_NUMBER/head'
|
|
126
|
+
name: PULL_PULL_REF
|
|
127
|
+
type: string
|
|
128
|
+
- description: git pull reference strings of base and latest in the form 'master:$PULL_BASE_SHA,$PULL_NUMBER:$PULL_PULL_SHA:refs/pull/$PULL_NUMBER/head'
|
|
129
|
+
name: PULL_REFS
|
|
130
|
+
type: string
|
|
131
|
+
- description: git repository name
|
|
132
|
+
name: REPO_NAME
|
|
133
|
+
type: string
|
|
134
|
+
- description: git repository owner (user or organisation)
|
|
135
|
+
name: REPO_OWNER
|
|
136
|
+
type: string
|
|
137
|
+
stepTemplate:
|
|
138
|
+
env:
|
|
139
|
+
- name: BUILD_ID
|
|
140
|
+
value: $(params.BUILD_ID)
|
|
141
|
+
- name: JOB_NAME
|
|
142
|
+
value: $(params.JOB_NAME)
|
|
143
|
+
- name: JOB_SPEC
|
|
144
|
+
value: $(params.JOB_SPEC)
|
|
145
|
+
- name: JOB_TYPE
|
|
146
|
+
value: $(params.JOB_TYPE)
|
|
147
|
+
- name: PULL_BASE_REF
|
|
148
|
+
value: $(params.PULL_BASE_REF)
|
|
149
|
+
- name: PULL_BASE_SHA
|
|
150
|
+
value: $(params.PULL_BASE_SHA)
|
|
151
|
+
- name: PULL_NUMBER
|
|
152
|
+
value: $(params.PULL_NUMBER)
|
|
153
|
+
- name: PULL_PULL_REF
|
|
154
|
+
value: $(params.PULL_PULL_REF)
|
|
155
|
+
- name: PULL_PULL_SHA
|
|
156
|
+
value: $(params.PULL_PULL_SHA)
|
|
157
|
+
- name: PULL_REFS
|
|
158
|
+
value: $(params.PULL_REFS)
|
|
159
|
+
- name: REPO_NAME
|
|
160
|
+
value: $(params.REPO_NAME)
|
|
161
|
+
- name: REPO_OWNER
|
|
162
|
+
value: $(params.REPO_OWNER)
|
|
163
|
+
- name: REPO_URL
|
|
164
|
+
value: $(params.REPO_URL)
|
|
165
|
+
- name: DOCKER_REGISTRY
|
|
166
|
+
valueFrom:
|
|
167
|
+
configMapKeyRef:
|
|
168
|
+
name: jenkins-x-docker-registry
|
|
169
|
+
key: docker.registry
|
|
170
|
+
- name: DOCKER_REGISTRY_ORG
|
|
171
|
+
value: "kubernetes"
|
|
172
|
+
name: ""
|
|
173
|
+
resources:
|
|
174
|
+
requests:
|
|
175
|
+
cpu: 100m
|
|
176
|
+
memory: 250Mi
|
|
177
|
+
volumeMounts:
|
|
178
|
+
- mountPath: /home/jenkins
|
|
179
|
+
name: workspace-volume
|
|
180
|
+
- mountPath: /etc/podinfo
|
|
181
|
+
name: podinfo
|
|
182
|
+
readOnly: true
|
|
183
|
+
- mountPath: /etc/npm-cred
|
|
184
|
+
name: npm-cred
|
|
185
|
+
readOnly: true
|
|
186
|
+
workingDir: /workspace/source
|
|
187
|
+
steps:
|
|
188
|
+
- script: |
|
|
189
|
+
#!/bin/bash
|
|
190
|
+
# Check for already running release pipeline and wait for them to get finished(if any) before continuing.
|
|
191
|
+
ENV=$(echo $PULL_BASE_REF | cut -d '/' -f 2)
|
|
192
|
+
echo "Checking already running release pipelines for ${REPO_NAME}'s service on $ENV...";
|
|
193
|
+
CURRENT_BUILD_NO=$(jx get build pod | grep $HOSTNAME | awk '{print $4}');
|
|
194
|
+
checkAlreadyRunningPipelines() {
|
|
195
|
+
ALREADY_RUNNING_PIPELINES_COUNT=$(jx get build pods | awk -v REPO_NAME="$REPO_NAME" -v JOB_NAME="$JOB_NAME" -v ENV="$ENV" -v CURRENT_BUILD_NO="$CURRENT_BUILD_NO" '{if($2==REPO_NAME && $5==JOB_NAME && $3==ENV && $4<CURRENT_BUILD_NO && $7~"Pending|Running") {print $0}}' | wc -l);
|
|
196
|
+
if [[ $ALREADY_RUNNING_PIPELINES_COUNT != 0 ]]; then
|
|
197
|
+
echo "Waiting for already running ${REPO_NAME}'s release pipelines to get finished before continuing to avoid race conditon on $ENV..."
|
|
198
|
+
sleep 1m;
|
|
199
|
+
checkAlreadyRunningPipelines
|
|
200
|
+
fi
|
|
201
|
+
}
|
|
202
|
+
checkAlreadyRunningPipelines
|
|
203
|
+
image: ghcr.io/jenkins-x/jx-cli:3.1.299
|
|
204
|
+
name: handle-race-condition
|
|
205
|
+
resources: {}
|
|
206
|
+
- args:
|
|
207
|
+
- -c
|
|
208
|
+
- 'mkdir -p $HOME; git config --global --add user.name ${GIT_AUTHOR_NAME:-so-integrations};
|
|
209
|
+
git config --global --add user.email ${GIT_AUTHOR_EMAIL:-so-integrations@oncehub.com};
|
|
210
|
+
git config --global credential.helper store; git clone $(params.REPO_URL)
|
|
211
|
+
$(params.subdirectory); echo cloned url: $(params.REPO_URL) to dir: $(params.subdirectory);'
|
|
212
|
+
command:
|
|
213
|
+
- /bin/sh
|
|
214
|
+
image: ghcr.io/jenkins-x/builder-jx:2.1.155-779
|
|
215
|
+
name: git-clone
|
|
216
|
+
resources: {}
|
|
217
|
+
workingDir: /workspace
|
|
218
|
+
- args:
|
|
219
|
+
- step
|
|
220
|
+
- git
|
|
221
|
+
- merge
|
|
222
|
+
- --verbose
|
|
223
|
+
- --baseSHA
|
|
224
|
+
- $(params.PULL_BASE_SHA)
|
|
225
|
+
- --sha
|
|
226
|
+
- $(params.PULL_BASE_REF)
|
|
227
|
+
- --baseBranch
|
|
228
|
+
- $(params.PULL_BASE_REF)
|
|
229
|
+
command:
|
|
230
|
+
- jx
|
|
231
|
+
image: ghcr.io/jenkins-x/builder-jx:2.1.155-779
|
|
232
|
+
name: git-merge
|
|
233
|
+
resources: {}
|
|
234
|
+
- args:
|
|
235
|
+
- '[ -d /builder/home ] || mkdir -p /builder && ln -s /tekton/home /builder/home'
|
|
236
|
+
command:
|
|
237
|
+
- /bin/sh
|
|
238
|
+
- -c
|
|
239
|
+
image: ghcr.io/jenkins-x/builder-jx:2.1.155-779
|
|
240
|
+
name: setup-builder-home
|
|
241
|
+
resources: {}
|
|
242
|
+
- args:
|
|
243
|
+
- sh deploy.sh $PULL_BASE_REF
|
|
244
|
+
command:
|
|
245
|
+
- /bin/sh
|
|
246
|
+
- -c
|
|
247
|
+
image: dockeronce.azurecr.io/cloudbees/nodejs:sonf-v16-latest
|
|
248
|
+
name: package-build-publish
|
|
249
|
+
resources: {}
|
|
250
|
+
volumes:
|
|
251
|
+
- emptyDir: {}
|
|
252
|
+
name: workspace-volume
|
|
253
|
+
- downwardAPI:
|
|
254
|
+
items:
|
|
255
|
+
- fieldRef:
|
|
256
|
+
fieldPath: metadata.labels
|
|
257
|
+
path: labels
|
|
258
|
+
name: podinfo
|
|
259
|
+
- name: npm-cred
|
|
260
|
+
secret:
|
|
261
|
+
secretName: npm-cred
|
|
262
|
+
podTemplate:
|
|
263
|
+
ImagePullSecrets:
|
|
264
|
+
- name: tekton-container-registry-auth
|
|
265
|
+
hostNetwork: false
|
|
266
|
+
schedulerName: ""
|
|
267
|
+
serviceAccountName: tekton-bot
|
|
268
|
+
timeout: 240h0m0s
|
|
269
|
+
status: {}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
apiVersion: config.lighthouse.jenkins-x.io/v1alpha1
|
|
2
|
+
kind: TriggerConfig
|
|
3
|
+
spec:
|
|
4
|
+
presubmits:
|
|
5
|
+
- name: pr
|
|
6
|
+
context: "pr"
|
|
7
|
+
always_run: true
|
|
8
|
+
optional: false
|
|
9
|
+
trigger: "/test"
|
|
10
|
+
rerun_command: "/retest"
|
|
11
|
+
source: "pullrequest.yaml"
|
|
12
|
+
postsubmits:
|
|
13
|
+
- name: release
|
|
14
|
+
context: "release"
|
|
15
|
+
source: "release.yaml"
|
|
16
|
+
branches:
|
|
17
|
+
- ^(master)$
|
|
18
|
+
- ^(qa)$
|
|
19
|
+
- ^(team\/.+)$
|
package/OWNERS
ADDED
package/OWNERS_ALIASES
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
aliases:
|
|
2
|
+
developers:
|
|
3
|
+
- so-nagender
|
|
4
|
+
- so-ravindra
|
|
5
|
+
- somanwal
|
|
6
|
+
- avik-so
|
|
7
|
+
- mderazon
|
|
8
|
+
- so-abahadur
|
|
9
|
+
- amanpreetSO
|
|
10
|
+
- AmitPandeyScheduleonce
|
|
11
|
+
- ashishsatiSO
|
|
12
|
+
- SO-ashusrivastava
|
|
13
|
+
- bharatsinghoh
|
|
14
|
+
- giladgoraly
|
|
15
|
+
- sohimanshu
|
|
16
|
+
- so-kaushal
|
|
17
|
+
- nalingarg
|
|
18
|
+
- so-sdhawan
|
|
19
|
+
- so-shekhar
|
|
20
|
+
- ShivamKe
|
|
21
|
+
- umeshchaudhary
|
|
22
|
+
- ushankar208
|
|
23
|
+
- vaibhavso
|
|
24
|
+
- vinaykumar01
|
|
25
|
+
- yoramwso
|
|
26
|
+
- piyush-so
|
|
27
|
+
- sumitsharma22
|
|
28
|
+
- yuktiarora
|
|
29
|
+
- aakash-ravi
|
|
30
|
+
- rameshwarverma
|
|
31
|
+
- so-hvats
|
package/deploy.sh
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
set -e
|
|
3
|
+
|
|
4
|
+
node package-deploy/npm-login.js $(cat "/etc/npm-cred/NPM_AUTH_TOKEN")
|
|
5
|
+
npm whoami
|
|
6
|
+
npm i
|
|
7
|
+
chown root:root .
|
|
8
|
+
npm run package
|
|
9
|
+
filename="$(npm pack --dry-run | tail -n 1)"
|
|
10
|
+
echo "$1"
|
|
11
|
+
|
|
12
|
+
if [[ "$1" == "qa" ]] || [[ "$1" == "master" ]] || [[ "$1" == "staging" ]] || [[ "$1" == "staging-app2" ]]
|
|
13
|
+
then
|
|
14
|
+
npm publish $filename --registry=https://registry.npmjs.org/
|
|
15
|
+
else
|
|
16
|
+
npm publish --tag beta $filename --registry=https://registry.npmjs.org/
|
|
17
|
+
fi
|
|
18
|
+
|
|
19
|
+
echo "$filename package pushed to NPM successfully"
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
let fs = require('fs');
|
|
2
|
+
let path = require('path');
|
|
3
|
+
|
|
4
|
+
let token = '';
|
|
5
|
+
|
|
6
|
+
process.argv.forEach(function(val, index, array) {
|
|
7
|
+
if (index == 2) token = val;
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
let registry = '//registry.npmjs.org/';
|
|
11
|
+
|
|
12
|
+
var configPath = configPath ? configPath : path.join(__dirname, '../', '.npmrc');
|
|
13
|
+
|
|
14
|
+
fs.writeFile(configPath, `${registry}:_authToken=${token}` + '\n', (err, message) => { if(err){ console.log(err , message)}});
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oncehub/eslint-config",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.3",
|
|
4
4
|
"description": "ESLint configuration for micro-services built using Node.js and TypeScript",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
8
|
+
"package": "npm pack"
|
|
8
9
|
},
|
|
9
10
|
"author": "Rajat Saxena <rajat.saxena@oncehub.com>",
|
|
10
11
|
"license": "ISC",
|