Merge pull request #324 from nspcc-dev/fix-circleci-workflow-version

Fix CircleCI workflows to work and Docker image to build in CircleCI.
This commit is contained in:
Roman Khimov 2019-08-29 16:17:57 +03:00 committed by GitHub
commit e93a2192b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 7 deletions

View file

@ -87,11 +87,11 @@ jobs:
curl -L -o /tmp/docker-$VER.tgz https://get.docker.com/builds/Linux/x86_64/docker-$VER.tgz
tar -xz -C /tmp -f /tmp/docker-$VER.tgz
mv /tmp/docker/* /usr/bin
- run: make build-image
- run: make image
workflows:
version: 2.1
version: 2
workflow:
jobs:
- vet:

View file

@ -16,9 +16,12 @@ ARG VERSION=dev
# go build -mod=vendor
RUN set -x \
&& export GOGC=off \
&& export GO111MODULE=on \
&& export CGO_ENABLED=0 \
&& export LDFLAGS="-X ${REPO}/config.Version=${VERSION}" \
&& go build -v -mod=vendor -ldflags "${LDFLAGS}" -o /go/bin/node ./cli/main.go
&& go mod tidy -v \
&& go mod vendor \
&& go build -v -mod=vendor -ldflags "${LDFLAGS}" -o /go/bin/neo-go ./cli/main.go
# Executable image
FROM alpine:3.10
@ -31,9 +34,9 @@ WORKDIR /
ENV NETMODE=testnet
COPY --from=builder /neo-go/config /config
COPY --from=builder /go/bin/node /usr/bin/node
COPY --from=builder /go/bin/neo-go /usr/bin/neo-go
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
ENTRYPOINT ["/usr/bin/node"]
ENTRYPOINT ["/usr/bin/neo-go"]
CMD ["node", "--config-path", "./config", "--testnet"]
CMD ["neo-go", "--config-path", "./config", "--testnet"]

View file

@ -14,7 +14,7 @@ build: deps
&& export CGO_ENABLED=0 \
&& go build -v -mod=vendor -ldflags $(BUILD_FLAGS) -o ${BINARY} ./cli/main.go
image: deps
image:
@echo "=> Building image"
@docker build -t cityofzion/neo-go:latest --build-arg REPO=$(REPO) --build-arg VERSION=$(VERSION) .
@docker build -t cityofzion/neo-go:$(VERSION) --build-arg REPO=$(REPO) --build-arg VERSION=$(VERSION) .