Skip to content

Commit 3576396

Browse files
committed
use Go modules, upgrade factom dependencies, bump to version 2.3
1 parent 0704f49 commit 3576396

11 files changed

Lines changed: 405 additions & 357 deletions

File tree

.circleci/config.yml

Lines changed: 8 additions & 156 deletions
Original file line numberDiff line numberDiff line change
@@ -5,135 +5,31 @@ jobs:
55
build:
66
working_directory: /go/src/github.com/FactomProject/factom-cli
77
docker:
8-
- image: circleci/golang:1.10
8+
- image: circleci/golang:1.15
99

1010
steps:
1111
- checkout
1212

13-
- restore_cache:
14-
keys:
15-
- v1-factom-cli-go-build-cache-{{ checksum "glide.lock" }}
16-
17-
- run:
18-
name: Get glide
19-
command: |
20-
go get -v github.com/Masterminds/glide
21-
cd $GOPATH/src/github.com/Masterminds/glide
22-
git checkout tags/v0.13.1
23-
go install
24-
- run:
25-
name: Get goveralls
26-
command: |
27-
go get github.com/mattn/goveralls
28-
cd $GOPATH/src/github.com/Masterminds/glide
29-
git checkout tags/v0.13.1
30-
go install
31-
- run:
32-
name: Get the dependencies
33-
command: |
34-
glide install
3513
- run:
3614
name: Build and install the executable
3715
command: go install -v
3816

39-
- save_cache:
40-
key: v1-factom-cli-go-build-cache-{{ checksum "glide.lock" }}
41-
paths:
42-
- vendor
43-
4417
test:
4518
working_directory: /go/src/github.com/FactomProject/factom-cli
4619
docker:
47-
- image: circleci/golang:1.10
20+
- image: circleci/golang:1.15
4821

4922
steps:
5023
- checkout
5124

52-
- restore_cache:
53-
keys:
54-
- v1-factom-cli-go-build-cache-{{ checksum "glide.lock" }}
55-
56-
- run:
57-
name: Get glide
58-
command: |
59-
go get -v github.com/Masterminds/glide
60-
cd $GOPATH/src/github.com/Masterminds/glide
61-
git checkout tags/v0.13.1
62-
go install
63-
- run:
64-
name: Get goveralls
65-
command: |
66-
go get github.com/mattn/goveralls
67-
cd $GOPATH/src/github.com/Masterminds/glide
68-
git checkout tags/v0.13.1
69-
go install
70-
- run:
71-
name: Get the dependencies
72-
command: |
73-
glide install
7425
- run:
7526
name: Build and install the executable
7627
command: go install -v
7728

7829
- run:
7930
name: Run tests!
8031
no_output_timeout: 2400
81-
command: go test -v $(glide nv)
82-
83-
84-
- save_cache:
85-
key: v1-factom-cli-go-build-cache-{{ checksum "glide.lock" }}
86-
paths:
87-
- vendor
88-
89-
# Coveralls configuration is unused as most of the unit testing
90-
# lies in the dependency repos.
91-
coveralls:
92-
working_directory: /go/src/github.com/FactomProject/factomd-cli
93-
docker:
94-
- image: circleci/golang:1.10
95-
96-
steps:
97-
- checkout
98-
99-
- restore_cache:
100-
keys:
101-
- v1-factom-cli-go-build-cache-{{ checksum "glide.lock" }}
102-
103-
- run:
104-
name: Get glide
105-
command: |
106-
go get -v github.com/Masterminds/glide
107-
cd $GOPATH/src/github.com/Masterminds/glide
108-
git checkout tags/v0.13.1
109-
go install
110-
- run:
111-
name: Get goveralls
112-
command: |
113-
go get github.com/mattn/goveralls
114-
cd $GOPATH/src/github.com/Masterminds/glide
115-
git checkout tags/v0.13.1
116-
go install
117-
- run:
118-
name: Get the dependencies
119-
command: |
120-
glide install
121-
- run:
122-
name: Build and install the executable
123-
command: go install -v
124-
125-
- run:
126-
name: Coveralls!
127-
no_output_timeout: 2400
128-
command: goveralls -v -ignore=$(paste -sd, .coverignore) -service=circle-ci -repotoken=$COVERALLS_TOKEN
129-
130-
131-
- save_cache:
132-
key: v1-factom-cli-go-build-cache-{{ checksum "glide.lock" }}
133-
paths:
134-
- vendor
135-
136-
32+
command: go test -v ./...
13733

13834
# Docker builds
13935
docker_build:
@@ -148,12 +44,6 @@ jobs:
14844
- setup_remote_docker:
14945
version: 17.06.0-ce
15046

