-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6e0cd95
commit 69a2a21
Showing
15 changed files
with
310 additions
and
314 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# For details, see the GoReleaser documentation at http://goreleaser.com | ||
project_name: sandbox-plugin | ||
before: | ||
hooks: | ||
- go clean -v | ||
- rm -rf dist | ||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
ldflags: | ||
- -w | ||
- -X github.com/vapor-ware/sandbox-plugin/vendor/github.com/vapor-ware/synse-sdk/sdk.BuildDate={{ .Date }} | ||
- -X github.com/vapor-ware/sandbox-plugin/vendor/github.com/vapor-ware/synse-sdk/sdk.GitCommit={{ .ShortCommit }} | ||
- -X github.com/vapor-ware/sandbox-plugin/vendor/github.com/vapor-ware/synse-sdk/sdk.GitTag={{ .Tag }} | ||
- -X github.com/vapor-ware/sandbox-plugin/vendor/github.com/vapor-ware/synse-sdk/sdk.GoVersion={{ .Env.GOVERSION }} | ||
- -X github.com/vapor-ware/sandbox-plugin/vendor/github.com/vapor-ware/synse-sdk/sdk.PluginVersion={{ .Version }} | ||
goos: | ||
- linux | ||
- darwin | ||
goarch: | ||
- amd64 | ||
archive: | ||
format: tar.gz | ||
checksum: | ||
name_template: 'checksums-{{ .Tag }}.txt' | ||
release: | ||
github: | ||
owner: vapor-ware | ||
name: sandbox-plugin | ||
draft: false | ||
prerelease: auto | ||
name_template: "{{ .Version }}" | ||
dockers: | ||
- | ||
goos: linux | ||
goarch: amd64 | ||
binaries: | ||
- sandbox-plugin | ||
image_templates: | ||
- vaporio/sandbox-plugin:{{ .Tag }} | ||
- vaporio/sandbox-plugin:{{ .Major }} | ||
- vaporio/sandbox-plugin:{{ .Major }}.{{ .Minor }} | ||
- vaporio/sandbox-plugin:latest | ||
build_flag_templates: | ||
- "--label=org.label-schema.version={{ .Version }}" | ||
- "--label=org.label-schema.build-date={{ .Date }}" | ||
- "--label=org.label-schema.vcs-ref={{ .ShortCommit }}" | ||
extra_files: | ||
- config/device/devices.yml | ||
- config/plugin/config.yml | ||
snapshot: | ||
name_template: "{{ .Tag }}-next" | ||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^test:' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,28 @@ | ||
# | ||
# Builder Image | ||
# | ||
FROM vaporio/golang:1.11 as builder | ||
WORKDIR /go/src/github.com/vapor-ware/sandbox-plugin | ||
COPY . . | ||
|
||
# If the vendored dependencies are not present in the docker build context, | ||
# we'll need to do the vendoring prior to building the binary. | ||
RUN if [ ! -d "vendor" ]; then make dep; fi | ||
RUN make build CGO_ENABLED=0 | ||
# | ||
# Final Image | ||
# | ||
FROM scratch | ||
|
||
LABEL org.label-schema.schema-version="1.0" \ | ||
org.label-schema.name="vaporio/sandbox-plugin" \ | ||
org.label-schema.vcs-url="https://github.com/vapor-ware/sandbox-plugin" \ | ||
org.label-schema.vendor="Vapor IO" | ||
|
||
# Plugin Image | ||
FROM scratch | ||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt | ||
COPY --from=builder /go/src/github.com/vapor-ware/sandbox-plugin/build/plugin ./plugin | ||
|
||
# Build the device configurations directly into the image. This is not | ||
# generally advised, but is acceptable here since the plugin is merely | ||
# an example for sandboxing and its config is not tied to anything real. | ||
COPY config/device/devices.yml /etc/synse/plugin/config/device/devices.yml | ||
COPY config/plugin/config.yml /etc/synse/plugin/config/config.yml | ||
|
||
EXPOSE 5002 | ||
# Copy the executable. | ||
COPY sandbox-plugin ./plugin | ||
|
||
EXPOSE 5001 | ||
ENTRYPOINT ["./plugin"] |
Oops, something went wrong.