forked from cliqz-oss/browser-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile.publish
80 lines (69 loc) · 1.96 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
#!/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}.json"]) {
helpers.withCache {
stage('fern install') {
sh './fern.js install'
}
stage('fern test') {
sh './fern.js test --ci tests.xml'
}
stage('fern build') {
sh './fern.js build --freshtab --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('fab publish') {
withCredentials([[
$class: 'UsernamePasswordMultiBinding',
credentialsId: '06ec4a34-9d01-46df-9ff8-64c79eda8b14',
passwordVariable: 'AWS_SECRET_ACCESS_KEY',
usernameVariable: 'AWS_ACCESS_KEY_ID']]) {
sh """#!/bin/bash
cd build
fab publish:beta=$CLIQZ_BETA,channel=$CLIQZ_CHANNEL,pre=$CLIQZ_PRE_RELEASE
"""
}
}
}
}
}
def withCerts(Closure body) {
def cleanup = {
sh 'rm -rf certs'
}
try {
cleanup()
sh 'cp -R /cliqz certs'
body()
} finally {
cleanup()
}
}