Skip to content

Commit

Permalink
Merge pull request #169 from gleanerio/dev
Browse files Browse the repository at this point in the history
Merge dev into master
  • Loading branch information
nein09 authored Mar 16, 2023
2 parents 724c814 + fe5d2ab commit 85a5699
Show file tree
Hide file tree
Showing 164 changed files with 118,583 additions and 26,344 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/docker-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
#goos: [linux, windows, darwin]
goarch: [amd64, arm64]
goos: [linux]
goarch: [amd64, arm64]
exclude:
- goarch: "386"
goos: darwin
Expand All @@ -29,7 +30,10 @@ jobs:
- name: checkout code
uses: actions/checkout@v2
- name: donwload schema
run: curl -O https://schema.org/version/latest/schemaorg-current-https.jsonld
run: curl https://schema.org/version/latest/schemaorg-current-https.jsonld --output assets/schemaorg-current-https.jsonld
- name: donwload schema
run: curl https://schema.org/version/latest/schemaorg-current-http.jsonld --output assets/schemaorg-current-http.jsonld

# - name: Run tests
# run: go test -v -p=1 -timeout=0 ./...
- id: binary
Expand All @@ -49,30 +53,38 @@ jobs:
# - name: Checkout Repo
# uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2
with:
platforms: 'arm64,arm'
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set variables
run: |
VER=$(cat ./VERSION)
echo "VERSION=$VER" >> $GITHUB_ENV
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: nsfearthcube/gleaner
flavor: |
latest=true
suffix=-${{ env.VERSION }}
tags: |
type=ref,event=tag
type=ref,event=branch
type=semver,pattern={{version}}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
file: ./build/Dockerfile
Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
#goos: [linux, windows, darwin]
#goarch: [amd64,arm64]
goos: [linux]
goarch: [amd64]
goarch: [amd64, arm64]
exclude:
- goarch: "386"
goos: darwin
Expand All @@ -32,7 +32,10 @@ jobs:
- name: checkout code
uses: actions/checkout@v2
- name: donwload schema
run: curl -O https://schema.org/version/latest/schemaorg-current-https.jsonld
run: curl https://schema.org/version/latest/schemaorg-current-https.jsonld --output assets/schemaorg-current-https.jsonld
- name: donwload schema
run: curl https://schema.org/version/latest/schemaorg-current-http.jsonld --output assets/schemaorg-current-http.jsonld

# - name: Run tests
# run: go test -v -p=1 -timeout=0 ./...
- id: binary
Expand All @@ -52,9 +55,11 @@ jobs:
# - name: Checkout Repo
# uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2
with:
platforms: 'arm64,arm'
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v1
with:
Expand All @@ -73,9 +78,10 @@ jobs:
type=semver,pattern={{version}}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
file: ./build/Dockerfile
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/release_gleaner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
releases-matrix:
name: Release Go Binary
name: Release gleaner Go Binary
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -21,8 +21,11 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: donwload schema
run: curl -O https://schema.org/version/latest/schemaorg-current-https.jsonld
# - name: Run tests
run: curl https://schema.org/version/latest/schemaorg-current-https.jsonld --output assets/schemaorg-current-https.jsonld
- name: donwload schema
run: curl https://schema.org/version/latest/schemaorg-current-http.jsonld --output assets/schemaorg-current-http.jsonld

# - name: Run tests
# run: go test -v -p=1 -timeout=0 ./...
- uses: wangyoucao577/[email protected]
with:
Expand All @@ -31,6 +34,6 @@ jobs:
goarch: ${{ matrix.goarch }}
project_path: "./cmd/gleaner"
binary_name: "gleaner"
ldflags: "-s -w"
extra_files: README.md docs/ configs/ scripts/ schemaorg-current-https.jsonld
ldflags: "-s -w -X main.VERSION=${{ env.VERSION }}"
extra_files: README.md docs/ configs/ scripts/ assets/
# extra_files: LICENSE README.md
16 changes: 11 additions & 5 deletions .github/workflows/release_gleaner_v3.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Release Gleaner Console binaries
name: Release Gleaner Console (glcon) binaries

on:
release:
types: [published]

