Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Commit

Permalink
egoscale: update vendor
Browse files Browse the repository at this point in the history
Signed-off-by: Yoan Blanc <yoan.blanc@exoscale.ch>
  • Loading branch information
Yoan Blanc committed Jan 11, 2018
1 parent aac1a5e commit e13e512
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.gopath
build
vendor
5 changes: 1 addition & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,14 @@ go:
- 1.9
- tip

env:
- GIMME_OS=linux GIMME_ARCH=amd64

cache: apt

before_install:
- go get -u github.com/golang/dep/cmd/dep
- npm i -g codeclimate-test-reporter

install:
- dep ensure
- make deps

script:
- make
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ RUN apk add --no-cache \


FROM alpine:3.7
COPY --from=build /go/bin/exoip-static exoip
COPY --from=build /go/bin/exoip exoip
RUN apk add --no-cache \
ca-certificates \
iproute2
Expand Down
41 changes: 34 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,27 +1,54 @@
VERSION=0.3.5-snapshot
PKG=exoip
PKG=github.com/exoscale/exoip

GIMME_OS?=linux
GIMME_ARCH?=amd64

MAIN=cmd/$(PKG).go

MAIN=exoip
CLI=cmd/$(MAIN).go
SRCS=$(wildcard *.go)

DEST=build
BIN=$(DEST)/$(PKG)
BIN=$(DEST)/$(MAIN)
BINS=\
$(BIN) \
$(BIN)-static

GOPATH=$(CURDIR)/.gopath
DEP=$(GOPATH)/bin/dep

export GOPATH

RM?=rm -f

all: $(BIN)

$(BIN): $(MAIN) $(SRCS)
go build -o $@ $<
.phony: deps
deps: $(GOPATH)/src/$(PKG)

$(GOPATH)/src/$(PKG):
mkdir -p $(GOPATH)
go get -u github.com/golang/dep/cmd/dep
ls -l $(GOPATH)/bin
mkdir -p $(GOPATH)/src/$(PKG)
rm -rf $(GOPATH)/src/$(PKG)
ln -s ../../../.. $(GOPATH)/src/$(PKG)
(cd $(GOPATH)/src/$(PKG) && $(DEP) ensure)

.phony: deps-update
deps-update: deps
(cd $(GOPATH)/src/$(PKG) && \
$(DEP) ensure -update)

$(BIN): $(CLI) $(SRCS)
(cd $(GOPATH)/src/$(PKG) && \
go build -o $@ $<)

$(BIN)-static: $(MAIN) $(SRCS)
CGO_ENABLED=0 GOOS=$(GIMME_OS) GOARCH=$(GIMME_ARCH) go build -ldflags "-s" -o $@ $<
$(BIN)-static: $(CLI) $(SRCS)
(cd $(GOPATH)/src/$(PKG) && \
CGO_ENABLED=0 GOOS=$(GIMME_OS) GOARCH=$(GIMME_ARCH) \
go build -ldflags "-s" -o $@ $<)

clean:
$(RM) -r $(DEST)
Expand Down

0 comments on commit e13e512

Please sign in to comment.