151-
# The main (only) thing we care about is caching the /vendor dir.
152-
# Hence, checksumming glide.lock
153-
- restore_cache:
154-
keys:
155-
- v2-factom-cli-docker-cache-{{ checksum "glide.lock" }}
156-
15747
# Load the images if the cache hit
15848
- run:
15949
name: Load Docker image layer cache
@@ -247,18 +137,12 @@ jobs:
247137
docker save -o /images/factom-cli-alpine.tar factom-cli-alpine $(docker history -q factom-cli-alpine |grep -v missing | grep -v none)
248138
docker save -o /images/factom-cli.tar factom-cli $(docker history -q factom-cli |grep -v missing | grep -v none)
249139
250-
- save_cache:
251-
key: v2-factom-cli-docker-cache-{{ checksum "glide.lock" }}
252-
paths:
253-
- /images
254140
255141
# The flow is
256142
# build
257143
# |
258144
# ---------- test
259145
# |
260-
# ---------- coveralls
261-
# |
262146
# ---------- docker_build
263147
#
264148
#
@@ -267,48 +151,16 @@ workflows:
267151
version: 2
268152
commit-workflow:
269153
jobs:
270-
- build:
271-
filters:
272-
tags:
273-
only: /.*/
154+
- build
274155
- test:
275-
filters:
276-
tags:
277-
only: /.*/
278156
requires:
279157
- build
280-
# Disabling coveralls for cli repo
281-
# - coveralls:
282-
# filters:
283-
# tags:
284-
# only: /.*/
285-
# requires:
286-
# - test
287158
- docker_build:
288-
filters:
289-
tags:
290-
only: /.*/
291-
context: org-global
292-
requires:
293-
- test
294-
295-
scheduled-workflow:
296-
triggers:
297-
- schedule:
298-
cron: "30 5 * * *"
299159
filters:
300160
branches:
301-
only: develop
302-
jobs:
303-
- build
304-
- test:
305-
requires:
306-
- build
307-
# Disabling coveralls for cli repo
308-
# - coveralls:
309-
# requires:
310-
# - test
311-
- docker_build:
161+
only:
162+
- develop
163+
- master
312164
context: org-global
313165
requires:
314-
- test
166+
- test

Dockerfile

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,15 @@
11

2-
FROM golang:1.10
3-
4-
# Get git
5-
RUN apt-get update \
6-
&& apt-get -y install curl git \
7-
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
8-
9-
# Get glide
10-
RUN go get github.com/Masterminds/glide
2+
FROM golang:1.15
113

124
# Where factom-cli sources will live
135
WORKDIR $GOPATH/src/github.com/FactomProject/factom-cli
146

15-
# Get the dependencies
16-
COPY glide.yaml glide.lock ./
17-
18-
# Install dependencies
19-
RUN glide install -v
20-
21-
# Get goveralls for testing/coverage
22-
RUN go get github.com/mattn/goveralls
23-
247
# Populate the rest of the source
258
COPY . .
269

2710
ARG GOOS=linux
2811

2912
# Build and install factom-cli
30-
RUN go install
13+
RUN ./build.sh
3114

3215
ENTRYPOINT ["/go/bin/factom-cli"]

Dockerfile.alpine

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,18 @@
1-
FROM golang:1.10-alpine as builder
2-
3-
# Get git
4-
RUN apk add --no-cache curl git
5-
6-
# Get glide
7-
RUN go get github.com/Masterminds/glide
1+
FROM golang:1.15-alpine as builder
82

93
# Where factom-cli sources will live
104
WORKDIR $GOPATH/src/github.com/FactomProject/factom-cli
115

12-
# Get the dependencies
13-
COPY glide.yaml glide.lock ./
14-
15-
# Install dependencies
16-
RUN glide install -v
17-
186
# Populate the rest of the source
197
COPY . .
208

219
ARG GOOS=linux
2210

2311
# Build and install factom-cli
24-
RUN go install
12+
RUN ./build.sh
2513

2614
# Now squash everything
27-
FROM alpine:3.6
15+
FROM alpine:3.12
2816

2917
# Get git
3018
RUN apk add --no-cache ca-certificates curl git
@@ -33,5 +21,4 @@ RUN mkdir -p /go/bin
3321

3422
COPY --from=builder /go/bin/factom-cli /go/bin/factom-cli
3523

36-
3724
ENTRYPOINT ["/go/bin/factom-cli"]

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.2.13
1+
2.3.0

0 commit comments

Comments
 (0)