File tree Expand file tree Collapse file tree 7 files changed +165
-8
lines changed
Expand file tree Collapse file tree 7 files changed +165
-8
lines changed Original file line number Diff line number Diff line change 1+ TAG := $(shell git describe --tags)
2+ LAST_TAG := $(shell git describe --tags --abbrev=0)
3+ NEW_TAG := $(shell echo $(LAST_TAG ) | perl -lpe 's/v//; $$_ += 0.01; $$_ = sprintf("v% .2f", $$_) ')
4+
5+ snapshot-manager :
6+ @go version
7+ go install -v ./...
8+
9+ test : snapshot-manager
10+ go test ./...
11+
12+ doc : snapshot-manager.1 README.html README.txt
13+
14+ snapshot-manager.1 : README.md Makefile
15+ pandoc -M " title=SNAPSHOT-MANAGER(1)" -M " date=" ` date -Id` -M " author=Memset Ltd" -s --from markdown --to man README.md -o snapshot-manager.1
16+
17+ README.html : README.md Makefile
18+ pandoc -s --from markdown_github --to html README.md -o README.html
19+
20+ README.txt : README.md Makefile
21+ pandoc -s --from markdown_github --to plain README.md -o README.txt
22+
23+ install : snapshot-manager
24+ install -d ${DESTDIR} /usr/bin
25+ install -t ${DESTDIR} /usr/bin ${GOPATH} /bin/snapshot-manager
26+
27+ clean :
28+ go clean ./...
29+ find . -name \* ~ | xargs -r rm -f
30+ rm -rf build
31+ rm -f snapshot-manager snapshot-manager.1 README.html README.txt
32+
33+ .PHONY : upload
34+
35+ upload :
36+ ./upload $(TAG )
37+
38+ cross : doc
39+ ./cross-compile $(TAG )
40+
41+ tag :
42+ @echo " Old tag is $( LAST_TAG) "
43+ @echo " New tag is $( NEW_TAG) "
44+ echo -e " package main\n const Version = \" $( NEW_TAG) \" \n" | gofmt > version.go
45+ git tag $(NEW_TAG )
46+ @echo " Add this to changelog in README.md"
47+ @echo " * $( NEW_TAG) -" ` date -I`
48+ @git log $(LAST_TAG ) ..$(NEW_TAG ) --oneline
49+ @echo " Then commit the changes"
50+ @echo git commit -m " Version $( NEW_TAG) " -a -v
51+ @echo " And finally run make retag before make cross etc"
52+
53+ retag :
54+ git tag -f $(LAST_TAG )
Original file line number Diff line number Diff line change 11Snapshot Manager
22================
33
4- [ ![ Logo] ( http://rclone.org/img/rclone-120x120.png )] ( http://rclone.org/ )
5-
64Snapshot Manager is a command line program to manage Memset Miniserver snapshots.
75
86See the [ Memset snapshot
@@ -25,7 +23,7 @@ Snapshot Manager is a Go program and comes as a single binary file.
2523
2624Download the binary for your OS from
2725
28- * http ://snapshot-manager.memset.com/
26+ * https ://github.com/Memset/ snapshot-manager/releases/latest
2927
3028Or alternatively if you have Go installed use
3129
7472
7573Run snapshot-manager without any parameters to see the help
7674```
75+ snapshot-manager version v1.00 (C) Memset Ltd 2015
76+
7777Manage snapshots in Memset Memstore
7878
7979snapshot-manager <command> <arguments>
@@ -89,7 +89,7 @@ Commands
8989Full options:
9090 -auth-url="https://auth.storage.memset.com/v1.0": Swift Auth URL - default is for Memstore
9191 -chunk-size=67108864: Size of the chunks to make
92- -config="/home/ncw /.snapshot-manager.conf": Path to config file
92+ -config="/home/user /.snapshot-manager.conf": Path to config file
9393 -password="": Memstore password
9494 -user="": Memstore user name, eg myaccaa1.admin
9595```
@@ -270,7 +270,7 @@ COPYING file included in this package).
270270
271271Changelog
272272---------
273- * v1.00 - 2015-01-11
273+ * v1.00 - 2015-01-26
274274
275275Contact and support
276276-------------------
Original file line number Diff line number Diff line change 1+ Required software for making a release
2+ * [ github-release] ( https://github.com/aktau/github-release ) for uploading packages
3+ * [ gox] ( https://github.com/mitchellh/gox ) for cross compiling
4+ * Run ` gox -build-toolchain `
5+ * This assumes you have your own source checkout
6+ * pandoc for making the html and man pages
7+
8+ Making a release
9+ * go get -u -f -v ./...
10+ * make test
11+ * make tag
12+ * edit README.md
13+ * git commit version.go README.md
14+ * make retag
15+ * # Set the GOPATH for a gox enabled compiler
16+ * make cross
17+ * make upload
18+ * git push --tags origin master
19+
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ set -e
4+
5+ # This uses gox from https://github.com/mitchellh/gox
6+ # Make sure you've run gox -build-toolchain
7+
8+ if [ " $1 " == " " ]; then
9+ echo " Syntax: $0 Version"
10+ exit 1
11+ fi
12+ VERSION=" $1 "
13+
14+ rm -rf build
15+
16+ gox -output " build/{{.Dir}}-${VERSION} -{{.OS}}-{{.Arch}}/{{.Dir}}"
17+
18+ mv build/snapshot-manager-${VERSION} -darwin-amd64 build/snapshot-manager-${VERSION} -osx-amd64
19+ mv build/snapshot-manager-${VERSION} -darwin-386 build/snapshot-manager-${VERSION} -osx-386
20+
21+ cd build
22+
23+ for d in ` ls` ; do
24+ cp -a ../README.txt $d /
25+ cp -a ../README.html $d /
26+ cp -a ../snapshot-manager.1 $d /
27+ zip -r9 $d .zip $d
28+ rm -rf $d
29+ done
30+
31+ cd ..
Original file line number Diff line number Diff line change @@ -139,9 +139,11 @@ func deleteSnaphot(name string) {
139139
140140// syntaxError prints the syntax
141141func syntaxError () {
142- fmt .Fprintf (os .Stderr , `Manage snapshots in Memset Memstore
142+ fmt .Fprintf (os .Stderr , `%s version %s (C) Memset Ltd 2015
143143
144- snapshot-manager <command> <arguments>
144+ Manage snapshots in Memset Memstore
145+
146+ %s <command> <arguments>
145147
146148Commands
147149
@@ -152,7 +154,7 @@ Commands
152154 types - available snapshot types
153155
154156Full options:
155- ` )
157+ ` , os . Args [ 0 ], Version , os . Args [ 0 ] )
156158 flag .PrintDefaults ()
157159}
158160
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ #
3+ # Upload a release
4+
5+ set -e
6+
7+ REPO=" snapshot-manager"
8+
9+ if [ " $1 " == " " ]; then
10+ echo " Syntax: $0 Version"
11+ exit 1
12+ fi
13+ VERSION=" $1 "
14+ if [ " $GITHUB_USER " == " " ]; then
15+ echo 1>&2 " Need GITHUB_USER environment variable"
16+ exit 1
17+ fi
18+ if [ " $GITHUB_TOKEN " == " " ]; then
19+ echo 1>&2 " Need GITHUB_TOKEN environment variable"
20+ exit 1
21+ fi
22+
23+ echo " Making release ${VERSION} "
24+ github-release release \
25+ --repo ${REPO} \
26+ --tag ${VERSION} \
27+ --name " Snapshot Manager" \
28+ --description " Tool to upload and download Memset snapshots"
29+
30+ for build in ` ls build` ; do
31+ echo " Uploading ${build} "
32+ base=" ${build% .* } "
33+ parts=(${base// -/ } )
34+ os=${parts[3]}
35+ arch=${parts[4]}
36+
37+ github-release upload \
38+ --repo ${REPO} \
39+ --tag ${VERSION} \
40+ --name " ${build} " \
41+ --file build/${build}
42+ done
43+
44+ github-release info \
45+ --repo ${REPO} \
46+ --tag ${VERSION}
47+
48+ echo " Done"
Original file line number Diff line number Diff line change 1+ package main
2+
3+ const Version = "v1.00"
You can’t perform that action at this time.
0 commit comments