-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJenkinsfile
More file actions
69 lines (67 loc) · 2.08 KB
/
Copy pathJenkinsfile
File metadata and controls
69 lines (67 loc) · 2.08 KB
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
pipeline {
environment{
imageName = ''
}
agent any
stages {
stage('Git'){
steps{
git 'https://github.com/printSamarth/ExpenseTracker'
}
}
stage('Clean') {
steps {
sh './gradlew --refresh-dependencies clean'
}
}
stage('Build'){
steps{
sh './gradlew assembleDebug'
archiveArtifacts '**/app-debug.apk'
}
}
stage('Install for testing'){
steps{
sh './gradlew installDebug'
}
}
stage('Testing'){
steps{
sh './gradlew connectedDebugAndroidTest'
}
}
stage('Docker build to Image') {
steps {
script{
imageName = docker.build "ssvapp/expense-tracker:latest"
}
}
}
stage('Push Docker Image to DockerHub') {
steps {
script{
docker.withRegistry('','7fd7ec98-6ea4-4c67-9d94-a9cfdb4592c6')
{
imageName.push()
}
}
}
}
stage('Pull Docker Image') {
steps {
ansiblePlaybook becomeUser: null, colorized: true, disableHostKeyChecking: true,
installation: 'Ansible', inventory: 'deploy-docker/inventory',
playbook: 'deploy-docker/deploy-image.yml', sudoUser: null
}
}
stage('DISTRIBUTE') {
steps {
appCenter apiToken: '92a01f4cb9c3bb7a57de2984bde44c67b00f5979',
ownerName: 'ssvapp',
appName: 'ExpenseTracker',
pathToApp: '**/app-debug.apk',
distributionGroups: 'tester'
}
}
}
}