Skip to content

Commit

Permalink
Create new startup scripts (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
lwander committed Feb 2, 2017
1 parent e039925 commit fcc6b26
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
19 changes: 19 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,22 @@ subprojects { project ->
}

defaultTasks ':halyard-web:bootRun'

// Creates scripts for entry points
// Subproject must apply application plugin to be able to call this method.
def createScript(project, mainClass, name) {
project.tasks.create(name: name, type: CreateStartScripts) {
outputDir = new File(project.buildDir, 'scripts')
mainClassName = mainClass
applicationName = name
classpath = project.tasks[JavaPlugin.JAR_TASK_NAME].outputs.files + project.configurations.runtime
}
project.tasks[name].dependsOn(project.jar)

project.applicationDistribution.with {
into("bin") {
from(project.tasks[name])
fileMode = 0755
}
}
}
7 changes: 7 additions & 0 deletions halyard-web/halyard-web.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
apply plugin: 'spring-boot'
apply plugin: 'spinnaker.package'
apply plugin: 'application'

ext {
springConfigLocation = System.getProperty('spring.config.location', "${System.getProperty('user.home')}/.spinnaker/")
Expand Down Expand Up @@ -27,3 +28,9 @@ dependencies {
}

tasks.bootRepackage.enabled = project.repackage

startScripts.enabled = false
run.enabled = false

createScript(project, 'com.netflix.spinnaker.halyard.cli.Main', 'hal')
createScript(project, 'com.netflix.spinnaker.halyard.Main', 'halyard')

0 comments on commit fcc6b26

Please sign in to comment.