Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use goreleaser for building deb packages.
  • Loading branch information
brocaar committed Oct 3, 2018
1 parent c1bd09e commit 5b05e10
Show file tree
Hide file tree
Showing 15 changed files with 137 additions and 234 deletions.
21 changes: 20 additions & 1 deletion .goreleaser.yml
@@ -1,6 +1,8 @@
git:
short_hash: true

project_name: loraserver

builds:
- main: cmd/loraserver/main.go
binary: loraserver
Expand All @@ -22,4 +24,21 @@ builds:
goarch: 386

release:
draft: true
disable: true

nfpm:
vendor: LoRa Server project
homepage: https://www.loraserver.io/
maintainer: Orne Brocaar <info@brocaar.com>
description: LoRa Server
license: MIT
formats:
- deb
bindir: /usr/bin
files:
"packaging/files/loraserver.rotate": "/etc/logrotate.d/loraserver"
"packaging/files/loraserver.init": "/usr/lib/loraserver/scripts/loraserver.init"
"packaging/files/loraserver.service": "/usr/lib/loraserver/scripts/loraserver.service"
scripts:
postinstall: "packaging/scripts/post-install.sh"
postremove: "packaging/scripts/post-remove.sh"
7 changes: 1 addition & 6 deletions .travis.yml
Expand Up @@ -14,15 +14,10 @@ before_deploy:
docker-compose run --rm loraserver make dist;
docker-compose run --rm -e PACKAGE_ARCH=x86_64 loraserver make package-deb;
docker-compose run --rm -e PACKAGE_ARCH=i386 loraserver make package-deb;
docker-compose run --rm -e PACKAGE_ARCH=armhf loraserver make package-deb;
docker-compose run --rm -e PACKAGE_ARCH=arm64 loraserver make package-deb;
mkdir -p dist/upload/tar;
mkdir -p dist/upload/deb;
mv dist/*.tar.gz dist/upload/tar;
mv dist/deb/*.deb dist/upload/deb;
mv dist/*.deb dist/upload/deb;
fi
deploy:
Expand Down
3 changes: 1 addition & 2 deletions Dockerfile-devel
Expand Up @@ -3,8 +3,7 @@ FROM golang:1.11-alpine
ENV PROJECT_PATH=/go/src/github.com/brocaar/loraserver
ENV PATH=$PATH:$PROJECT_PATH/build

RUN apk add --no-cache ca-certificates tzdata make git bash protobuf alpine-sdk ruby ruby-dev libffi-dev
RUN gem install --no-ri --no-rdoc fpm
RUN apk add --no-cache ca-certificates tzdata make git bash protobuf alpine-sdk

RUN mkdir -p $PROJECT_PATH
COPY . $PROJECT_PATH
Expand Down
6 changes: 2 additions & 4 deletions Makefile
Expand Up @@ -24,12 +24,9 @@ test: statics
dist:
@goreleaser

build-snapshot:
snapshot:
@goreleaser --snapshot

package-deb:
@cd packaging && TARGET=deb ./package.sh

api:
@echo "Generating API code from .proto files"
go generate api/gw/gw.go
Expand All @@ -56,6 +53,7 @@ dev-requirements:
go get -u github.com/jteeuwen/go-bindata/...
go get -u github.com/golang/dep/cmd/dep
go get -u github.com/goreleaser/goreleaser
go get -u github.com/goreleaser/nfpm

requirements:
dep ensure -v
Expand Down
2 changes: 1 addition & 1 deletion docs/content/community/source.md
Expand Up @@ -59,5 +59,5 @@ make test
make build

# compile snapshot builds for supported architectures
make build-snapshot
make snapshot
{{< /highlight >}}
14 changes: 8 additions & 6 deletions docs/content/overview/downloads.md
Expand Up @@ -26,12 +26,14 @@ description: Pre-compiled binaries for Windows, MacOS and Linux (tarball and Deb

## Debian / Ubuntu packages

| File name | OS | Arch |
| ----------------------------------------------------------------------------------------------------------------------------------| ------- | ----- |
| [loraserver_{{< version >}}_i386.deb](https://artifacts.loraserver.io/downloads/loraserver/loraserver_{{< version >}}_i386.deb) | Linux | 386 |
| [loraserver_{{< version >}}_amd64.deb](https://artifacts.loraserver.io/downloads/loraserver/loraserver_{{< version >}}_amd64.deb) | Linux | amd64 |
| [loraserver_{{< version >}}_armhf.deb](https://artifacts.loraserver.io/downloads/loraserver/loraserver_{{< version >}}_armhf.deb) | Linux | arm |
| [loraserver_{{< version >}}_arm64.deb](https://artifacts.loraserver.io/downloads/loraserver/loraserver_{{< version >}}_arm64.deb) | Linux | arm64 |
| File name | OS | Arch |
| ----------------------------------------------------------------------------------------------------------------------------------------------| ------- | ----- |
| [loraserver_{{< version >}}_linux_386.deb](https://artifacts.loraserver.io/downloads/loraserver/loraserver_{{< version >}}_linux_386.deb) | Linux | 386 |
| [loraserver_{{< version >}}_linux_amd64.deb](https://artifacts.loraserver.io/downloads/loraserver/loraserver_{{< version >}}_linux_amd64.deb) | Linux | amd64 |
| [loraserver_{{< version >}}_linux_armv5.deb](https://artifacts.loraserver.io/downloads/loraserver/loraserver_{{< version >}}_linux_armv5.deb) | Linux | arm |
| [loraserver_{{< version >}}_linux_armv6.deb](https://artifacts.loraserver.io/downloads/loraserver/loraserver_{{< version >}}_linux_armv6.deb) | Linux | arm |
| [loraserver_{{< version >}}_linux_armv7.deb](https://artifacts.loraserver.io/downloads/loraserver/loraserver_{{< version >}}_linux_armv7.deb) | Linux | arm |
| [loraserver_{{< version >}}_linux_arm64.deb](https://artifacts.loraserver.io/downloads/loraserver/loraserver_{{< version >}}_linux_arm64.deb) | Linux | arm64 |

## Debian / Ubuntu repository

Expand Down
97 changes: 0 additions & 97 deletions packaging/deb/post-install.sh

This file was deleted.

20 changes: 0 additions & 20 deletions packaging/deb/post-uninstall.sh

This file was deleted.

3 changes: 0 additions & 3 deletions packaging/deb/pre-install.sh

This file was deleted.

2 changes: 1 addition & 1 deletion packaging/deb/init.sh → packaging/files/loraserver.init 100755 → 100644
Expand Up @@ -5,7 +5,7 @@
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: LoRaWAN network-server
# Short-Description: LoRa Server
### END INIT INFO


Expand Down
File renamed without changes.
@@ -1,8 +1,8 @@
[Unit]
Description=LoRa Server
Documentation=https://docs.loraserver.io
Documentation=https://www.loraserver.io/
Wants=network-online.target
After=network-online.target redis.service mosquitto.service
After=network-online.target

[Service]
User=loraserver
Expand Down
91 changes: 0 additions & 91 deletions packaging/package.sh

This file was deleted.

0 comments on commit 5b05e10

Please sign in to comment.