-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
50 lines (47 loc) · 1.44 KB
/
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
42
43
44
45
46
47
48
49
50
pipeline {
agent {
node {
label 'linux-agent'
}
}
stages {
stage('Fetch Sources') {
steps {
cleanWs()
git branch: 'main', url: '[email protected]:kingcobra2468/Homing.git'
}
}
stage('Setup Environment') {
steps {
dir('app/') {
withCredentials([file(credentialsId: 'homing-google-services', variable: 'GOOGLE_SERVICES')]) {
sh '''#!/bin/bash
cp \$GOOGLE_SERVICES google-services.json
'''
}
}
}
}
stage('Build APK') {
steps {
sh '''#!/bin/bash
docker run --rm -v `pwd`:/project mingc/android-build-box bash \\
-c "cd /project; ./gradlew build; chown -R \"$(id -u):$(id -g)\" app/build/"
'''
dir('app/build/outputs/apk/') {
sh '''#!/bin/bash
mv release/app-release-unsigned.apk release/homing-release-unsigned.apk
mv debug/app-debug.apk debug/homing-debug.apk
'''
}
}
}
}
post {
success {
dir('app/build/outputs/apk/') {
archiveArtifacts artifacts: '**/*.apk', fingerprint: true
}
}
}
}