Skip to content

Commit ded3ac8

Browse files
authored
fixed Dockerfile, fixed goreleaser. Jumped to 3 digits version (#506)
1 parent 70624b5 commit ded3ac8

File tree

4 files changed

+19
-30
lines changed

4 files changed

+19
-30
lines changed

config/config.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package config
22

3-
const Version = "heplify-server 1.58"
3+
const Version = "heplify-server 1.59.1"
44

55
var Setting HeplifyServer
66

docker/Dockerfile

+7-11
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,11 @@
22

33
FROM golang:alpine as builder
44

5-
RUN apk update && apk add --no-cache git build-base
6-
7-
RUN git clone https://luajit.org/git/luajit-2.0.git \
8-
&& cd luajit-2.0 \
9-
&& make CCOPT="-static -fPIC" BUILDMODE="static" && make install
10-
11-
RUN go get -u -d -v github.com/sipcapture/heplify-server/...
12-
WORKDIR /go/src/github.com/sipcapture/heplify-server/cmd/heplify-server/
13-
RUN CGO_ENABLED=1 GOOS=linux go build -a --ldflags '-linkmode external -extldflags "-static -s -w"' -o heplify-server .
5+
RUN apk update && apk add --no-cache git build-base luajit-dev
6+
RUN go install github.com/sipcapture/heplify-server/cmd/heplify-server@latest
7+
#workaround for latest version
8+
WORKDIR /go/pkg/mod/github.com/sipcapture/
9+
RUN ln -s `ls -ltd hepl* | tail -1 | awk '{print $9}'` heplify-server@latest
1410

1511
FROM alpine:latest
1612

@@ -19,5 +15,5 @@ RUN apk --no-cache add ca-certificates
1915
RUN apk upgrade
2016

2117
WORKDIR /root/
22-
COPY --from=builder /go/src/github.com/sipcapture/heplify-server/cmd/heplify-server/heplify-server .
23-
COPY --from=builder /go/src/github.com/sipcapture/heplify-server/scripts ./scripts
18+
COPY --from=builder /go/bin/heplify-server .
19+
COPY --from=builder /go/pkg/mod/github.com/sipcapture/heplify-server@latest/scripts ./scripts

example/heplify-server.yaml

+10-16
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,13 @@ description: |
1717
vendor: "QXIP"
1818
homepage: "http://qxip.net"
1919
license: "AGPLv3"
20-
bindir: "/usr/local/bin"
21-
files:
22-
/tmp/pkg/heplify-server: "/usr/local/bin/heplify-server"
23-
config_files:
24-
/tmp/pkg/example/heplify-server.service: "/lib/systemd/system/heplify-server.service"
25-
/tmp/pkg/example/homer7_config/heplify-server.toml: "/etc/heplify-server.toml"
26-
#overrides:
27-
# rpm:
28-
# scripts:
29-
# preinstall: ./scripts/preinstall.sh
30-
# postremove: ./scripts/postremove.sh
31-
# deb:
32-
# scripts:
33-
# postinstall: ./scripts/postinstall.sh
34-
# preremove: ./scripts/preremove.sh
35-
20+
contents:
21+
# Basic file that applies to all packagers
22+
- src: /tmp/pkg/heplify-server
23+
dst: /usr/local/bin/heplify-server
24+
# Simple config file
25+
- src: /tmp/pkg/example/heplify-server.service
26+
dst: /lib/systemd/system/heplify-server.service
27+
- src: /tmp/pkg/example/homer7_config/heplify-server.toml
28+
dst: /etc/heplify-server.toml
29+
type: config

scripts/build_package.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
VERSION=$($PWD/heplify-server --version | grep "VERSION:" | grep -Po '\d.\d+')
3+
VERSION=$($PWD/heplify-server --version | grep "VERSION:" | grep -Po '\d.\d+.\d+')
44
PACKAGE=${PACKAGE:-"heplify-server"}
55
RELEASE=${VERSION:-"1.1.4"}
66
ARCH=${ARCH:-"amd64"}
@@ -25,4 +25,3 @@ docker run --rm \
2525
-v $PWD:/tmp/pkg \
2626
-e VERSION="$RELEASE" \
2727
goreleaser/nfpm pkg --config /tmp/pkg/example/$PACKAGE.yaml --target "/tmp/pkg/$PACKAGE-$RELEASE-$ARCH.$EXT"
28-

0 commit comments

Comments
 (0)