Skip to content

Commit

Permalink
Merge pull request volcano-sh#75 from volcano-sh/opt/makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
Klaus Ma authored Apr 8, 2019
2 parents 3841fcf + 437819c commit 31c8a7c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 88 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ jobs:
before_script:
- go get -u golang.org/x/lint/golint
script:
- make
- make verify
- stage: E2E Tests
before_script:
Expand All @@ -29,7 +28,7 @@ jobs:
- sudo chmod +x /usr/local/bin/kind
script:
- make cli
- make docker
- make images
- make e2e-test-kind
after_failure:
# Echo logs and upload
Expand Down
31 changes: 11 additions & 20 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,44 +1,35 @@
BIN_DIR=_output/bin
BIN_OSARCH=linux/amd64
IMAGE=volcanosh/volcano
TAG = latest

.EXPORT_ALL_VARIABLES:

all: controllers scheduler cli admission
all: init verify cli images e2e-test-kind

init:
mkdir -p ${BIN_DIR}

controllers:
go build -o ${BIN_DIR}/vk-controllers ./cmd/controllers

scheduler:
go build -o ${BIN_DIR}/vk-scheduler ./cmd/scheduler

cli:
go build -o ${BIN_DIR}/vkctl ./cmd/cli

admission:
go build -o ${BIN_DIR}/vk-admission ./cmd/admission
go get github.com/mitchellh/gox
CGO_ENABLED=0 gox -osarch=${BIN_OSARCH} -output ${BIN_DIR}/${BIN_OSARCH}/vkctl ./cmd/cli

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

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

generate-code:
./hack/update-gencode.sh

e2e-test:
./hack/run-e2e.sh

unit-test:
go list ./... | grep -v e2e | xargs go test -v

Expand Down
2 changes: 1 addition & 1 deletion hack/run-e2e-kind.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

export VK_ROOT=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/..
export VK_BIN=${VK_ROOT}/_output/bin
export VK_BIN=${VK_ROOT}/${BIN_DIR}/${BIN_OSARCH}
export LOG_LEVEL=3
export SHOW_VOLCANO_LOGS=${SHOW_VOLCANO_LOGS:-1}
export CLEANUP_CLUSTER=${CLEANUP_CLUSTER:-1}
Expand Down
65 changes: 0 additions & 65 deletions hack/run-e2e.sh

This file was deleted.

0 comments on commit 31c8a7c

Please sign in to comment.