Skip to content

Commit 8dec666

Browse files
committed
Add goreleaser build steps.
1 parent 52f9104 commit 8dec666

File tree

6 files changed

+62
-0
lines changed

6 files changed

+62
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ chirpstack-v3-to-v4
44
# Hidden files
55
.*
66
!.gitignore
7+
!.goreleaser.yaml
78

89
# Config files
910
*.toml
11+
12+
dist/

.goreleaser.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
project_name: chirpstack-v3-to-v4
2+
3+
builds:
4+
-
5+
main: main.go
6+
binary: chirpstack-v3-to-v4
7+
env:
8+
- CGO_ENABLED=0
9+
goos:
10+
- linux
11+
goarch:
12+
- amd64
13+
- arm
14+
- arm64
15+
goarm:
16+
- 7
17+
checksum:
18+
name_template: 'checksums.txt'
19+
snapshot:
20+
name_template: "{{ incpatch .Version }}-next"
21+
release:
22+
disable: true

Dockerfile-devel

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM golang:1.18-alpine
2+
3+
ENV PROJECT_PATH=/chirpstack-v3-to-v4
4+
5+
RUN apk add --no-cache make git bash
6+
RUN go install github.com/goreleaser/goreleaser@latest
7+
RUN git config --global --add safe.directory $PROJECT_PATH
8+
9+
RUN mkdir -p $PROJECT_PATH
10+
WORKDIR $PROJECT_PATH

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,9 @@ build:
66
proto:
77
protoc --go_out=. --go_opt=paths=source_relative pbold/pb.proto
88
protoc --go_out=. --go_opt=paths=source_relative pbnew/pb.proto
9+
10+
release:
11+
docker-compose run --rm chirpstack-v3-to-v4 goreleaser
12+
13+
snapshot:
14+
docker-compose run --rm chirpstack-v3-to-v4 goreleaser --snapshot

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,17 @@ Usage example:
2929

3030
**Warning:** only run this against an empty ChirpStack v4 database as this utilty
3131
will drop all tenants and users from the ChirpStack v4 database.
32+
33+
## Building from source
34+
35+
For creating a snapshot release:
36+
37+
```
38+
make snapshot
39+
```
40+
41+
For creating a release:
42+
43+
```
44+
make release
45+
```

docker-compose.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
services:
2+
chirpstack-v3-to-v4:
3+
build:
4+
context: .
5+
dockerfile: Dockerfile-devel
6+
volumes:
7+
- ./:/chirpstack-v3-to-v4

0 commit comments

Comments
 (0)