Skip to content

Commit 85a5699

Browse files
authored
Merge pull request #169 from gleanerio/dev
Merge dev into master
2 parents 724c814 + fe5d2ab commit 85a5699

File tree

164 files changed

+118583
-26344
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+118583
-26344
lines changed

.github/workflows/docker-dev.yml

+16-4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
#goos: [linux, windows, darwin]
2121
goarch: [amd64, arm64]
2222
goos: [linux]
23+
goarch: [amd64, arm64]
2324
exclude:
2425
- goarch: "386"
2526
goos: darwin
@@ -29,7 +30,10 @@ jobs:
2930
- name: checkout code
3031
uses: actions/checkout@v2
3132
- name: donwload schema
32-
run: curl -O https://schema.org/version/latest/schemaorg-current-https.jsonld
33+
run: curl https://schema.org/version/latest/schemaorg-current-https.jsonld --output assets/schemaorg-current-https.jsonld
34+
- name: donwload schema
35+
run: curl https://schema.org/version/latest/schemaorg-current-http.jsonld --output assets/schemaorg-current-http.jsonld
36+
3337
# - name: Run tests
3438
# run: go test -v -p=1 -timeout=0 ./...
3539
- id: binary
@@ -49,30 +53,38 @@ jobs:
4953
# - name: Checkout Repo
5054
# uses: actions/checkout@v2
5155
- name: Set up QEMU
52-
uses: docker/setup-qemu-action@v1
56+
uses: docker/setup-qemu-action@v2
57+
with:
58+
platforms: 'arm64,arm'
5359
- name: Set up Docker Buildx
5460
uses: docker/setup-buildx-action@v1
5561
- name: Login to DockerHub
56-
uses: docker/login-action@v1
62+
uses: docker/login-action@v2
5763
with:
5864
username: ${{ secrets.DOCKERHUB_USERNAME }}
5965
password: ${{ secrets.DOCKERHUB_TOKEN }}
66+
- name: Set variables
67+
run: |
68+
VER=$(cat ./VERSION)
69+
echo "VERSION=$VER" >> $GITHUB_ENV
6070
- name: Extract metadata (tags, labels) for Docker
6171
id: meta
6272
uses: docker/metadata-action@v3
6373
with:
6474
images: nsfearthcube/gleaner
6575
flavor: |
6676
latest=true
77+
suffix=-${{ env.VERSION }}
6778
tags: |
6879
type=ref,event=tag
6980
type=ref,event=branch
7081
type=semver,pattern={{version}}
7182
- name: Build and push
7283
id: docker_build
73-
uses: docker/build-push-action@v2
84+
uses: docker/build-push-action@v3
7485
with:
7586
push: true
87+
platforms: linux/amd64,linux/arm64
7688
tags: ${{ steps.meta.outputs.tags }}
7789
labels: ${{ steps.meta.outputs.labels }}
7890
file: ./build/Dockerfile

.github/workflows/docker.yml

+11-5
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
#goos: [linux, windows, darwin]
2323
#goarch: [amd64,arm64]
2424
goos: [linux]
25-
goarch: [amd64]
25+
goarch: [amd64, arm64]
2626
exclude:
2727
- goarch: "386"
2828
goos: darwin
@@ -32,7 +32,10 @@ jobs:
3232
- name: checkout code
3333
uses: actions/checkout@v2
3434
- name: donwload schema
35-
run: curl -O https://schema.org/version/latest/schemaorg-current-https.jsonld
35+
run: curl https://schema.org/version/latest/schemaorg-current-https.jsonld --output assets/schemaorg-current-https.jsonld
36+
- name: donwload schema
37+
run: curl https://schema.org/version/latest/schemaorg-current-http.jsonld --output assets/schemaorg-current-http.jsonld
38+
3639
# - name: Run tests
3740
# run: go test -v -p=1 -timeout=0 ./...
3841
- id: binary
@@ -52,9 +55,11 @@ jobs:
5255
# - name: Checkout Repo
5356
# uses: actions/checkout@v2
5457
- name: Set up QEMU
55-
uses: docker/setup-qemu-action@v1
58+
uses: docker/setup-qemu-action@v2
59+
with:
60+
platforms: 'arm64,arm'
5661
- name: Set up Docker Buildx
57-
uses: docker/setup-buildx-action@v1
62+
uses: docker/setup-buildx-action@v2
5863
- name: Login to DockerHub
5964
uses: docker/login-action@v1
6065
with:
@@ -73,9 +78,10 @@ jobs:
7378
type=semver,pattern={{version}}
7479
- name: Build and push
7580
id: docker_build
76-
uses: docker/build-push-action@v2
81+
uses: docker/build-push-action@v3
7782
with:
7883
push: true
84+
platforms: linux/amd64,linux/arm64
7985
tags: ${{ steps.meta.outputs.tags }}
8086
labels: ${{ steps.meta.outputs.labels }}
8187
file: ./build/Dockerfile

