-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathcron.jenkinsfile
41 lines (41 loc) · 1.48 KB
/
cron.jenkinsfile
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
pipeline {
agent any
stages {
stage('Run') {
agent any
options {
timestamps()
ansiColor('xterm')
}
environment {
JENKINS = credentials('jenkins_user_token') // user name and password
GITHUB_TOKEN = credentials('ci_analyzer_github_token') // secret text
CIRCLECI_TOKEN = credentials('ci_analyzer_circleci_token') // secret text
SERVICE_ACCOUNT = credentials('ci_analyzer_service_account') // secret file
CONFIG_FILE_PATH = credentials('ci_analyzer_cron_config') // secret text
CUSTOM_SCHEMA_DIR_PATH = credentials('ci_analyzer_custom_schema_dir') // secret text
}
steps {
sh '''
docker pull ghcr.io/kesin11/ci_analyzer:master
docker run \
--mount type=bind,src=${WORKSPACE},dst=/app/ \
--mount type=bind,src=${SERVICE_ACCOUNT},dst=/service_account.json \
--mount type=bind,src=${CONFIG_FILE_PATH},dst=/app/ci_analyzer.yaml \
--mount type=bind,src=${CUSTOM_SCHEMA_DIR_PATH},dst=/app/custom_schema \
-e GITHUB_TOKEN=${GITHUB_TOKEN} \
-e CIRCLECI_TOKEN=${CIRCLECI_TOKEN} \
-e JENKINS_USER=${JENKINS_USR} \
-e JENKINS_TOKEN=${JENKINS_PSW} \
-e GOOGLE_APPLICATION_CREDENTIALS=/service_account.json \
ghcr.io/kesin11/ci_analyzer:master
'''
}
post {
always {
archiveArtifacts artifacts: 'output/**/*'
}
}
}
}
}