Skip to content

Commit

Permalink
Remove packer installation, provide install with config path (#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
lwander authored Mar 3, 2017
1 parent 555f390 commit 92c98c8
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ abstract public class Deployment {
* Deploy a fresh install of Spinnaker. This will fail if Spinnaker is already
* running.
*/
abstract public DeployResult deploy();
abstract public DeployResult deploy(String spinnakerOutputPath);

@Data
public static class DeployResult {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public SpinnakerEndpoints getEndpoints() {
private AccountDeploymentDetails<T> deploymentDetails;

@Override
public DeployResult deploy() {
public DeployResult deploy(String spinnakerOutputPath) {
SpinnakerEndpoints.Services services = getEndpoints().getServices();
DaemonTaskHandler.newStage("Deploying Spinnaker services and dependencies");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public SpinnakerEndpoints getEndpoints() {
}

@Override
public DeployResult deploy() {
public DeployResult deploy(String spinnakerOutputPath) {
DaemonTaskHandler.newStage("Generating install file for Spinnaker debians");

String pinFiles = "";
Expand All @@ -87,7 +87,7 @@ public DeployResult deploy() {

JarResource etcInitResource = new JarResource("/debian/init.sh");
Map<String, String> bindings = new HashMap<>();
bindings.put("spinnaker-artifacts", artifacts);
bindings.put("spinnaker-artifacts", artifacts.replace("deck", "apache2"));
String etcInit = etcInitResource.setBindings(bindings).toString();

DaemonTaskHandler.log("Writing installation file");
Expand All @@ -98,7 +98,7 @@ public DeployResult deploy() {
bindings.put("install-redis", "true");
bindings.put("install-spinnaker", "true");
bindings.put("etc-init", etcInit);
bindings.put("packer-version", "0.12.2"); // TODO(lwander) get this from the BOM dependencies
bindings.put("config-dir", spinnakerOutputPath);

DeployResult result = new DeployResult();
result.setPostInstallScript(installScript.setBindings(bindings).toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public Deployment.DeployResult deploySpinnaker(String deploymentName) {

generateService.atomicWrite(path, generateService.yamlToString(deployment.getEndpoints()));

Deployment.DeployResult result = deployment.deploy();
Deployment.DeployResult result = deployment.deploy(spinnakerOutputPath);

if (!StringUtils.isNullOrEmpty(result.getPostInstallScript())) {
Path installPath = halconfigDirectoryStructure.getInstallScriptPath(deploymentName);
Expand Down
16 changes: 0 additions & 16 deletions halyard-deploy/src/main/resources/debian/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ set -o pipefail
INSTALL_REDIS="{%install-redis%}"
INSTALL_SPINNAKER="{%install-spinnaker%}"
SPINNAKER_ARTIFACTS=({%spinnaker-artifacts%})
PACKER_VERSION="{%packer-version%}"
CONFIG_DIR="{%config-dir%}"

REPOSITORY_URL="https://dl.bintray.com/spinnaker-team/spinnakerbuild"
Expand Down Expand Up @@ -127,17 +126,6 @@ function install_apache2() {
service apache2 start
}

function install_packer() {
TEMPDIR=$(mktemp -d installspinnaker.XXXX)

mkdir $TEMPDIR/packer && pushd $TEMPDIR/packer
curl -s -L -O https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip
unzip -u -o -q packer_${PACKER_VERSION}_linux_amd64.zip -d /usr/bin
popd

rm -rf $TEMPDIR
}

echo "Updating apt package lists..."

if [ -n "$INSTALL_REDIS" ]; then
Expand Down Expand Up @@ -172,8 +160,4 @@ if [ -n "$INSTALL_SPINNAKER" ]; then
if contains "${SPINNAKER_ARTIFACTS[@]}" "deck"; then
install_apache2
fi

if contains "${SPINNAKER_ARTIFACTS[@]}" "rosco"; then
install_packer
fi
fi

0 comments on commit 92c98c8

Please sign in to comment.