ci
This commit is contained in:
parent
d3c9a1834a
commit
c9a1b7076a
45
.drone.yml
Normal file
45
.drone.yml
Normal file
@ -0,0 +1,45 @@
|
||||
---
|
||||
kind: pipeline
|
||||
name: default
|
||||
|
||||
steps:
|
||||
- name: fetch
|
||||
image: docker:git
|
||||
commands:
|
||||
- git fetch --tags
|
||||
|
||||
- name: lint
|
||||
image: golang
|
||||
commands:
|
||||
- make lint
|
||||
|
||||
- name: release
|
||||
image: goreleaser/goreleaser:latest
|
||||
volumes:
|
||||
- name: dockersock
|
||||
path: /var/run
|
||||
environment:
|
||||
GITEA_TOKEN:
|
||||
from_secret: gitea_token
|
||||
DOCKER_USERNAME:
|
||||
from_secret: docker_username
|
||||
DOCKER_PASSWORD:
|
||||
from_secret: docker_password
|
||||
DOCKER_REGISTRY: quay.io
|
||||
commands:
|
||||
- sleep 5
|
||||
- goreleaser release
|
||||
when:
|
||||
event: tag
|
||||
|
||||
services:
|
||||
- name: docker
|
||||
image: docker:dind
|
||||
privileged: true
|
||||
volumes:
|
||||
- name: dockersock
|
||||
path: /var/run
|
||||
|
||||
volumes:
|
||||
- name: dockersock
|
||||
temp: {}
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
dist/*
|
@ -1,16 +1,37 @@
|
||||
---
|
||||
project_name: jellyfixer
|
||||
gitea_urls:
|
||||
api: https://git.xsfx.dev/api/v1/
|
||||
builds:
|
||||
- env:
|
||||
- CGO_ENABLED=0
|
||||
ldflags:
|
||||
- "-s -w"
|
||||
- '-extldflags "-static"'
|
||||
- "-X main.version={{.Version}}"
|
||||
- "-X main.commit={{.ShortCommit}}"
|
||||
- "-X main.date={{.Date}}"
|
||||
goos:
|
||||
- linux
|
||||
goarch:
|
||||
- amd64
|
||||
|
||||
checksum:
|
||||
name_template: "checksums.txt"
|
||||
|
||||
snapshot:
|
||||
name_template: "{{ .Tag }}-next"
|
||||
|
||||
changelog:
|
||||
sort: asc
|
||||
filters:
|
||||
exclude:
|
||||
- "^docs:"
|
||||
- "^test:"
|
||||
|
||||
dockers:
|
||||
- image_templates:
|
||||
- "quay.io/xsteadfastx/jellyfixer:latest"
|
||||
- "quay.io/xsteadfastx/jellyfixer:{{ .Tag }}"
|
||||
- "quay.io/xsteadfastx/jellyfixer:v{{ .Major }}"
|
||||
dockerfile: build/package/docker/Dockerfile
|
||||
|
22
Makefile
Normal file
22
Makefile
Normal file
@ -0,0 +1,22 @@
|
||||
.PHONY: generate build release test lint dep-update
|
||||
|
||||
generate:
|
||||
GOFLAGS=-mod=vendor go generate ./...
|
||||
|
||||
build:
|
||||
goreleaser build --rm-dist --snapshot
|
||||
|
||||
release:
|
||||
goreleaser release --rm-dist --snapshot --skip-publish
|
||||
|
||||
test:
|
||||
GOFLAGS=-mod=vendor go test -race -cover -v ./...
|
||||
|
||||
lint:
|
||||
golangci-lint run --enable-all --disable gomnd --disable godox --timeout 5m
|
||||
|
||||
dep-update:
|
||||
go get -u ./...
|
||||
go test ./...
|
||||
go mod tidy
|
||||
go mod vendor
|
10
build/package/docker/Dockerfile
Normal file
10
build/package/docker/Dockerfile
Normal file
@ -0,0 +1,10 @@
|
||||
FROM alpine:3.12 as certs
|
||||
RUN set -ex \
|
||||
&& apk add --no-cache \
|
||||
ca-certificates
|
||||
|
||||
FROM scratch
|
||||
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
||||
COPY jellyfixer /
|
||||
EXPOSE 8088
|
||||
ENTRYPOINT ["/jellyfixer"]
|
Loading…
Reference in New Issue
Block a user