.github/workflows/release_gleaner.yml

+8-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66

77
jobs:
88
releases-matrix:
9-
name: Release Go Binary
9+
name: Release gleaner Go Binary
1010
runs-on: ubuntu-latest
1111
strategy:
1212
matrix:
@@ -21,8 +21,11 @@ jobs:
2121
steps:
2222
- uses: actions/checkout@v2
2323
- name: donwload schema
24-
run: curl -O https://schema.org/version/latest/schemaorg-current-https.jsonld
25-
# - name: Run tests
24+
run: curl https://schema.org/version/latest/schemaorg-current-https.jsonld --output assets/schemaorg-current-https.jsonld
25+
- name: donwload schema
26+
run: curl https://schema.org/version/latest/schemaorg-current-http.jsonld --output assets/schemaorg-current-http.jsonld
27+
28+
# - name: Run tests
2629
# run: go test -v -p=1 -timeout=0 ./...
2730
- uses: wangyoucao577/[email protected]
2831
with:
@@ -31,6 +34,6 @@ jobs:
3134
goarch: ${{ matrix.goarch }}
3235
project_path: "./cmd/gleaner"
3336
binary_name: "gleaner"
34-
ldflags: "-s -w"
35-
extra_files: README.md docs/ configs/ scripts/ schemaorg-current-https.jsonld
37+
ldflags: "-s -w -X main.VERSION=${{ env.VERSION }}"
38+
extra_files: README.md docs/ configs/ scripts/ assets/
3639
# extra_files: LICENSE README.md

.github/workflows/release_gleaner_v3.yml

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
name: Release Gleaner Console binaries
1+
name: Release Gleaner Console (glcon) binaries
22

33
on:
44
release:
55
types: [published]
66

77
jobs:
88
releases-matrix:
9-
name: Release Go Binary
9+
name: Release glcon Gleaner Console Go Binary
1010
runs-on: ubuntu-latest
1111
strategy:
1212
matrix:
@@ -21,16 +21,22 @@ jobs:
2121
steps:
2222
- uses: actions/checkout@v2
2323
- name: donwload schema
24-
run: curl -O https://schema.org/version/latest/schemaorg-current-https.jsonld
24+
run: curl https://schema.org/version/latest/schemaorg-current-https.jsonld --output assets/schemaorg-current-https.jsonld
25+
- name: donwload schema
26+
run: curl https://schema.org/version/latest/schemaorg-current-http.jsonld --output assets/schemaorg-current-http.jsonld
2527
# - name: Run tests
2628
# run: go test -v -p=1 -timeout=0 ./...
29+
- name: Set variables
30+
run: |
31+
VER=$(cat VERSION)
32+
echo "VERSION=$VER" >> $GITHUB_ENV
2733
- uses: wangyoucao577/[email protected]
2834
with:
2935
github_token: ${{ secrets.GITHUB_TOKEN }}
3036
goos: ${{ matrix.goos }}
3137
goarch: ${{ matrix.goarch }}
3238
project_path: "./cmd/glcon"
3339
binary_name: "glcon"
34-
ldflags: "-s -w"
35-
extra_files: README.md docs/ configs/ scripts/ schemaorg-current-https.jsonld
40+
ldflags: "-s -w -X main.VERSION=${{ env.VERSION }}"
41+
extra_files: README.md docs/ configs/ scripts/ assets/
3642
# extra_files: LICENSE README.md

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ configs/local/
1111
*.log
1212
**/*.log
1313
**/credentials/
14+
.idea
1415

16+
/configs/wifire/

