forked from ghostery/browser-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile.uploadghostery
120 lines (117 loc) · 5.74 KB
/
Jenkinsfile.uploadghostery
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
111
112
113
114
115
116
117
118
119
120
#!/bin/env groovy
node('master') {
def dockerTag = ""
stage('Checkout') {
checkout scm
dockerTag = readFile('mozilla-release/browser/config/version_display.txt').trim()
}
def baseImageName = "browser-f/android:${dockerTag}"
baseImage = stage('Build base image') {
docker.build(baseImageName, '--build-arg UID=`id -u` --build-arg GID=`id -g` -f Dockerfile .')
}
baseImage.inside() {
try {
stage('Build and Signs APKS') {
withEnv(['ANDROID_TARGET=i686-linux-android', 'BRAND=ghostery', 'CLIQZ_CHANNEL=MA50']) {
sh '''#!/bin/bash -l
set -e
set -x
cd mozilla-release
cp ../mozconfigs/deploy.mozconfig mozconfig
./mach clobber
./mach build
export MOZ_CHROME_MULTILOCALE="de fr ru"
for AB_CD in $MOZ_CHROME_MULTILOCALE; do
./mach build chrome-$AB_CD
done
export AB_CD=multi
./mach package
'''
withCredentials([
file(credentialsId: 'd746a1dd-e075-4844-869a-32116a496352', variable: 'CERT_PATH' ),
string(credentialsId: 'b7422020-fe1b-4c57-9230-f3d52afee3cf', variable: 'CERT_PASS')
]) {
sh """#!/bin/bash -l
set -e
set -x
cd mozilla-release
export MOZ_CHROME_MULTILOCALE="de fr ru"
export AB_CD=multi
./gradlew assembleOfficialWithGeckoBinariesNoMinApiPhotonRelease
"""
}
apk = sh(returnStdout: true,
script: """cd mozilla-release/objdir-frontend-android/${BRAND}/gradle/build/mobile/android/app/outputs/apk/officialWithGeckoBinariesNoMinApiPhoton/release && \
find *.apk -name '*-release*' -not -name '*-unsigned-*'""").trim()
def apkPath = "mozilla-release/objdir-frontend-android/${BRAND}/gradle/build/mobile/android/app/outputs/apk/officialWithGeckoBinariesNoMinApiPhoton/release/${apk}"
sh """#!/bin/bash -l
set -e
set -x
cp ${apkPath} mozilla-release/mobile/android/x86.apk
"""
}
withEnv(['ANDROID_TARGET=arm-linux-androideabi', 'BRAND=ghostery', 'CLIQZ_CHANNEL=MA50']) {
sh '''#!/bin/bash -l
set -e
set -x
cd mozilla-release
cp ../mozconfigs/deploy.mozconfig mozconfig
./mach clobber
./mach build
export MOZ_CHROME_MULTILOCALE="de fr ru"
for AB_CD in $MOZ_CHROME_MULTILOCALE; do
./mach build chrome-$AB_CD
done
export AB_CD=multi
./mach package
'''
withCredentials([
file(credentialsId: 'd746a1dd-e075-4844-869a-32116a496352', variable: 'CERT_PATH' ),
string(credentialsId: 'b7422020-fe1b-4c57-9230-f3d52afee3cf', variable: 'CERT_PASS')
]) {
sh """#!/bin/bash -l
set -e
set -x
cd mozilla-release
export MOZ_CHROME_MULTILOCALE="de fr ru"
export AB_CD=multi
./gradlew assembleOfficialWithGeckoBinariesNoMinApiPhotonRelease
"""
}
apk = sh(returnStdout: true,
script: """cd mozilla-release/objdir-frontend-android/${BRAND}/gradle/build/mobile/android/app/outputs/apk/officialWithGeckoBinariesNoMinApiPhoton/release && \
find *.apk -name '*-release*' -not -name '*-unsigned-*'""").trim()
def apkPath = "mozilla-release/objdir-frontend-android/${BRAND}/gradle/build/mobile/android/app/outputs/apk/officialWithGeckoBinariesNoMinApiPhoton/release/${apk}"
sh """#!/bin/bash -l
set -e
set -x
cp ${apkPath} mozilla-release/mobile/android/arm.apk
"""
}
}
stage('Upload') {
withCredentials([
file(credentialsId: 'd746a1dd-e075-4844-869a-32116a496352', variable: 'CERT_PATH'),
string(credentialsId: 'b7422020-fe1b-4c57-9230-f3d52afee3cf', variable: 'CERT_PASS'),
file(credentialsId: '81d5a4c2-c504-4d18-a29f-18421bb04ddc', variable: 'PLAY_STORE_CERT')]) {
sh '''#!/bin/bash -l
set -e
set -x
cd mozilla-release/mobile/android
mv fastlane/Appfile.ghostery fastlane/Appfile
fastlane alpha
'''
}
}
}
finally {
stage('Clean Up') {
sh '''#!/bin/bash -l
rm -f mozilla-release/mozconfig
rm -rf mozilla-release/objdir-frontend-android
rm -f mozilla-release/mobile/android/*.apk
'''
}
}
}
}