Skip to content

Commit

Permalink
Prevent build deploy when version already exist
Browse files Browse the repository at this point in the history
  • Loading branch information
pditommaso committed Jul 9, 2019
1 parent 8b2f826 commit 5fdf87c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
14 changes: 13 additions & 1 deletion build.gradle
Expand Up @@ -270,7 +270,17 @@ ext.deployable << project(':nf-google')

protected error(String message) {
logger.error message
throw new StopExecutionException()
throw new StopExecutionException(message)
}

protected checkVersionExits(String version) {
if(version.endsWith('-SNAPSHOT'))
return

def cmd = "AWS_ACCESS_KEY_ID=${System.env.NXF_AWS_ACCESS} AWS_SECRET_ACCESS_KEY=${System.env.NXF_AWS_SECRET} aws s3 ls s3://www2.nextflow.io/releases/v$version/nextflow"
def status=['bash','-c', cmd].execute().waitFor()
if( status == 0 )
error("STOP!! Version $version already deployed!")
}

protected resolveDeps( String configName, String... x ) {
Expand Down Expand Up @@ -422,6 +432,8 @@ task deploy( type: Exec, dependsOn: [clean, compile, pack, deployable.uploadArch
def files = []

doFirst {
checkVersionExits(version)

def path = new File(releaseDir)
if( !path.exists() ) error("Releases path does not exists: $path")
path.eachFile {
Expand Down
6 changes: 3 additions & 3 deletions modules/nextflow/src/main/groovy/nextflow/Const.groovy
Expand Up @@ -52,17 +52,17 @@ class Const {
/**
* The application version
*/
static public final String APP_VER = "19.06.0-edge"
static public final String APP_VER = "19.07.0-edge"

/**
* The app build time as linux/unix timestamp
*/
static public final long APP_TIMESTAMP = 1561123420338
static public final long APP_TIMESTAMP = 1562672809328

/**
* The app build number
*/
static public final int APP_BUILDNUM = 5099
static public final int APP_BUILDNUM = 5103


/**
Expand Down

0 comments on commit 5fdf87c

Please sign in to comment.