-
Notifications
You must be signed in to change notification settings - Fork 35
/
Jenkinsfile.publish
110 lines (98 loc) · 3.17 KB
/
Jenkinsfile.publish
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
#!/bin/env groovy
node('docker') {
stage('checkout') {
checkout scm
}
def helpers = load 'build-helpers.groovy'
def imgName = "cliqz/navigation-extension:${env.BUILD_TAG}"
stage('docker build') {
sh "docker build -t ${imgName} --build-arg UID=`id -u` --build-arg GID=`id -g` ."
dockerFingerprintFrom dockerfile: './Dockerfile', image: imgName, toolName: env.DOCKER_TOOL_NAME
}
withCerts {
docker.image(imgName).inside() {
withEnv(["CLIQZ_CONFIG_PATH=./configs/${CLIQZ_CHANNEL}.js"]) {
helpers.withCache {
stage('fern test') {
sh './fern.js test ./configs/ci/unit-tests.js -l unit-node --ci tests.xml'
}
if (params.CLIQZ_BETA == 'True') {
stage('fern build') {
sh './fern.js build --environment=production'
}
} else {
stage('fern build') {
sh './fern.js build --no-debug --environment=production'
}
}
}
}
stage('checkout xpi-sign') {
checkout([
$class: 'GitSCM',
branches: [[name: '*/cliqz-ci']],
doGenerateSubmoduleConfigurations: false,
extensions: [[
$class: 'RelativeTargetDirectory',
relativeTargetDir: 'xpi-sign'
]],
submoduleCfg: [],
userRemoteConfigs: [[
credentialsId: XPI_SIGN_CREDENTIALS,
url: XPI_SIGN_REPO_URL
]]
])
}
stage('Publish') {
withCredentials([[
$class: 'UsernamePasswordMultiBinding',
credentialsId: '06ec4a34-9d01-46df-9ff8-64c79eda8b14',
passwordVariable: 'AWS_SECRET_ACCESS_KEY',
usernameVariable: 'AWS_ACCESS_KEY_ID'],
usernamePassword(
credentialsId: '774bccf1-ae66-41e1-9f2e-f8efb4bedc21',
passwordVariable: 'BALROG_PASSWORD',
usernameVariable: 'BALROG_ADMIN')
]) {
withEnv(["CLIQZ_CONFIG_PATH=./configs/${CLIQZ_CHANNEL}.js"]) {
helpers.withCache {
sh './fern.js pack'
def output = sh(
returnStdout: true,
script: './fern.js publish',
).trim()
echo output
}
}
}
}
// NOTE: doc generation has been broken for a while. Let's keep it
// disabled until someone has time to fix it properly.
// if (env.BRANCH_NAME == 'master') {
// stage('upload docs') {
// withCredentials([[
// $class: 'UsernamePasswordMultiBinding',
// credentialsId: '06ec4a34-9d01-46df-9ff8-64c79eda8b14',
// passwordVariable: 'AWS_SECRET_ACCESS_KEY',
// usernameVariable: 'AWS_ACCESS_KEY_ID']]) {
// def s3DocPath = 's3://internal.clyqz.com/docs/browser-core'
// sh "aws s3 rm $s3DocPath --recursive"
// sh "aws s3 cp docs $s3DocPath --recursive"
// }
// }
// }
}
}
}
def withCerts(Closure body) {
def cleanup = {
sh 'rm -rf certs'
}
try {
cleanup()
sh 'cp -R /cliqz certs'
body()
} finally {
cleanup()
}
}