105 lines
2.3 KiB
YAML
105 lines
2.3 KiB
YAML
kind: pipeline
|
|
type: docker
|
|
name: default
|
|
|
|
steps:
|
|
- name: restore-cache-with-filesystem
|
|
image: cache.coadcorp.com/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: cache.coadcorp.com/library/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
|
|
volumes:
|
|
- name: shared
|
|
path: /shared
|
|
commands:
|
|
- cp /shared/vctp-linux-amd64 ./build/vctp-linux-amd64
|
|
#- find .
|
|
- nfpm package --config vctp.yml --packager rpm --target ./build/
|
|
- ls -lah ./build/
|
|
|
|
- name: dell-sftp-deploy
|
|
image: cache.coadcorp.com/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: cache.coadcorp.com/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
|