-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added --release flag to packer build tools.
When using the --release flag, we build a public image. This is to be consumed by regular users who aren't interested in custom amis. Closes #164
- Loading branch information
1 parent
ecd7b6a
commit 6bcb589
Showing
10 changed files
with
66 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 6 additions & 1 deletion
7
src/main/kotlin/com/rustyrazorblade/easycasslab/commands/BuildBaseImage.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
package com.rustyrazorblade.easycasslab.commands | ||
|
||
import com.beust.jcommander.Parameters | ||
import com.beust.jcommander.ParametersDelegate | ||
import com.rustyrazorblade.easycasslab.Context | ||
import com.rustyrazorblade.easycasslab.commands.delegates.ReleaseFlag | ||
import com.rustyrazorblade.easycasslab.containers.Packer | ||
|
||
@Parameters(commandDescription = "Build the base image.") | ||
class BuildBaseImage(val context: Context) : ICommand { | ||
@ParametersDelegate | ||
var releaseFlag = ReleaseFlag() | ||
|
||
override fun execute() { | ||
val packer = Packer(context) | ||
|
||
packer.build("base.pkr.hcl") | ||
packer.build("base.pkr.hcl", releaseFlag) | ||
} | ||
} |
7 changes: 6 additions & 1 deletion
7
src/main/kotlin/com/rustyrazorblade/easycasslab/commands/BuildCassandraImage.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
package com.rustyrazorblade.easycasslab.commands | ||
|
||
import com.beust.jcommander.Parameters | ||
import com.beust.jcommander.ParametersDelegate | ||
import com.rustyrazorblade.easycasslab.Context | ||
import com.rustyrazorblade.easycasslab.commands.delegates.ReleaseFlag | ||
import com.rustyrazorblade.easycasslab.containers.Packer | ||
|
||
@Parameters(commandDescription = "Build the Cassandra image.") | ||
class BuildCassandraImage(val context: Context) : ICommand { | ||
@ParametersDelegate | ||
var releaseFlag = ReleaseFlag() | ||
|
||
override fun execute() { | ||
val packer = Packer(context) | ||
packer.build("cassandra.pkr.hcl") | ||
packer.build("cassandra.pkr.hcl", releaseFlag) | ||
} | ||
} |
13 changes: 11 additions & 2 deletions
13
src/main/kotlin/com/rustyrazorblade/easycasslab/commands/BuildImage.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,22 @@ | ||
package com.rustyrazorblade.easycasslab.commands | ||
|
||
import com.beust.jcommander.Parameters | ||
import com.beust.jcommander.ParametersDelegate | ||
import com.rustyrazorblade.easycasslab.Context | ||
import com.rustyrazorblade.easycasslab.commands.delegates.ReleaseFlag | ||
import com.rustyrazorblade.easycasslab.containers.Packer | ||
|
||
@Parameters(commandDescription = "Build both the base and Cassandra image.") | ||
class BuildImage(val context: Context) : ICommand { | ||
@ParametersDelegate | ||
var releaseFlag = ReleaseFlag() | ||
|
||
override fun execute() { | ||
BuildBaseImage(context).execute() | ||
BuildCassandraImage(context).execute() | ||
BuildBaseImage(context) | ||
.apply { this.releaseFlag=this@BuildImage.releaseFlag } | ||
.execute() | ||
BuildCassandraImage(context) | ||
.apply { this.releaseFlag=this@BuildImage.releaseFlag } | ||
.execute() | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/main/kotlin/com/rustyrazorblade/easycasslab/commands/delegates/ReleaseFlag.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.rustyrazorblade.easycasslab.commands.delegates | ||
|
||
import com.beust.jcommander.Parameter | ||
|
||
class ReleaseFlag { | ||
@Parameter(description = "Release flag", names = ["--release"]) | ||
var release: Boolean = false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters