Build debian packages #56

Merged
konrad merged 9 commits from build-deb into master 2019-01-21 21:52:26 +00:00
2 changed files with 64 additions and 24 deletions
Showing only changes of commit 0dbc9db65a - Show all commits

View File

@ -111,30 +111,30 @@ steps:
image: karalabe/xgo-latest:latest
pull: true
environment:
TAGS: bindata sqlite
GOPATH: /srv/app
commands:
- make release-windows
- mv /build/* $(DIST)/binaries
depends_on: [ before-static-build ]
- name: static-build-linux
image: karalabe/xgo-latest:latest
pull: true
environment:
TAGS: bindata sqlite
GOPATH: /srv/app
commands:
- make release-linux
- mv /build/* $(DIST)/binaries
depends_on: [ before-static-build ]
- name: static-build-darwin
image: karalabe/xgo-latest:latest
pull: true
environment:
TAGS: bindata sqlite
GOPATH: /srv/app
commands:
- make release-darwin
- mv /build/* $(DIST)/binaries
depends_on: [ before-static-build ]
- name: after-build-static
@ -192,10 +192,8 @@ steps:
image: kolaente/reprepro
pull: true
environment:
GPG_PASSWORD:
from_secret: gpg_password
GPG_PRIVATE_KEY:
from_secret: gpg_privkey
from_secret: gpg_privatekey
commands:
- export GPG_TTY=$(tty)
- gpg -qk
@ -206,9 +204,10 @@ steps:
- mkdir debian/conf -p
- cp build/reprepro-dist-conf debian/conf/distributions
- make reprepro
depends_on: [ build-deb ]
# Push the releases to our pseudo-s3-bucket
- name: release-deb-latest
- name: release-deb
image: plugins/s3:1
pull: true
settings:
@ -219,9 +218,10 @@ steps:
from_secret: aws_secret_access_key
endpoint: https://storage.kolaente.de
path_style: true
source: '*.deb'
target: /master/
depends_on: [ build-deb ]
strip_prefix: debian
source: debian/*
target: /
depends_on: [ deb-structure ]
# Build the docker image and push it to docker hub
- name: docker
@ -305,30 +305,30 @@ steps:
image: karalabe/xgo-latest:latest
pull: true
environment:
TAGS: bindata sqlite
GOPATH: /srv/app
commands:
- make release-windows
- mv /build/* $(DIST)/binaries
depends_on: [ before-static-build ]
- name: static-build-linux
image: karalabe/xgo-latest:latest
pull: true
environment:
TAGS: bindata sqlite
GOPATH: /srv/app
commands:
- make release-linux
- mv /build/* $(DIST)/binaries
depends_on: [ before-static-build ]
- name: static-build-darwin
image: karalabe/xgo-latest:latest
pull: true
environment:
TAGS: bindata sqlite
GOPATH: /srv/app
commands:
- make release-darwin
- mv /build/* $(DIST)/binaries
depends_on: [ before-static-build ]
- name: after-build-static
@ -374,6 +374,49 @@ steps:
target: /${DRONE_TAG##v}/
depends_on: [ sign-release ]
# Build a debian package and push it to our bucket
- name: build-deb
image: kolaente/fpm
pull: true
commands:
- make build-deb
depends_on: [ static-build-linux ]
- name: deb-structure
image: kolaente/reprepro
pull: true
environment:
GPG_PRIVATE_KEY:
from_secret: gpg_privatekey
commands:
- export GPG_TTY=$(tty)
- gpg -qk
- echo "use-agent" >> ~/.gnupg/gpg.conf
- gpgconf --kill gpg-agent
- echo $GPG_PRIVATE_KEY > ~/frederik.gpg
- gpg --import ~/frederik.gpg
- mkdir debian/conf -p
- cp build/reprepro-dist-conf debian/conf/distributions
- make reprepro
depends_on: [ build-deb ]
# Push the releases to our pseudo-s3-bucket
- name: release-deb
image: plugins/s3:1
pull: true
settings:
bucket: vikunja-deb
access_key:
from_secret: aws_access_key_id
secret_key:
from_secret: aws_secret_access_key
endpoint: https://storage.kolaente.de
path_style: true
strip_prefix: debian
source: debian/*
target: /
depends_on: [ deb-structure ]
# Build the docker image and push it to docker hub
- name: docker
image: plugins/docker

View File

@ -48,6 +48,12 @@ else
BINLOCATION := $(DIST)/binaries/$(EXECUTABLE)-$(VERSION)-linux-amd64
endif
ifeq ($(VERSION),master)
PKGVERSION := $(shell git describe --tags --always --abbrev=10 | sed 's/-/+/' | sed 's/^v//' | sed 's/-g/-/')
else
PKGVERSION := $(VERSION)
endif
VERSION := $(shell echo $(VERSION) | sed 's/\//\-/g')
.PHONY: all
@ -110,9 +116,6 @@ release-windows:
go install $(GOFLAGS) github.com/karalabe/xgo; \
fi
xgo -dest $(DIST)/binaries -tags 'netgo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'windows/*' -out vikunja-$(VERSION) .
#ifneq ($(DRONE_WORKSPACE),'')
# mv /build/* $(DIST)/binaries
#endif
.PHONY: release-linux
release-linux:
@ -120,9 +123,6 @@ release-linux:
go install $(GOFLAGS) github.com/karalabe/xgo; \
fi
xgo -dest $(DIST)/binaries -tags 'netgo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'linux/*' -out vikunja-$(VERSION) .
#ifneq ($(DRONE_WORKSPACE),'')
# mv /build/* $(DIST)/binaries
#endif
.PHONY: release-darwin
release-darwin:
@ -130,9 +130,6 @@ release-darwin:
go install $(GOFLAGS) github.com/karalabe/xgo; \
fi
xgo -dest $(DIST)/binaries -tags 'netgo $(TAGS)' -ldflags '$(LDFLAGS)' -targets 'darwin/*' -out vikunja-$(VERSION) .
#ifneq ($(DRONE_WORKSPACE),'')
# mv /build/* $(DIST)/binaries
#endif
.PHONY: release-copy
release-copy:
@ -155,11 +152,11 @@ release-zip:
# Builds a deb package using fpm from a previously created binary (using make build)
.PHONY: build-deb
build-deb:
fpm -s dir -t deb --url https://vikunja.io -n vikunja -v $(VERSION) --license GPLv3 --directories /opt/vikunja --after-install ./build/after-install.sh --description 'Vikunja is an open-source todo application, written in Go. It lets you create lists,tasks and share them via teams or directly between users.' -m maintainers@vikunja.io ./$(BINLOCATION)=/opt/vikunja/vikunja ./templates=/opt/vikunja ./config.yml.sample=/etc/vikunja/config.yml;
fpm -s dir -t deb --url https://vikunja.io -n vikunja -v $(PKGVERSION) --license GPLv3 --directories /opt/vikunja --after-install ./build/after-install.sh --description 'Vikunja is an open-source todo application, written in Go. It lets you create lists,tasks and share them via teams or directly between users.' -m maintainers@vikunja.io ./$(BINLOCATION)=/opt/vikunja/vikunja ./templates=/opt/vikunja ./config.yml.sample=/etc/vikunja/config.yml;
.PHONY: reprepro
reprepro:
reprepro_expect debian includedeb strech ./$(EXECUTABLE)_$(VERSION)_amd64.deb
reprepro_expect debian includedeb strech ./$(EXECUTABLE)_$(PKGVERSION)_amd64.deb
.PHONY: got-swag
got-swag: do-the-swag