DEVELOPER.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
2+
# Developer notes
3+
4+
# glcon
5+
glcon integrates gleaner and nabu to make a single env
6+
7+
## integrating with local nabu
8+
[see article](https://levelup.gitconnected.com/import-and-use-local-packages-in-your-go-application-885c35e5624)
9+
10+
`require (
11+
....
12+
github.com/gleanerio/nabu v0.0.0-20211214151422-eda9e525f196
13+
...
14+
}
15+
16+
replace (
17+
github.com/gleanerio/nabu v0.0.0-20211214151422-eda9e525f196 => ../nabu
18+
)`
19+
20+
REMOVE WHEN COMMITTING FOR A PULL REQUEST
21+
22+
23+
## update nabu dependency
24+
if nabu code has been updated, the you need to update the dependency
25+
`go get -u github.com/gleanerio/nabu`
26+

Makefile

+27-9
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,57 @@
11
BINARY := gleaner
22
BINARYIO := glcon
33
VERSION :=`cat VERSION`
4+
MAINVERSION :=`cat ../../VERSION`
45
.DEFAULT_GOAL := gleaner
56

67
gleaner:
78
cd cmd/$(BINARY) ; \
8-
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 env go build -o $(BINARY)
9+
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 env go build -ldflags "-X main.VERSION=$(MAINVERSION)" -o $(BINARY);\
10+
cp $(BINARY) ../../
11+
912

1013
gleaner.exe:
1114
cd cmd/$(BINARY) ; \
12-
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 env go build -o $(BINARY).exe
15+
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 env go build -ldflags "-X main.VERSION=$(MAINVERSION)" -o $(BINARY).exe;\
16+
cp $(BINARY).exe ../../
1317

1418
gleaner.darwin:
1519
cd cmd/$(BINARY) ; \
16-
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 env go build -o $(BINARY)_darwin
20+
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 env go build -ldflags "-X main.VERSION=$(MAINVERSION)" -o $(BINARY)_darwin;\
21+
cp $(BINARY)_darwin ../../
22+
23+
gleaner.m2:
24+
cd cmd/$(BINARY) ; \
25+
GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 env go build -ldflags "-X main.VERSION=$(MAINVERSION)" -o $(BINARY)_m2;\
26+
cp $(BINARY)_m2 ../../
1727

1828
glcon:
1929
cd cmd/$(BINARYIO) ; \
20-
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 env go build -o $(BINARYIO)
30+
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 env go build -ldflags "-X main.VERSION=$(MAINVERSION)" -o $(BINARYIO);\
31+
cp $(BINARYIO) ../../
2132

2233
glcon.exe:
2334
cd cmd/$(BINARYIO) ; \
24-
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 env go build -o $(BINARYIO).exe
35+
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 env go build -ldflags "-X main.VERSION=$(MAINVERSION)" -o $(BINARYIO).exe;\
36+
cp $(BINARYIO).exe ../../
2537

2638
glcon.darwin:
2739
cd cmd/$(BINARYIO) ; \
28-
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 env go build -o $(BINARYIO)_darwin
40+
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 env go build -ldflags "-X main.VERSION=$(MAINVERSION)" -o $(BINARYIO)_darwin ;\
41+
cp $(BINARYIO)_darwin ../../
42+
43+
glcon.m2:
44+
cd cmd/$(BINARYIO) ; \
45+
GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 env go build -ldflags "-X main.VERSION=$(MAINVERSION)" -o $(BINARYIO)_m2;\
46+
cp $(BINARYIO)_m2 ../../
2947

30-
releases: gleaner gleaner.exe gleaner.darwin glcon glcon.exe glcon.darwin
48+
releases: gleaner gleaner.exe gleaner.darwin gleaner.m2 glcon glcon.exe glcon.darwin glcon.m2
3149

3250
docker:
3351
podman build --tag="nsfearthcube/gleaner:$(VERSION)" --file=./build/Dockerfile .
3452

35-
docker.darwin:
36-
docker build --tag="nsfearthcube/gleaner:$(VERSION)" --file=./build/Dockerfile .
53+
docker.multiarch: gleaner
54+
docker buildx build --no-cache --pull --platform=linux/arm64,linux/amd64 --push -t nsfearthcube/gleaner:$(VERSION) --file=./build/Dockerfile .
3755

3856
dockerpush:
3957
podman push localhost/nsfearthcube/gleaner:$(VERSION) fils/gleaner:$(VERSION)

README.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ union followed by a
6565
go mod tidy
6666
```
6767

68-
following the merge.
68+
following the merge. Once you have resolved the conflict and done
69+
tidy can add, if needed, the go.mod and go.sum files and commit.
6970

7071
### Branches
7172

@@ -95,5 +96,8 @@ visit:
9596
* https://book.oceaninfohub.org/indexing/qstart.html
9697
* https://book.oceaninfohub.org/indexing/cliDocker/README.html
9798

98-
For the best documentation on using Gleaner at this time.
99+
For the best documentation on using Gleaner at this time.
99100

101+
## Unit tests
102+
103+
There are some unit tests here; to run them, you can do `go test -v ./...`

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v3.0.2-developement
1+
v3.0.8

0 commit comments

Comments
 (0)