test build with cache
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-01-04 12:27:22 +11:00
parent 55f7bacd7b
commit ea70e073ec
2 changed files with 35 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ 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
make drone-cache
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"

View File

@@ -17,6 +17,21 @@ steps:
- pandoc -s README.md --embed-resources -c www/mvp.css --template template.html -o ./www/index.html - pandoc -s README.md --embed-resources -c www/mvp.css --template template.html -o ./www/index.html
- cp ./www/index.html /shared/index.html - cp ./www/index.html /shared/index.html
- name: restore-cache-with-filesystem
image: meltwater/drone-cache
pull: true
settings:
backend: "filesystem"
restore: true
cache_key: "volume"
archive_format: "gzip"
# filesystem_cache_root: "/tmp/cache"
mount:
- 'vendor'
volumes:
- name: cache
path: /tmp/cache
- name: build - name: build
image: golang image: golang
volumes: volumes:
@@ -26,6 +41,21 @@ steps:
- cp /shared/index.html ./www/ - cp /shared/index.html ./www/
- sh ./.drone.sh - sh ./.drone.sh
- name: rebuild-cache-with-filesystem
image: meltwater/drone-cache
pull: true
settings:
backend: "filesystem"
rebuild: true
cache_key: "volume"
archive_format: "gzip"
# filesystem_cache_root: "/tmp/cache"
mount:
- 'vendor'
volumes:
- name: cache
path: /tmp/cache
# Copy binary to test server # Copy binary to test server
- name: coadcorp-deploy - name: coadcorp-deploy
image: appleboy/drone-scp image: appleboy/drone-scp
@@ -77,4 +107,7 @@ steps:
volumes: volumes:
- name: shared - name: shared
temp: {} temp: {}
- name: cache
host:
path: /var/lib/cache