Skip to content

Commit b67a632

Browse files
Build and archive release artifacts (#269)
For CI on Jenkins
1 parent 4a79559 commit b67a632

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ DOCKER_RUN:=docker run \
1414
clean-local-properties:
1515
rm -f local.properties
1616

17+
GRADLE_COMMANDS:=assembleRelease testReleaseUnitTest generatePomFileForAarPublication
1718
sdk: clean-local-properties
18-
gradle clean assembleDebug testDebugUnitTest --info
19+
gradle clean ${GRADLE_COMMANDS} --debug
1920

2021
sdk-in-container:
2122
${DOCKER_RUN} make sdk
@@ -25,6 +26,5 @@ shell:
2526

2627
build-image:
2728
docker build -t ${SDK_BUILD_IMAGE} . -f Tools/jenkins/build.dockerfile
28-
docker push ${SDK_BUILD_IMAGE}
2929

3030
.PHONY: build

Tools/jenkins/build.dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ RUN apt-get update && \
88

99
################################ Gradle Installation ################################
1010
# Allow the host to use gradle cache, otherwise gradle will always download plugins & artifacts.
11-
VOLUME ["/root/.gradle/caches/"]
11+
VOLUME ["/root/.gradle/"]
12+
VOLUME ["/root/.android/"]
1213

1314
ARG GRADLE_VERSION=4.10
1415
ARG GRADLE_ZIP=gradle-${GRADLE_VERSION}-bin.zip

Tools/jenkins/pipelines/ci.groovy

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ pipeline {
1414
}
1515
}
1616
}
17+
stage('Archive artifacts') {
18+
steps {
19+
timestamps {
20+
ansiColor('xterm') {
21+
archiveFiles()
22+
}
23+
}
24+
}
25+
}
1726
}
1827
}
1928

@@ -25,3 +34,9 @@ def buildAndTest() {
2534
sh 'make sdk'
2635
}
2736
}
37+
38+
def archiveFiles() {
39+
archiveArtifacts('*/build/**/*.aar')
40+
archiveArtifacts('*/build/intermediates/packaged-classes/release/classes.jar')
41+
archiveArtifacts('*/build/publications/aar/pom-default.xml')
42+
}

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
buildscript {
33
repositories {
44
mavenCentral()
5-
jcenter()
65
google()
6+
jcenter()
77
}
88
dependencies {
99
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.4.12'
@@ -14,11 +14,11 @@ buildscript {
1414
allprojects {
1515
repositories {
1616
mavenCentral()
17-
jcenter()
1817
google()
1918
maven {
2019
url "https://repo.leanplum.com/"
2120
}
21+
jcenter()
2222
}
2323
}
2424

0 commit comments

Comments
 (0)