-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use different Jenkinsfiles for different build types
- Loading branch information
Showing
5 changed files
with
93 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,3 +46,6 @@ captures/ | |
|
||
# Keystore files | ||
*.jks | ||
|
||
# Editor Save Files | ||
.*.swp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
def assemble() { | ||
sh './gradlew assemble' | ||
} | ||
|
||
def archive() { | ||
archiveArtifacts artifacts: 'app/build/outputs/apk/*.apk', fingerprint: true | ||
stash includes: 'app/build/outputs/apk/*.apk', name: 'built-apk' | ||
} | ||
|
||
def lint() { | ||
sh './gradlew lint' | ||
androidLint canComputeNew: false, canRunOnFailed: true, defaultEncoding: '', healthy: '', pattern: '**/lint-results*.xml', unHealthy: '' | ||
} | ||
|
||
def publishApkToStore(trackName) | ||
def changeLog = sh(returnStdout: true, script: "./tools/generate-changelog").trim() | ||
|
||
androidApkUpload( | ||
apkFilesPattern: 'app/build/outputs/apk/ie.macinnes.tvheadend_*-release.apk', | ||
googleCredentialsId: 'android-tvheadend', | ||
trackName: $trackName, | ||
recentChangeList: [ | ||
[language: 'en-GB', text: changeLog], | ||
], | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/usr/bin/env groovy | ||
|
||
load 'Jenkinsfile.groovy' | ||
|
||
/* Only keep the 10 most recent builds. */ | ||
def projectProperties = [ | ||
[$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator', numToKeepStr: '5']], | ||
[$class: 'PipelineTriggersJobProperty', triggers: [ | ||
[$class: 'GitHubPushTrigger'] | ||
]], | ||
[$class: 'DisableConcurrentBuildsJobProperty'], | ||
] | ||
|
||
properties(projectProperties) | ||
|
||
node ('android-slave'){ | ||
stage('Preparation') { | ||
step([$class: 'WsCleanup']) | ||
checkout scm | ||
} | ||
stage('Assemble') { | ||
withCredentials([ | ||
[$class: 'FileBinding', credentialsId: 'android-keystore-tvheadend', variable: 'ANDROID_KEYSTORE'], | ||
[$class: 'StringBinding', credentialsId: 'android-keystore-tvheadend-password', variable: 'ANDROID_KEYSTORE_PASSWORD'], | ||
[$class: 'StringBinding', credentialsId: 'acra-report-uri-tvheadend', variable: 'ACRA_REPORT_URI'], | ||
]) { | ||
writeFile file: 'keystore.properties', text: "storeFile=$ANDROID_KEYSTORE\nstorePassword=$ANDROID_KEYSTORE_PASSWORD\nkeyAlias=Kiall Mac Innes\nkeyPassword=$ANDROID_KEYSTORE_PASSWORD\n" | ||
writeFile file: 'acra.properties', text: "report_uri=$ACRA_REPORT_URI\n" | ||
|
||
assemble() | ||
} | ||
} | ||
stage('Lint') { | ||
lint() | ||
} | ||
stage('Archive APK') { | ||
archive() | ||
} | ||
stage('Publish') { | ||
publishApkToStore('beta') | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
git describe --exact-match HEAD &> /dev/null | ||
if [ "$?" == "0" ]; then | ||
THIS_TAG=$(git describe --tags --abbrev=0) | ||
LAST_TAG=$(git describe --tags --abbrev=0 ${THIS_TAG}^) | ||
|
||
git log $LAST_TAG...$THIS_TAG --oneline | grep -v 'Merge pull request' | cut -d' ' -f2- | sed -e 's/^/* /' | ||
|
||
else | ||
LAST_TAG=$(git describe --tags --abbrev=0) | ||
|
||
git log $LAST_TAG...HEAD --oneline | grep -v 'Merge pull request' | cut -d' ' -f2- | sed -e 's/^/* /' | ||
fi |