Skip to content

Commit

Permalink
Merge pull request #12 from nadavc/master
Browse files Browse the repository at this point in the history
Allow "~" in version name
  • Loading branch information
cfieber committed Feb 2, 2016
2 parents 3b18cf3 + 1f2462a commit 7022e81
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 25 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'nebula.netflixoss' version '2.2.9'
id 'nebula.netflixoss' version '3.1.2'
id 'java'
id 'groovy'
}
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Apr 10 13:50:48 PDT 2015
#Mon Dec 07 15:01:36 PST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip
6 changes: 1 addition & 5 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@ case "`uname`" in
;;
esac

# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
Expand Down Expand Up @@ -114,6 +109,7 @@ fi
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/netflix/frigga/ami/AppVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class AppVersion implements Comparable<AppVersion> {
*/
private static final Pattern APP_VERSION_PATTERN = Pattern.compile(
"([" + NameConstants.NAME_HYPHEN_CHARS
+ "]+)-([0-9.a-zA-Z]+)-(\\w+)(?:[.](\\w+))?(?:\\/([" + NameConstants.NAME_HYPHEN_CHARS + "]+)\\/([0-9]+))?");
+ "]+)-([0-9.a-zA-Z~]+)-(\\w+)(?:[.](\\w+))?(?:\\/([" + NameConstants.NAME_HYPHEN_CHARS + "]+)\\/([0-9]+))?");


private String packageName;
Expand Down
37 changes: 21 additions & 16 deletions src/test/groovy/com/netflix/frigga/ami/AppVersionTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -95,22 +95,27 @@ class AppVersionTest extends Specification {
appVersion.buildJobName == buildJob

where:
appversionString | packageName | version | commit | buildNumber | buildJob
'appName-0.1-9b3bc237.h150' | 'appName' | '0.1' | '9b3bc237' | '150' | null
'appName-0.1-9b3bc237.h150' | 'appName' | '0.1' | '9b3bc237' | '150' | null
'appName-0.1b34-9b3bc237.h150' | 'appName' | '0.1b34' | '9b3bc237' | '150' | null
'appName-0.1-1630379' | 'appName' | '0.1' | '1630379' | null | null
'appName-0.1-1' | 'appName' | '0.1' | '1' | null | null
'appName-0.1-abcd6789' | 'appName' | '0.1' | 'abcd6789' | null | null
'testApp-1.3.0-h196/mybuild/196' | 'testApp' | '1.3.0' | null | '196' | 'mybuild'
'testApp-1.3.0-h196.9b3bc237/mybuild/196' | 'testApp' | '1.3.0' | '9b3bc237' | '196' | 'mybuild'
'sub-1.0.0-586499' | 'sub' | '1.0.0' | '586499' | null | null
'sub-1.0.0-586499.h150' | 'sub' | '1.0.0' | '586499' | '150' | null
'sub-1.0.0-586499.h150/WE-WAPP-sub/150' | 'sub' | '1.0.0' | '586499' | '150' | 'WE-WAPP-sub'
'sub-1.0.0b4-586499.h150/WE-WAPP-sub/150' | 'sub' | '1.0.0b4' | '586499' | '150' | 'WE-WAPP-sub'
'sub-1.0.0b3-586499.h150' | 'sub' | '1.0.0b3' | '586499' | '150' | null
'sub-1.0.0B3-586499.h150' | 'sub' | '1.0.0B3' | '586499' | '150' | null
'sub-1.2-h78.67ee1291/WE-WAPP-sub.nxt/78' | 'sub' | '1.2' | '67ee1291' | '78' | 'WE-WAPP-sub.nxt'
appversionString | packageName | version | commit | buildNumber | buildJob
'appName-0.1-9b3bc237.h150' | 'appName' | '0.1' | '9b3bc237' | '150' | null
'appName-0.1-9b3bc237.h150' | 'appName' | '0.1' | '9b3bc237' | '150' | null
'appName-0.1b34-9b3bc237.h150' | 'appName' | '0.1b34' | '9b3bc237' | '150' | null
'appName-0.1-1630379' | 'appName' | '0.1' | '1630379' | null | null
'appName-0.1-1' | 'appName' | '0.1' | '1' | null | null
'appName-0.1-abcd6789' | 'appName' | '0.1' | 'abcd6789' | null | null
'appName-0.1~rc.1-1630379' | 'appName' | '0.1~rc.1' | '1630379' | null | null
'appName-0.1~dev.1-9b3bc237.h150' | 'appName' | '0.1~dev.1' | '9b3bc237' | '150' | null
'appName-0.1~dev.3.uncommitted-h0.54f3416' | 'appName' | '0.1~dev.3.uncommitted' | '54f3416' | '0' | null
'testApp-1.3.0-h196/mybuild/196' | 'testApp' | '1.3.0' | null | '196' | 'mybuild'
'testApp-1.3.0-h196.9b3bc237/mybuild/196' | 'testApp' | '1.3.0' | '9b3bc237' | '196' | 'mybuild'
'testApp-1.3.0~dev.5.uncommitted-h196.9b3bc237/mybuild/196' | 'testApp' | '1.3.0~dev.5.uncommitted' | '9b3bc237' | '196' | 'mybuild'
'sub-1.0.0-586499' | 'sub' | '1.0.0' | '586499' | null | null
'sub-1.0.0-586499.h150' | 'sub' | '1.0.0' | '586499' | '150' | null
'sub-1.0.0-586499.h150/WE-WAPP-sub/150' | 'sub' | '1.0.0' | '586499' | '150' | 'WE-WAPP-sub'
'sub-1.0.0b4-586499.h150/WE-WAPP-sub/150' | 'sub' | '1.0.0b4' | '586499' | '150' | 'WE-WAPP-sub'
'sub-1.0.0b3-586499.h150' | 'sub' | '1.0.0b3' | '586499' | '150' | null
'sub-1.0.0B3-586499.h150' | 'sub' | '1.0.0B3' | '586499' | '150' | null
'sub-1.2~rc.2-h78.67ee1291/WE-WAPP-sub.nxt/78' | 'sub' | '1.2~rc.2' | '67ee1291' | '78' | 'WE-WAPP-sub.nxt'
'sub-1.2-h78.67ee1291/WE-WAPP-sub.nxt/78' | 'sub' | '1.2' | '67ee1291' | '78' | 'WE-WAPP-sub.nxt'
}

boolean assertIsLessThan(AppVersion lesser, AppVersion greater) {
Expand Down

0 comments on commit 7022e81

Please sign in to comment.