Skip to content

Commit

Permalink
chore: split build to build_all and build_image targets
Browse files Browse the repository at this point in the history
  • Loading branch information
xcaspar committed Feb 3, 2020
1 parent 50ac742 commit ae0b228
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
13 changes: 10 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ build: pre_build build_cli build_os build_docker build_kubernetes build_java bui
# alias
cli: build_cli
os: build_os
os_darwin: build_darwin
os_darwin: build_os_darwin
docker: build_docker
kubernetes: build_kubernetes
java: build_java
Expand All @@ -79,8 +79,8 @@ cplus: build_cplus
# for example: make build_with cli os_darwin
build_with: pre_build

# for example: make build_with cli os
build_with_linux: pre_build
# for example: make build_with_linux cli os
build_with_linux: pre_build build_linux_with_arg

# build chaosblade cli: blade
build_cli:
Expand Down Expand Up @@ -178,6 +178,13 @@ build_linux:
-w /go/src/github.com/chaosblade-io/chaosblade \
chaosblade-build-musl:latest

build_linux_with_arg:
docker build -f build/image/musl/Dockerfile -t chaosblade-build-musl:latest build/image/musl
docker run --rm \
-v $(shell echo -n ${GOPATH}):/go \
-w /go/src/github.com/chaosblade-io/chaosblade \
chaosblade-build-musl:latest build_with $$ARGS

# build chaosblade image for chaos
build_image:
rm -rf $(BUILD_IMAGE_PATH)/$(BUILD_TARGET_DIR_NAME)
Expand Down
2 changes: 1 addition & 1 deletion build/image/musl/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUN apt-get update \

ENV CC /usr/local/musl/bin/musl-gcc
ENV GOOS linux
ENV mvn /usr/local/apache-maven-3.6.3/bin
ENV java /usr/bin/java
ENV PATH /usr/local/apache-maven-3.6.3/bin:$PATH

ENTRYPOINT [ "make" ]
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.13
require (
github.com/chaosblade-io/chaosblade-exec-docker v0.4.2-0.20200110075138-e482011049e1
github.com/chaosblade-io/chaosblade-exec-os v0.4.1-0.20200131100637-6f11682eeada
github.com/chaosblade-io/chaosblade-operator v0.4.1-0.20200110075310-a6443f3732ca
github.com/chaosblade-io/chaosblade-operator v0.4.1-0.20200203091953-e633762449d8
github.com/chaosblade-io/chaosblade-spec-go v0.4.1-0.20200110072855-4f767ce4e582
github.com/mattn/go-sqlite3 v1.10.1-0.20190217174029-ad30583d8387
github.com/prometheus/common v0.2.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ github.com/chaosblade-io/chaosblade-operator v0.4.1-0.20191216080032-f02da784564
github.com/chaosblade-io/chaosblade-operator v0.4.1-0.20191216080032-f02da7845646/go.mod h1:FE9gkAN0FmpANjoPl37hKcNHD103f0TKKN8Eq41KoLw=
github.com/chaosblade-io/chaosblade-operator v0.4.1-0.20200110075310-a6443f3732ca h1:7kQ3CpXWRgxZnG2Y1YeKPpqqAgWc88UJmLni+YC8yJI=
github.com/chaosblade-io/chaosblade-operator v0.4.1-0.20200110075310-a6443f3732ca/go.mod h1:gR9xIUGXXd0e4Witx4Zgga+LnovD7WDzUhN3pptaLAU=
github.com/chaosblade-io/chaosblade-operator v0.4.1-0.20200203091953-e633762449d8 h1:BAmpJySSlgjyOCCjDtTSkoCbrtoHsCR7yhRycjicy0A=
github.com/chaosblade-io/chaosblade-operator v0.4.1-0.20200203091953-e633762449d8/go.mod h1:gR9xIUGXXd0e4Witx4Zgga+LnovD7WDzUhN3pptaLAU=
github.com/chaosblade-io/chaosblade-spec-go v0.4.0/go.mod h1:ybcCsIX1wZtPrH0IsI28yDNJ+AVPeDMUZlgw1HE++Ds=
github.com/chaosblade-io/chaosblade-spec-go v0.4.1-0.20191225105920-8d7c5f186698 h1:vO6v4Ku7WdMZvgQAhyBUM10i+nn7NNoO1rOQ5ORaGCg=
github.com/chaosblade-io/chaosblade-spec-go v0.4.1-0.20191225105920-8d7c5f186698/go.mod h1:/U5pOQIrBm82Xo8HB9mPjZHHira4dFiJzCB1UNkyPyk=
Expand Down

0 comments on commit ae0b228

Please sign in to comment.