Skip to content

Commit

Permalink
Merge branch 'master' into feature/update-kube-batch-source
Browse files Browse the repository at this point in the history
  • Loading branch information
k82cn authored Apr 28, 2019
2 parents 7033629 + 499d2f9 commit 1ae320f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- sudo curl -o /usr/local/bin/kind -L https://github.com/kubernetes-sigs/kind/releases/download/0.2.0/kind-linux-amd64
- sudo chmod +x /usr/local/bin/kind
script:
- make cli
- make vkctl
- make images
- make e2e-test-kind
after_failure:
Expand Down
32 changes: 24 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,28 +1,44 @@
BIN_DIR=_output/bin
BIN_OSARCH=linux/amd64
REL_OSARCH=linux/amd64
REPO_PATH=volcano.sh/volcano
IMAGE_PREFIX=volcanosh/vk
TAG = latest
TAG=latest
GitSHA=`git rev-parse HEAD`
Date=`date "+%Y-%m-%d %H:%M:%S"`
LD_FLAGS=" \
-X '${REPO_PATH}/pkg/version.GitSHA=${GitSHA}' \
-X '${REPO_PATH}/pkg/version.Built=${Date}' \
-X '${REPO_PATH}/pkg/version.Version=${RELEASE_VER}'"

.EXPORT_ALL_VARIABLES:

all: init verify cli images e2e-test-kind
all: kube-batch vk-controllers vk-admission vkctl

init:
mkdir -p ${BIN_DIR}

cli:
go get github.com/mitchellh/gox
CGO_ENABLED=0 gox -osarch=${BIN_OSARCH} -output ${BIN_DIR}/${BIN_OSARCH}/vkctl ./cmd/cli
kube-batch: init
go build -ldflags ${LD_FLAGS} -o=${BIN_DIR}/kube-batch ./cmd/scheduler

vk-controllers: init
go build -ldflags ${LD_FLAGS} -o=${BIN_DIR}/vk-controllers ./cmd/controllers

vk-admission: init
go build -ldflags ${LD_FLAGS} -o=${BIN_DIR}/vk-admission ./cmd/admission

vkctl: init
go build -ldflags ${LD_FLAGS} -o=${BIN_DIR}/vkctl ./cmd/cli

image_bins:
go get github.com/mitchellh/gox
CGO_ENABLED=0 gox -osarch=${REL_OSARCH} -output ${BIN_DIR}/${REL_OSARCH}/vkctl ./cmd/cli
for name in controllers scheduler admission; do\
CGO_ENABLED=0 gox -osarch=${BIN_OSARCH} -output ${BIN_DIR}/${BIN_OSARCH}/vk-$$name ./cmd/$$name; \
CGO_ENABLED=0 gox -osarch=${REL_OSARCH} -output ${BIN_DIR}/${REL_OSARCH}/vk-$$name ./cmd/$$name; \
done

images: image_bins
for name in controllers scheduler admission; do\
cp ${BIN_DIR}/${BIN_OSARCH}/vk-$$name ./installer/dockerfile/$$name/; \
cp ${BIN_DIR}/${REL_OSARCH}/vk-$$name ./installer/dockerfile/$$name/; \
docker build --no-cache -t $(IMAGE_PREFIX)-$$name:$(TAG) ./installer/dockerfile/$$name; \
rm installer/dockerfile/$$name/vk-$$name; \
done
Expand Down

0 comments on commit 1ae320f

Please sign in to comment.