Files
vctp2/.drone.yml
Nathan Coad 7c76825813
Some checks failed
continuous-integration/drone/push Build encountered an error
delay daily aggregation job by 10 minutes
2026-01-16 16:07:35 +11:00

124 lines
2.7 KiB
YAML

kind: pipeline
type: docker
name: default
steps:
- name: restore-cache-with-filesystem
image: meltwater/drone-cache
pull: true
settings:
backend: "filesystem"
#debug: true
restore: true
cache_key: '{{ .Repo.Name }}_{{ arch }}_{{ os }}'
archive_format: "tar"
filesystem_cache_root: "/go"
local_root: /
mount:
- pkg.mod
- pkg.build
- pkg.tools
volumes:
- name: cache
path: /go
- name: build
image: golang
environment:
CGO_ENABLED: 0
GOMODCACHE: '/drone/src/pkg.mod'
GOCACHE: '/drone/src/pkg.build'
GOBIN: '/drone/src/pkg.tools'
volumes:
- name: shared
path: /shared
commands:
- export PATH=/drone/src/pkg.tools:$PATH
- go install github.com/a-h/templ/cmd/templ@latest
- go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest
- go install github.com/swaggo/swag/cmd/swag@latest
# - go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest
- sqlc generate
- templ generate -path ./components
- swag init --exclude "pkg.mod,pkg.build,pkg.tools" -o server/router/docs
- chmod +x ./scripts/*.sh
- ./scripts/update-swagger-ui.sh
- ./scripts/drone.sh
- cp ./build/vctp-linux-amd64 /shared/
- name: rpm
image: ghcr.io/goreleaser/nfpm
environment:
TZ: UTC
NFPM_VERSION: '${DRONE_BUILD_NUMBER}'
volumes:
- name: shared
path: /shared
commands:
- cp /shared/vctp-linux-amd64 ./build/vctp-linux-amd64
#- find .
- VERSION=$(grep '^version:' vctp.yml | awk '{print $2}' | tr -d '"')
- VERSION=${VERSION#v}
- export NFPM_VERSION=$VERSION
- echo "nfpm version: ${NFPM_VERSION}"
- nfpm package --config vctp.yml --packager rpm --target ./build/
- ls -lah ./build/
- name: semver
image: plugins/semver
when:
status:
- success
settings:
repo: ${DRONE_REPO_LINK}
token:
from_secret: GITEA_TOKEN
patch: true
tag: true
user_name: "Nathan Coad"
user_email: "nathan@thecoads.com"
- name: dell-sftp-deploy
image: hypervtechnics/drone-sftp
settings:
host: deft.dell.com
username:
from_secret: DELLFTP_USER
password:
from_secret: DELLFTP_PASS
port: 22
source: ./build
filter: vctp*
clean: false
target: /
overwrite: true
verbose: true
- name: rebuild-cache-with-filesystem
image: meltwater/drone-cache
pull: true
#when:
# event:
# - tag
settings:
backend: "filesystem"
#debug: true
rebuild: true
cache_key: '{{ .Repo.Name }}_{{ arch }}_{{ os }}'
archive_format: "tar"
filesystem_cache_root: "/go"
mount:
- pkg.mod
- pkg.build
- pkg.tools
volumes:
- name: cache
path: /go
volumes:
- name: shared
temp: {}
- name: cache
host:
path: /var/lib/cache