Skip to content

Commit

Permalink
cleaner command separation // vendor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronhurt committed Oct 31, 2017
1 parent 0e0c62a commit 75f3a3c
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 14 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ifeq ($(SUDO),true)
sudo = sudo
endif

.PHONY: build test release check clean docker docker_release
.PHONY: build test release check clean distclean docker docker-release

build:
@build/build.sh -i
Expand All @@ -24,9 +24,12 @@ check:
clean:
@build/build.sh -d

distclean:
@build/build.sh -dc

docker:
$(sudo) docker build -t $(IMAGE_PATH):latest .

docker_release:
docker-release:
$(sudo) docker build -t $(IMAGE_PATH):latest .
$(sudo) docker tag $(IMAGE_PATH):latest $(IMAGE_PATH):$(RELEASE_VERSION)
18 changes: 16 additions & 2 deletions build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ ensureGox() {
fi
}

## exit toggle
should_exit=false

## read options
while getopts ":uidr" opt; do
while getopts ":uidcr" opt; do
case $opt in
u)
ensureGlide
Expand All @@ -50,7 +53,13 @@ while getopts ":uidr" opt; do
printf "Removing binary, glide.lock and vendor directory ... "
rm -rf "${BUILD_NAME}" glide.lock vendor
printf "done.\n"
exit 0
should_exit=true
;;
c)
printf "Cleaning dist directory ... "
rm -rf ./dist/
printf "done.\n"
should_exit=true
;;
r)
ensureGox
Expand All @@ -65,6 +74,11 @@ done
## remove options
shift $((OPTIND-1))

## exiting?
if [ $should_exit == true ]; then
exit 0
fi

## check release option
if [ $RELEASE_BUILD -eq 1 ]; then
## clean dist directory
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"os"

"github.com/mitchellh/cli"
"github.com/myENA/consul-backinator/backup"
"github.com/myENA/consul-backinator/dump"
"github.com/myENA/consul-backinator/restore"
"github.com/myENA/consul-backinator/command/backup"
"github.com/myENA/consul-backinator/command/dump"
"github.com/myENA/consul-backinator/command/restore"
)

// package global logger
Expand Down
11 changes: 6 additions & 5 deletions glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions glide.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package: github.com/myENA/consul-backinator
import:
- package: github.com/hashicorp/consul
version: v0.9.3
version: v1.0.0
subpackages:
- api
- package: github.com/mitchellh/cli
- package: github.com/hashicorp/go-cleanhttp
- package: github.com/hashicorp/go-discover
- package: github.com/aws/aws-sdk-go
version: v1.10.38
version: v1.12.19
subpackages:
- aws
- aws/awserr
Expand Down

0 comments on commit 75f3a3c

Please sign in to comment.