jobs:
releases-matrix:
name: Release Go Binary
name: Release glcon Gleaner Console Go Binary
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -21,16 +21,22 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: donwload schema
run: curl -O https://schema.org/version/latest/schemaorg-current-https.jsonld
run: curl https://schema.org/version/latest/schemaorg-current-https.jsonld --output assets/schemaorg-current-https.jsonld
- name: donwload schema
run: curl https://schema.org/version/latest/schemaorg-current-http.jsonld --output assets/schemaorg-current-http.jsonld
# - name: Run tests
# run: go test -v -p=1 -timeout=0 ./...
- name: Set variables
run: |
VER=$(cat VERSION)
echo "VERSION=$VER" >> $GITHUB_ENV
- uses: wangyoucao577/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
project_path: "./cmd/glcon"
binary_name: "glcon"
ldflags: "-s -w"
extra_files: README.md docs/ configs/ scripts/ schemaorg-current-https.jsonld
ldflags: "-s -w -X main.VERSION=${{ env.VERSION }}"
extra_files: README.md docs/ configs/ scripts/ assets/
# extra_files: LICENSE README.md
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ configs/local/
*.log
**/*.log
**/credentials/
.idea

/configs/wifire/
26 changes: 26 additions & 0 deletions DEVELOPER.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

# Developer notes

# glcon
glcon integrates gleaner and nabu to make a single env

## integrating with local nabu
[see article](https://levelup.gitconnected.com/import-and-use-local-packages-in-your-go-application-885c35e5624)

`require (
....
github.com/gleanerio/nabu v0.0.0-20211214151422-eda9e525f196
...
}

replace (
github.com/gleanerio/nabu v0.0.0-20211214151422-eda9e525f196 => ../nabu
)`

REMOVE WHEN COMMITTING FOR A PULL REQUEST


## update nabu dependency
if nabu code has been updated, the you need to update the dependency
`go get -u github.com/gleanerio/nabu`

36 changes: 27 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,39 +1,57 @@
BINARY := gleaner
BINARYIO := glcon
VERSION :=`cat VERSION`
MAINVERSION :=`cat ../../VERSION`
.DEFAULT_GOAL := gleaner

gleaner:
cd cmd/$(BINARY) ; \
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 env go build -o $(BINARY)
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 env go build -ldflags "-X main.VERSION=$(MAINVERSION)" -o $(BINARY);\
cp $(BINARY) ../../


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

gleaner.darwin:
cd cmd/$(BINARY) ; \
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 env go build -o $(BINARY)_darwin
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 env go build -ldflags "-X main.VERSION=$(MAINVERSION)" -o $(BINARY)_darwin;\
cp $(BINARY)_darwin ../../

gleaner.m2:
cd cmd/$(BINARY) ; \
GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 env go build -ldflags "-X main.VERSION=$(MAINVERSION)" -o $(BINARY)_m2;\
cp $(BINARY)_m2 ../../

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

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

glcon.darwin:
cd cmd/$(BINARYIO) ; \
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 env go build -o $(BINARYIO)_darwin
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 env go build -ldflags "-X main.VERSION=$(MAINVERSION)" -o $(BINARYIO)_darwin ;\
cp $(BINARYIO)_darwin ../../

glcon.m2:
cd cmd/$(BINARYIO) ; \
GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 env go build -ldflags "-X main.VERSION=$(MAINVERSION)" -o $(BINARYIO)_m2;\
cp $(BINARYIO)_m2 ../../

releases: gleaner gleaner.exe gleaner.darwin glcon glcon.exe glcon.darwin
releases: gleaner gleaner.exe gleaner.darwin gleaner.m2 glcon glcon.exe glcon.darwin glcon.m2

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

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

dockerpush:
podman push localhost/nsfearthcube/gleaner:$(VERSION) fils/gleaner:$(VERSION)
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ union followed by a
go mod tidy
```

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

### Branches

Expand Down Expand Up @@ -95,5 +96,8 @@ visit:
* https://book.oceaninfohub.org/indexing/qstart.html
* https://book.oceaninfohub.org/indexing/cliDocker/README.html

For the best documentation on using Gleaner at this time.
For the best documentation on using Gleaner at this time.

## Unit tests

There are some unit tests here; to run them, you can do `go test -v ./...`
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v3.0.2-developement
v3.0.8
Loading

0 comments on commit 85a5699

Please sign in to comment.