This commit is contained in:
10
.drone.sh
10
.drone.sh
@@ -5,10 +5,12 @@ export CGO_ENABLED=0
|
|||||||
|
|
||||||
export now=$(TZ=Australia/Sydney date '+%Y%m%d-%H%M%S')
|
export now=$(TZ=Australia/Sydney date '+%Y%m%d-%H%M%S')
|
||||||
echo $now
|
echo $now
|
||||||
go env GOCACHE
|
pwd
|
||||||
GOCACHE=/tmp/cache
|
ls -lah ~
|
||||||
export GOCACHE
|
#go env GOCACHE
|
||||||
go env GOCACHE
|
#GOCACHE=/tmp/cache
|
||||||
|
#export GOCACHE
|
||||||
|
#go env GOCACHE
|
||||||
echo "build commences"
|
echo "build commences"
|
||||||
go build -ldflags "-X main.sha1ver=`git rev-parse HEAD` -X main.buildTime=$now" -o smt
|
go build -ldflags "-X main.sha1ver=`git rev-parse HEAD` -X main.buildTime=$now" -o smt
|
||||||
echo "build complete"
|
echo "build complete"
|
||||||
|
29
.drone.yml
29
.drone.yml
@@ -24,17 +24,23 @@ steps:
|
|||||||
backend: "filesystem"
|
backend: "filesystem"
|
||||||
#debug: true
|
#debug: true
|
||||||
restore: true
|
restore: true
|
||||||
cache_key: "volume"
|
cache_key: '{{ .Repo.Name }}_{{ checksum "go.mod" }}_{{ checksum "go.sum" }}_{{ arch }}_{{ os }}'
|
||||||
archive_format: "gzip"
|
archive_format: "gzip"
|
||||||
filesystem_cache_root: "/tmp/cache"
|
#filesystem_cache_root: "/tmp/cache"
|
||||||
#mount:
|
local_root: /
|
||||||
# - 'vendor'
|
mount:
|
||||||
|
- pkg.mod
|
||||||
|
- pkg.build
|
||||||
volumes:
|
volumes:
|
||||||
- name: cache
|
- name: shared
|
||||||
path: /tmp/cache
|
path: /go
|
||||||
|
|
||||||
- name: build
|
- name: build
|
||||||
image: golang
|
image: golang
|
||||||
|
environment:
|
||||||
|
CGO_ENABLED: 0
|
||||||
|
GOMODCACHE: '/drone/src/pkg.mod'
|
||||||
|
GOCACHE: '/drone/src/pkg.build'
|
||||||
volumes:
|
volumes:
|
||||||
- name: shared
|
- name: shared
|
||||||
path: /shared
|
path: /shared
|
||||||
@@ -49,14 +55,15 @@ steps:
|
|||||||
backend: "filesystem"
|
backend: "filesystem"
|
||||||
#debug: true
|
#debug: true
|
||||||
rebuild: true
|
rebuild: true
|
||||||
cache_key: "volume"
|
cache_key: '{{ .Repo.Name }}_{{ checksum "go.mod" }}_{{ checksum "go.sum" }}_{{ arch }}_{{ os }}'
|
||||||
archive_format: "gzip"
|
archive_format: "gzip"
|
||||||
filesystem_cache_root: "/tmp/cache"
|
#filesystem_cache_root: "/tmp/cache"
|
||||||
#mount:
|
mount:
|
||||||
# - 'vendor'
|
- pkg.mod
|
||||||
|
- pkg.build
|
||||||
volumes:
|
volumes:
|
||||||
- name: cache
|
- name: cache
|
||||||
path: /tmp/cache
|
path: /go
|
||||||
|
|
||||||
# Copy binary to test server
|
# Copy binary to test server
|
||||||
- name: coadcorp-deploy
|
- name: coadcorp-deploy
|
||||||
|
Reference in New Issue
Block a user