diff options
| author | James Shubin <james@shubin.ca> | 2014-04-04 20:24:44 -0400 |
|---|---|---|
| committer | James Shubin <james@shubin.ca> | 2014-04-04 21:21:10 -0400 |
| commit | e6f0bc559802abae16e06c79062f1910538fbedd (patch) | |
| tree | 3a76c2120b9022680515d3b6c23d106531876d9d /builder | |
| parent | 241956937f9778c332335267fac1256792c71155 (diff) | |
Store different os versions in different output directories.
(I guess this means I'm now a vagrant os image maintainer.)
NOTE: you can create your own personal scripts in builder/versions/ !
(See the template.sh file there for more information.)
Diffstat (limited to 'builder')
| -rw-r--r-- | builder/Makefile | 10 | ||||
| -rwxr-xr-x | builder/versions/template.sh | 13 |
2 files changed, 18 insertions, 5 deletions
diff --git a/builder/Makefile b/builder/Makefile index 11d8286..8c4ab0f 100644 --- a/builder/Makefile +++ b/builder/Makefile @@ -29,9 +29,9 @@ BOX = $(VERSION).box SIZE = 40 #OUTPUT = /tmp/gluster #OUTPUT := $(shell pwd) -OUTPUT := $(shell echo ~/tmp/builder/gluster) -SERVER = 'download.gluster.org' -REMOTE_PATH = 'purpleidea/vagrant' +OUTPUT := $(shell echo ~/tmp/builder/$(VERSION)) +SERVER = 'user@host.example.org' +REMOTE_PATH = 'public_html/vagrant' all: box @@ -134,9 +134,9 @@ $(OUTPUT)/SHA256SUMS.asc: $(OUTPUT)/SHA256SUMS # upload to public server # NOTE: user downloads while file uploads are in progress don't cause problems! upload: $(OUTPUT)/$(BOX) $(OUTPUT)/SHA256SUMS $(OUTPUT)/SHA256SUMS.asc - if [ "`cat $(OUTPUT)/SHA256SUMS`" != "`ssh $(SERVER) 'cd $(REMOTE_PATH)/ && sha256sum $(BOX)'`" ]; then \ + if [ "`cat $(OUTPUT)/SHA256SUMS`" != "`ssh $(SERVER) 'cd $(REMOTE_PATH)/$(VERSION)/ && sha256sum $(BOX)'`" ]; then \ echo Running upload...; \ - scp -p $(OUTPUT)/{$(BOX),SHA256SUMS{,.asc}} $(SERVER):$(REMOTE_PATH)/; \ + scp -p $(OUTPUT)/{$(BOX),SHA256SUMS{,.asc}} $(SERVER):$(REMOTE_PATH)/$(VERSION)/; \ fi # this method works too, but always hits the server on every make call #upload: diff --git a/builder/versions/template.sh b/builder/versions/template.sh new file mode 100755 index 0000000..f78b02c --- /dev/null +++ b/builder/versions/template.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# to use this script, from its parent dir, run: ./versions/<script>.sh <target> +# you'll want to edit the below bash variables to match your use cases :) +# eg: ./versions/centos-6.sh upload +# to make your own base image and upload it to your own server somewhere. + +VERSION='centos-6' # pick from the output of virt-builder -l +SERVER='user@host.example.org' # connect over ssh (add your public key first) +REMOTE_PATH='public_html/vagrant' # make a $VERSION directory in this dir + +make VERSION=$VERSION SERVER=$SERVER REMOTE_PATH=$REMOTE_PATH $@ + |
