Skip to content

Commit c918994

Browse files
authored
Add Travis deployment script (#312)
1 parent 660b6a2 commit c918994

File tree

4 files changed

+25
-9
lines changed

4 files changed

+25
-9
lines changed

.travis.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,13 @@ cache:
3333

3434
script:
3535
- make gradlewTravis
36+
37+
after_success:
38+
- make releaseArtifacts
39+
40+
deploy:
41+
- provider: script
42+
script: ./Tools/deploy.py
43+
on:
44+
tags: true
45+

AndroidSDKTests/src/test/java/com/leanplum/internal/BuildConfigTest.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ public class BuildConfigTest extends AbstractTest {
3535
*/
3636
@Test
3737
public void testVersion() {
38-
String[] parts = Constants.LEANPLUM_VERSION.split("\\.");
38+
String version = Constants.LEANPLUM_VERSION;
39+
40+
String[] parts = version.split("\\.");
3941

4042
assertEquals(4, parts.length);
4143
// Ensure we can parse and do not go down in major version.
@@ -45,11 +47,14 @@ public void testVersion() {
4547
// Ensure minor and patch versions are parseable.
4648
int minor = Integer.parseInt(parts[1]);
4749
assert(minor >= 0);
48-
int patch = Integer.parseInt(parts[2]);
49-
assert(patch >= 0);
5050

51-
// Ensure build number propagates.
52-
int build = Integer.parseInt(parts[3]);
53-
assert(build >= 0);
51+
if (!isBeta(version)) {
52+
int patch = Integer.parseInt(parts[2]);
53+
assert(patch >= 0);
54+
}
55+
}
56+
57+
private boolean isBeta(String version) {
58+
return version.contains("beta");
5459
}
5560
}

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ patchReleaseBranch:
4141
releaseArtifacts: releaseBinaries releasePoms
4242

4343
releaseBinaries:
44-
${DOCKER_RUN} gradle assembleRelease
44+
./gradlew assembleRelease
4545

4646
releasePoms:
47-
${DOCKER_RUN} gradle generatePomFileForAarPublication
47+
./gradlew generatePomFileForAarPublication
4848

4949
deployArtifacts:
5050
./Tools/deploy.py

Tools/deploy.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ def deployArtifacts(localPath, artifactoryPath, bintrayPath):
7474

7575

7676
def artifactoryDeploy(source, destination):
77-
command = "jfrog rt u " + source + " " + destination
77+
flags = "--url=https://artifactory.leanplum.com --apikey=os.environ['JFROG_CLI_API_KEY']"
78+
command = "jfrog rt u " + source + " " + destination + " " + flags
7879
# print command
7980
os.system(command)
8081

0 commit comments

Comments
 (0)