Skip to content

Commit 72a6240

Browse files
committed
chore(workflow-cli): change glide to dep
1 parent 7b971ee commit 72a6240

8 files changed

Lines changed: 263 additions & 273 deletions

File tree

Dockerfile

Lines changed: 0 additions & 27 deletions
This file was deleted.

Gopkg.lock

Lines changed: 184 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Gopkg.toml example
2+
#
3+
# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html
4+
# for detailed Gopkg.toml documentation.
5+
#
6+
# required = ["github.com/user/thing/cmd/thing"]
7+
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] #
8+
# [[constraint]]
9+
# name = "github.com/user/project"
10+
# version = "1.0.0"
11+
#
12+
# [[constraint]]
13+
# name = "github.com/user/project2"
14+
# branch = "dev"
15+
# source = "github.com/myfork/project2"
16+
#
17+
# [[override]]
18+
# name = "github.com/x/y"
19+
# version = "2.4.0"
20+
#
21+
# [prune]
22+
# non-go = false
23+
# go-tests = true
24+
# unused-packages = true
25+
26+
ignored = [
27+
"appengine",
28+
"appengine/datastore",
29+
"appengine/memcache",
30+
"appengine/user",
31+
]
32+
33+
[[constraint]]
34+
name = "github.com/arschles/assert"
35+
version = "1.0.0"
36+
37+
[[constraint]]
38+
branch = "master"
39+
name = "github.com/docopt/docopt-go"
40+
41+
[[constraint]]
42+
branch = "master"
43+
name = "github.com/drycc/controller-sdk-go"
44+
45+
[[constraint]]
46+
branch = "master"
47+
name = "github.com/drycc/pkg"
48+
49+
[[constraint]]
50+
name = "gopkg.in/yaml.v2"
51+
version = "2.2.1"
52+
53+
[prune]
54+
go-tests = true
55+
unused-packages = true

Makefile

Lines changed: 16 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# the filepath to this repository, relative to $GOPATH/src
2-
repo_path = github.com/drycc/workflow-cli
2+
REPO_PATH := github.com/drycc/workflow-cli
3+
DEV_ENV_IMAGE := quay.io/drycc/go-dev:v0.22.0
4+
DEV_ENV_WORK_DIR := /go/src/${REPO_PATH}
35

46
HOST_OS := $(shell uname)
57
ifeq ($(HOST_OS),Darwin)
@@ -21,54 +23,28 @@ BUILD_ARCH ?=amd64 386
2123

2224
DIST_DIR ?= _dist
2325

24-
define check-static-binary
25-
if file $(1) | egrep -q "(statically linked|Mach-O)"; then \
26-
echo -n ""; \
27-
else \
28-
echo "The binary file $(1) is not statically linked. Build canceled"; \
29-
exit 1; \
30-
fi
31-
endef
26+
DEV_ENV_CMD := docker run --rm -v ${CURDIR}:${DEV_ENV_WORK_DIR} -w ${DEV_ENV_WORK_DIR} ${DEV_ENV_IMAGE}
3227

33-
build: build-test-image
34-
$(eval GO_LDFLAGS= -ldflags '-X ${repo_path}/version.Version=dev-${REVISION}')
35-
docker run --rm -e GOOS=${GOOS} -v ${CURDIR}/_dist:/out ${IMAGE} go build -a -installsuffix cgo ${GO_LDFLAGS} -o /out/drycc .
36-
@$(call check-static-binary,_dist/drycc)
37-
@echo "${GOOS} binary written to _dist/drycc"
28+
define build-install-script
29+
sed "s|{{DRYCC-CLIENT-VERSION}}|${GIT_TAG}|g" "install.tmpl" > "${DIST_DIR}/$(1)/install-drycc.sh"
30+
endef
3831

39-
# This is supposed to be run within a docker container
40-
build-latest:
41-
$(eval GO_LDFLAGS = -ldflags '-X ${repo_path}/version.Version=${GIT_TAG}-${REVISION}')
42-
gox -verbose ${GO_LDFLAGS} -os="${BUILD_OS}" -arch="${BUILD_ARCH}" -output="${DIST_DIR}/drycc-latest-{{.OS}}-{{.Arch}}" .
32+
bootstrap:
33+
${DEV_ENV_CMD} dep ensure
4334

4435
# This is supposed to be run within a docker container
4536
build-revision:
46-
$(eval GO_LDFLAGS = -ldflags '-X ${repo_path}/version.Version=${GIT_TAG}-${REVISION}')
47-
gox -verbose ${GO_LDFLAGS} -os="${BUILD_OS}" -arch="${BUILD_ARCH}" -output="${DIST_DIR}/${REVISION}/drycc-${REVISION}-{{.OS}}-{{.Arch}}" .
48-
49-
# This is supposed to be run within a docker container
50-
build-stable:
51-
$(eval GO_LDFLAGS = -ldflags '-X ${repo_path}/version.Version=${GIT_TAG}')
52-
gox -verbose ${GO_LDFLAGS} -os="${BUILD_OS}" -arch="${BUILD_ARCH}" -output="${DIST_DIR}/drycc-stable-{{.OS}}-{{.Arch}}" .
37+
${DEV_ENV_CMD} gox -verbose ${GO_LDFLAGS} -os="${BUILD_OS}" -arch="${BUILD_ARCH}" -output="${DIST_DIR}/${REVISION}/drycc-${REVISION}-{{.OS}}-{{.Arch}}" .
5338

5439
# This is supposed to be run within a docker container
5540
build-tag:
56-
$(eval GO_LDFLAGS = -ldflags '-X ${repo_path}/version.Version=${GIT_TAG}')
57-
gox -verbose ${GO_LDFLAGS} -os="${BUILD_OS}" -arch="${BUILD_ARCH}" -output="${DIST_DIR}/${GIT_TAG}/drycc-${GIT_TAG}-{{.OS}}-{{.Arch}}" .
58-
59-
build-all: build-latest build-revision
41+
${DEV_ENV_CMD} gox -verbose ${GO_LDFLAGS} -os="${BUILD_OS}" -arch="${BUILD_ARCH}" -output="${DIST_DIR}/${GIT_TAG}/drycc-${GIT_TAG}-{{.OS}}-{{.Arch}}" .
42+
@$(call build-install-script,${GIT_TAG})
6043

61-
install:
62-
cp drycc $$GOPATH/bin
44+
build: build-tag build-revision
6345

6446
test-style: build-test-image
65-
docker run --rm ${IMAGE} lint
66-
67-
test: build-test-image
68-
docker run --rm ${IMAGE} test
69-
70-
build-test-image:
71-
docker build ${DOCKER_BUILD_FLAGS} -t ${IMAGE} .
47+
${DEV_ENV_CMD} lint
7248

73-
push-test-image: build-test-image
74-
docker push ${IMAGE}
49+
test:
50+
${DEV_ENV_CMD} test

0 commit comments

Comments
 (0)