Skip to content
This repository has been archived by the owner on May 30, 2018. It is now read-only.

Commit

Permalink
⬆️ refactor variables
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewhartstonge committed Apr 28, 2017
1 parent 0db6562 commit a19334c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
3 changes: 2 additions & 1 deletion build.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@ECHO OFF
SET ISO_MD5_CHECKSUM=b0e3e198a12a2ae8efe89f5167655879
SET VM_DESCRIPTION=A simplified Linux distribution built from containers, for containers
SET VM_VERSION=1.0.0
packer build -force -var "vm_description=%VM_DESCRIPTION%" -var "vm_version=%VM_VERSION%" "packer_rancheros.json"
packer build -force -var "vm_description=%VM_DESCRIPTION%" -var "vm_version=%VM_VERSION%" -var "iso_md5_checksum=%ISO_MD5_CHECKSUM%" "packer_rancheros.json"
4 changes: 3 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/usr/bin/env bash
iso_md5_checksum='b0e3e198a12a2ae8efe89f5167655879'
vm_description='A simplified Linux distribution built from containers, for containers'
vm_version='1.0.0'
packer build \
-var "iso_md5_checksum=${iso_md5_checksum}" \
-var "vm_description=${vm_description}" \
-var "vm_version=${vm_version}" \
-var "vm_version=${vm_version}" \
"packer_rancheros.json"
25 changes: 15 additions & 10 deletions packer_rancheros.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{
"variables": {
"vm_description": "",
"vm_version": ""
"iso_md5_checksum": "b0e3e198a12a2ae8efe89f5167655879",
"version_prerelease_suffix": "",
"vm_description": "A simplified Linux distribution built from containers, for containers",
"vm_version": "1.0.0"
},
"builders": [
{
"type": "virtualbox-iso",
"guest_os_type": "Linux26_64",
"iso_url": "https://releases.rancher.com/os/v1.0.0/rancheros.iso",
"iso_checksum": "b0e3e198a12a2ae8efe89f5167655879",
"iso_url": "https://releases.rancher.com/os/v{{ user `vm_version` }}/rancheros.iso",
"iso_checksum": "{{user `iso_md5_checksum` }}",
"iso_checksum_type": "md5",
"guest_additions_mode": "disable",
"ssh_private_key_file": "./keys/vagrant",
Expand All @@ -21,9 +23,9 @@
"disk_size": "24000",
"boot_wait": "30s",
"boot_command": [
"echo \"#cloud-config \" >> cloud-config.yml<enter>",
"echo \"ssh_authorized_keys: \" >> cloud-config.yml<enter>",
"echo \" - ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key \" >> cloud-config.yml<enter>",
"echo \"#cloud-config\" >> cloud-config.yml<enter>",
"echo \"ssh_authorized_keys:\" >> cloud-config.yml<enter>",
"echo \" - ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key\" >> cloud-config.yml<enter>",
"sudo ros install -c cloud-config.yml -d /dev/sda<enter>",
"y<enter>",
"<wait5>",
Expand All @@ -35,7 +37,7 @@
"--manifest",
"--vsys", "0",
"--description", "{{user `vm_description`}}",
"--version", "{{user `vm_version`}}.alpha1"
"--version", "{{user `vm_version`}}{{user `version_prerelease_suffix` }}"
],
"vboxmanage": [
[
Expand Down Expand Up @@ -69,9 +71,12 @@
"artifact_type": "vagrant.box",
"metadata": {
"provider": "virtualbox",
"version": "{{user `vm_version`}}.alpha1"
"version": "{{user `vm_version`}}{{user `version_prerelease_suffix`}}"
}
}
]
]
],
"push": {
"name": "MatthewHartstonge/RancherOS"
}
}

0 comments on commit a19334c

Please sign in to comment.