This repository has been archived by the owner on Sep 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathJenkinsfile.upload
67 lines (62 loc) · 2.56 KB
/
Jenkinsfile.upload
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
#!/bin/env groovy
@Library(['cliqz-shared-library@v1.2', 'browser-android@automation']) _
properties([
parameters([
booleanParam(name: 'CLIQZ', defaultValue: false, description: 'Builds and uploads the Cliqz brand to Play Store. If False, the Ghostery Brand.')
])
])
node('master') {
def dockerTag = ""
stage('Checkout') {
checkout scm
dockerTag = readFile('mozilla-release/browser/config/version.txt').trim()
}
def baseImageName = "browser-f/android:${dockerTag}"
baseImage = stage('Build base image') {
docker.build(baseImageName, '--build-arg USER=`whoami` --build-arg UID=`id -u` --build-arg GID=`id -g` -f Dockerfile .')
}
baseImage.inside() {
try {
def apk = ""
def brand = (params.CLIQZ) ? "cliqz" : "ghostery"
stage('Build and Signs APKS') {
cliqz.buildCliqzReactNative("cliqz")
withCredentials([
file(credentialsId: 'd746a1dd-e075-4844-869a-32116a496352', variable: 'CERT_PATH' ),
string(credentialsId: 'b7422020-fe1b-4c57-9230-f3d52afee3cf', variable: 'CERT_PASS')
]) {
def archs = [
// ARCH MIN_SDK
// [ "x86_64-linux-android", 21 ],
[ "aarch64-linux-android", 21 ],
// [ "i686-linux-android", 16 ],
[ "arm-linux-androideabi", 19 ] ]
archs.each {
def (arch, minSdk) = it
apk = cliqz.buildBrowser(arch, minSdk, brand, "release")
sh "cp build/${apk} mozilla-release/mobile/android/${apk}"
}
}
}
stage('Upload') {
def storeCert = '81d5a4c2-c504-4d18-a29f-18421bb04ddc'
if (params.CLIQZ){
storeCert = '2939d2e1-dd9a-4097-adc2-430e3d67157a'
}
archiveArtifacts allowEmptyArchive: true, artifacts: "build/*"
utils.fastlaneRelease(
"${brand}",
'd746a1dd-e075-4844-869a-32116a496352',
'b7422020-fe1b-4c57-9230-f3d52afee3cf',
storeCert
)
}
}
finally {
stage('Clean Up') {
utils.cleanUp()
sh 'rm -rf mozilla-release/mobile/android/*.apk'
}
}
}
}