diff --git a/build.bat b/build.bat index abc11be..060fdb3 100644 --- a/build.bat +++ b/build.bat @@ -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" diff --git a/build.sh b/build.sh index 1c546fd..31dcf99 100644 --- a/build.sh +++ b/build.sh @@ -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" diff --git a/packer_rancheros.json b/packer_rancheros.json index ba927ee..937b906 100644 --- a/packer_rancheros.json +++ b/packer_rancheros.json @@ -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", @@ -21,9 +23,9 @@ "disk_size": "24000", "boot_wait": "30s", "boot_command": [ - "echo \"#cloud-config \" >> cloud-config.yml", - "echo \"ssh_authorized_keys: \" >> cloud-config.yml", - "echo \" - ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key \" >> cloud-config.yml", + "echo \"#cloud-config\" >> cloud-config.yml", + "echo \"ssh_authorized_keys:\" >> cloud-config.yml", + "echo \" - ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key\" >> cloud-config.yml", "sudo ros install -c cloud-config.yml -d /dev/sda", "y", "", @@ -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": [ [ @@ -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" + } }