Skip to content

Commit

Permalink
chore(ci): remove dependency on scripts/ci.go (ChainSafe#1964)
Browse files Browse the repository at this point in the history
- Remove unused `scripts/ci.sh`
- Dockerfile: build Go binary without `scripts/ci.go`
- Build Go binary with `-trimpath`
- Makefile:
  - remove outdated `ci.go test` from Makefile
  - build binary without `scripts/ci.go`
  - build binary without changing directory
  - `install` binary by executing `build` target and just `mv` the built binary
  • Loading branch information
qdm12 authored and timwu20 committed Dec 6, 2021
1 parent 0bc4e2d commit 2164490
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 116 deletions.
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ RUN cp /go/pkg/mod/github.com/wasmerio/go-ext-wasm@*/wasmer/libwasmer.so libwasm
COPY . .

# Build
RUN GOBIN=$GOPATH/src/github.com/ChainSafe/gossamer/bin go run scripts/ci.go install
ARG GO_BUILD_FLAGS
RUN go build \
-trimpath \
-o ./bin/gossamer \
${GO_BUILD_FLAGS} \
./cmd/gossamer

# Final stage based on Debian
FROM debian:${DEBIAN_VERSION}
Expand Down
12 changes: 5 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ proto:
## test: Runs `go test` on project test files.
test:
@echo " > \033[32mRunning tests...\033[0m "
#GOBIN=$(PWD)/bin go run scripts/ci.go test
git lfs pull
go test -short -coverprofile c.out ./... -timeout=30m

Expand Down Expand Up @@ -80,11 +79,11 @@ deps:
## build: Builds application binary and stores it in `./bin/gossamer`
build:
@echo " > \033[32mBuilding binary...\033[0m "
GOBIN=$(PWD)/bin go run scripts/ci.go install
go build -trimpath -o ./bin/gossamer ./cmd/gossamer

## debug: Builds application binary with debug flags and stores it in `./bin/gossamer`
build-debug: clean
cd cmd/gossamer && go build -gcflags=all="-N -l" -o ../../bin/gossamer && cd ../..
go build -trimpath -gcflags=all="-N -l" -o ./bin/gossamer ./cmd/gossamer

## init: Initialise gossamer using the default genesis and toml configuration files
init:
Expand Down Expand Up @@ -120,9 +119,8 @@ docker-build:
@echo " > \033[32mBuilding Docker Container...\033[0m "
docker build -t $(FULLDOCKERNAME) -f Dockerfile .

gossamer: clean
cd cmd/gossamer && go build -o ../../bin/gossamer && cd ../..
gossamer: clean build

## install: install the gossamer binary in $GOPATH/bin
install:
GOBIN=$(GOPATH)/bin go run scripts/ci.go install
install: build
mv ./bin/gossamer $(GOPATH)/bin/gossamer
81 changes: 0 additions & 81 deletions scripts/ci.go

This file was deleted.

27 changes: 0 additions & 27 deletions scripts/ci.sh

This file was deleted.

0 comments on commit 2164490

Please sign in to comment.