Skip to content

Commit 885ee53

Browse files
Sayaan SahaMaitreyaBuddha
authored andcommitted
Create CI/CD pipeline base tools
1 parent dfcb12c commit 885ee53

File tree

3 files changed

+60
-0
lines changed

3 files changed

+60
-0
lines changed

Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM jangrewe/gitlab-ci-android
2+
3+
RUN apt-get update && \
4+
apt-get install -y --no-install-recommends \
5+
build-essential \
6+
&& rm -rf /var/lib/apt/lists/*

Makefile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
####################################################################
2+
#
3+
# Rules used to build and release the SDK.
4+
#
5+
####################################################################
6+
7+
SDK_BUILD_IMAGE:=leanplum/android-sdk-build:latest
8+
DOCKER_RUN:=docker run \
9+
--tty --interactive --rm \
10+
--volume `pwd`:/leanplum \
11+
--workdir /leanplum \
12+
${SDK_BUILD_IMAGE}
13+
14+
clean-local-properties:
15+
rm -f local.properties
16+
17+
sdk: clean-local-properties
18+
./gradlew clean assembleDebug testDebugUnitTest --info
19+
20+
sdk-in-container:
21+
${DOCKER_RUN} make sdk
22+
23+
shell:
24+
${DOCKER_RUN} bash
25+
26+
build-image:
27+
docker build -t ${SDK_BUILD_IMAGE} .
28+
docker push ${SDK_BUILD_IMAGE}
29+
30+
.PHONY: build

jenkins/pipeline.groovy

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/**
2+
* Jenkins pipeline for Build and Test of Android SDK.
3+
*/
4+
5+
pipeline {
6+
agent { label 'base-lp-agent'}
7+
stages {
8+
stage("Build and Test the SDK") {
9+
steps {
10+
timestamps {
11+
ansiColor('xterm') {
12+
buildAndTest()
13+
}
14+
}
15+
}
16+
}
17+
}
18+
}
19+
20+
def buildAndTest() {
21+
withDockerContainer(args: "", image: "leanplum/android-sdk-build") {
22+
sh 'make sdk'
23+
}
24+
}

0 commit comments

Comments
 (0)