ci
Some checks reported errors
continuous-integration/drone/push Build encountered an error
continuous-integration/drone/tag Build is failing

This commit is contained in:
Marvin Steadfast 2020-12-03 12:07:03 +01:00
parent d3c9a1834a
commit c9a1b7076a
5 changed files with 99 additions and 0 deletions

45
.drone.yml Normal file
View 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
View File

@ -0,0 +1 @@
dist/*

View File

@ -1,16 +1,37 @@
--- ---
project_name: jellyfixer
gitea_urls:
api: https://git.xsfx.dev/api/v1/
builds: builds:
- env: - env:
- CGO_ENABLED=0 - CGO_ENABLED=0
ldflags:
- "-s -w"
- '-extldflags "-static"'
- "-X main.version={{.Version}}"
- "-X main.commit={{.ShortCommit}}"
- "-X main.date={{.Date}}"
goos: goos:
- linux - linux
goarch:
- amd64
checksum: checksum:
name_template: "checksums.txt" name_template: "checksums.txt"
snapshot: snapshot:
name_template: "{{ .Tag }}-next" name_template: "{{ .Tag }}-next"
changelog: changelog:
sort: asc sort: asc
filters: filters:
exclude: exclude:
- "^docs:" - "^docs:"
- "^test:" - "^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
View 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

View 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"]