mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-01-09 00:55:32 +00:00
Version from file
This commit is contained in:
parent
ce5d4edca5
commit
ef3fba75a9
4 changed files with 11 additions and 6 deletions
12
Makefile
12
Makefile
|
@ -1,4 +1,6 @@
|
||||||
SHA := $(shell git rev-parse --short HEAD)
|
SHA := $(shell git rev-parse --short HEAD)
|
||||||
|
VERSION := $(shell cat VERSION)
|
||||||
|
ITTERATION := $(shell date +%s)
|
||||||
|
|
||||||
all: build
|
all: build
|
||||||
|
|
||||||
|
@ -23,8 +25,8 @@ test_postgres:
|
||||||
build:
|
build:
|
||||||
mkdir -p packaging/output
|
mkdir -p packaging/output
|
||||||
mkdir -p packaging/root/usr/local/bin
|
mkdir -p packaging/root/usr/local/bin
|
||||||
go build -o packaging/root/usr/local/bin/drone -ldflags "-X main.revision $(SHA)" github.com/drone/drone/cli
|
go build -o packaging/root/usr/local/bin/drone -ldflags "-X main.revision $(SHA) -X main.version $(VERSION)" github.com/drone/drone/cli
|
||||||
go build -o packaging/root/usr/local/bin/droned -ldflags "-X main.revision $(SHA)" github.com/drone/drone/server
|
go build -o packaging/root/usr/local/bin/droned -ldflags "-X main.revision $(SHA) -X main.version $(VERSION)" github.com/drone/drone/server
|
||||||
|
|
||||||
install:
|
install:
|
||||||
install -t /usr/local/bin packaging/root/usr/local/bin/drone
|
install -t /usr/local/bin packaging/root/usr/local/bin/drone
|
||||||
|
@ -52,9 +54,10 @@ embed:
|
||||||
# creates a debian package for drone to install
|
# creates a debian package for drone to install
|
||||||
# `sudo dpkg -i drone.deb`
|
# `sudo dpkg -i drone.deb`
|
||||||
deb:
|
deb:
|
||||||
fpm -s dir -t deb -n drone -v 0.3 -p packaging/output/drone.deb \
|
fpm -s dir -t deb -n drone -v $(VERSION) -p packaging/output/drone.deb \
|
||||||
--deb-priority optional --category admin \
|
--deb-priority optional --category admin \
|
||||||
--force \
|
--force \
|
||||||
|
--iteration $(ITTERATION) \
|
||||||
--deb-compression bzip2 \
|
--deb-compression bzip2 \
|
||||||
--after-install packaging/scripts/postinst.deb \
|
--after-install packaging/scripts/postinst.deb \
|
||||||
--before-remove packaging/scripts/prerm.deb \
|
--before-remove packaging/scripts/prerm.deb \
|
||||||
|
@ -68,9 +71,10 @@ deb:
|
||||||
packaging/root/=/
|
packaging/root/=/
|
||||||
|
|
||||||
rpm:
|
rpm:
|
||||||
fpm -s dir -t rpm -n drone -v 0.3 -p packaging/output/drone.rpm \
|
fpm -s dir -t rpm -n drone -v $(VERSION) -p packaging/output/drone.rpm \
|
||||||
--rpm-compression bzip2 --rpm-os linux \
|
--rpm-compression bzip2 --rpm-os linux \
|
||||||
--force \
|
--force \
|
||||||
|
--iteration $(ITTERATION) \
|
||||||
--after-install packaging/scripts/postinst.rpm \
|
--after-install packaging/scripts/postinst.rpm \
|
||||||
--before-remove packaging/scripts/prerm.rpm \
|
--before-remove packaging/scripts/prerm.rpm \
|
||||||
--after-remove packaging/scripts/postrm.rpm \
|
--after-remove packaging/scripts/postrm.rpm \
|
||||||
|
|
1
VERSION
Normal file
1
VERSION
Normal file
|
@ -0,0 +1 @@
|
||||||
|
0.3.0-alpha
|
|
@ -7,7 +7,7 @@ import (
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// commit sha for the current build.
|
// commit sha for the current build.
|
||||||
version string = "0.3-dev"
|
version string
|
||||||
revision string
|
revision string
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ const (
|
||||||
var (
|
var (
|
||||||
// commit sha for the current build, set by
|
// commit sha for the current build, set by
|
||||||
// the compile process.
|
// the compile process.
|
||||||
version string = "0.3-dev"
|
version string
|
||||||
revision string
|
revision string
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue