Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Store different os versions in different output directories.
Browse files Browse the repository at this point in the history
(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.)
  • Loading branch information
purpleidea committed Apr 5, 2014
1 parent 2419569 commit e6f0bc5
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ docs/
hacking/
rpmbuild/
screencasts/
builder/versions/*.sh
10 changes: 5 additions & 5 deletions builder/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand Down
13 changes: 13 additions & 0 deletions builder/versions/template.sh
Original file line number Diff line number Diff line change
@@ -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 $@

2 changes: 1 addition & 1 deletion vagrant/gluster/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

# box source url
# TODO: this box should be GPG signed
config.vm.box_url = 'https://download.gluster.org/pub/gluster/purpleidea/vagrant/centos-6.box'
config.vm.box_url = 'https://download.gluster.org/pub/gluster/purpleidea/vagrant/centos-6/centos-6.box'

#
# cache
Expand Down

0 comments on commit e6f0bc5

Please sign in to comment.