Skip to content

Commit

Permalink
Move to synse-sdk v2 (#113)
Browse files Browse the repository at this point in the history
* Move to synse-sdk v2

* Move from jenkins to Github actions

* bump: version 3.4.0
  • Loading branch information
GuessWhoSamFoo authored Aug 12, 2022
1 parent 912a08d commit f207ae2
Show file tree
Hide file tree
Showing 28 changed files with 570 additions and 355 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# These owners will be the default owners for everything in the
# repo. Unless a later match takes precedence, owners listed here
# will be requested for review when someone opens a pull request.
* @edaniszewski
* @GuessWhoSamFoo

# Order is important; the last matching pattern takes the most
# precedence. Additional matches may be added below (e.g. *.py
Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: build
on:
push:
branches:
- '*'
pull_request: {}

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
- run: "go vet ./..."
- name: Lint
uses: dominikh/[email protected]
with:
version: "2022.1.1"
snapshot-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
- name: Set GOLANG_VERSION
run: |
echo "GOLANG_VERSION=$(go version | awk '{ print $3 }')" >> $GITHUB_ENV
- name: Snapshot Build
uses: goreleaser/goreleaser-action@v3
with:
distribution: goreleaser
version: latest
args: release --debug --snapshot --skip-publish --rm-dist
chart-releaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Verify chart-releaser config
uses: vapor-ware/chart-releaser-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: check --skip-env
46 changes: 46 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: release
on:
workflow_run:
workflows: [build]
types:
- completed
push:
tags:
- '*'

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
- name: Set GOLANG_VERSION
run: |
echo "GOLANG_VERSION=$(go version | awk '{ print $3 }')" >> $GITHUB_ENV
-
name: Login to Docker Hub
uses: docker/login-action@v2
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Tagged Release
uses: goreleaser/goreleaser-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
distribution: goreleaser
version: latest
args: release --rm-dist
-
name: Update Helm Chart
uses: vapor-ware/chart-releaser-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: update --diff --debug
16 changes: 0 additions & 16 deletions .jenkins

This file was deleted.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Builder Image
#
FROM docker.io/vaporio/golang:1.13 as builder
FROM docker.io/vaporio/golang:1.16 as builder

#
# Final Image
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
#

PLUGIN_NAME := emulator
PLUGIN_VERSION := 3.3.1
PLUGIN_VERSION := 3.4.0
IMAGE_NAME := vaporio/emulator-plugin
BIN_NAME := synse-emulator-plugin

GIT_COMMIT ?= $(shell git rev-parse --short HEAD 2> /dev/null || true)
GIT_TAG ?= $(shell git describe --tags 2> /dev/null || true)
BUILD_DATE := $(shell date -u +%Y-%m-%dT%T 2> /dev/null)
GO_VERSION := $(shell go version | awk '{ print $$3 }')
GO_VERSION := $(shell go version | awk '{ print $3 }')

PKG_CTX := github.com/vapor-ware/synse-sdk/sdk
LDFLAGS := -w \
Expand Down Expand Up @@ -48,7 +48,7 @@ docker: ## Build the production docker image locally

.PHONY: docker-dev
docker-dev: ## Build the development docker image locally
docker build -f Dockerfile.dev -t ${IMAGE_NAME}:dev-${GIT_COMMIT} . || exit
docker build -f dev.Dockerfile -t ${IMAGE_NAME}:dev-${GIT_COMMIT} . || exit

.PHONY: fmt
fmt: ## Run goimports on all go files
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.dev → dev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# to exec into a contain and dig into whatever may be going on inside.
#

FROM vaporio/golang:1.13
FROM vaporio/golang:1.16

WORKDIR /synse

Expand Down
17 changes: 3 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,20 +1,9 @@
module github.com/vapor-ware/synse-emulator-plugin

go 1.13
go 1.16

require (
github.com/MakeNowJust/heredoc v1.0.0
github.com/creasty/defaults v1.5.1 // indirect
github.com/imdario/mergo v0.3.11 // indirect
github.com/mitchellh/mapstructure v1.4.0 // indirect
github.com/prometheus/client_golang v1.8.0 // indirect
github.com/prometheus/common v0.15.0 // indirect
github.com/sirupsen/logrus v1.7.0
github.com/vapor-ware/synse-sdk v0.1.0-alpha.0.20201202203005-962b9433e02a
golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb // indirect
golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3 // indirect
golang.org/x/text v0.3.4 // indirect
google.golang.org/genproto v0.0.0-20201202151023-55d61f90c1ce // indirect
google.golang.org/grpc v1.33.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
github.com/sirupsen/logrus v1.9.0
github.com/vapor-ware/synse-sdk/v2 v2.1.2
)
Loading

0 comments on commit f207ae2

Please sign in to comment.