Skip to content

Commit

Permalink
Reset redis and scylla
Browse files Browse the repository at this point in the history
  • Loading branch information
maeb committed Mar 15, 2023
1 parent 69a4530 commit 36ecec1
Show file tree
Hide file tree
Showing 15 changed files with 1,399 additions and 282 deletions.
58 changes: 0 additions & 58 deletions .github/workflows/dockerimage.yml

This file was deleted.

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:
push:
branches:
- main
tags:
- v*

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}}
type=ref,event=branch
- name: Log in to the container registry
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
# IntelliJ
.idea/

# binary
veidemann-reset
27 changes: 17 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
FROM docker.io/golang:latest as golang
FROM docker.io/golang:1.19 as golang

WORKDIR /build

COPY . .
COPY go.mod .
COPY go.sum .

RUN go mod download

RUN mkdir -p /out
COPY . .

# Cache builds without version info
RUN go build -mod readonly -o /out/veidemann-reset -ldflags "-s -w"
# Cache build without version info
# -trimpath remove file system paths from executable
# -ldflags arguments passed to go tool link:
# -s disable symbol table
# -w disable DWARF generation
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -mod readonly -trimpath -ldflags "-s -w"

ARG VERSION
RUN go build -mod readonly -o /out/veidemann-reset \
-ldflags "-s -w -X github.com/nlnwa/veidemann-reset/pkg/version.Version=${VERSION:-$(git describe --tags --always)}"
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -mod readonly -trimpath \
-ldflags "-s -w -X github.com/nlnwa/veidemann-reset/internal/version.Version=${VERSION:-$(git describe --tags --always)}"


FROM gcr.io/distroless/base
FROM gcr.io/distroless/base-debian11

COPY LICENSE /LICENSE

COPY --from=golang /out /out
COPY --from=golang /build/veidemann-reset /veidemann-reset

ENTRYPOINT ["/out/veidemann-reset"]
ENTRYPOINT ["/veidemann-reset"]
39 changes: 17 additions & 22 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,22 @@ module github.com/nlnwa/veidemann-reset
go 1.14

require (
github.com/bitly/go-hostpool v0.1.0 // indirect
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/golang/protobuf v1.4.3 // indirect
github.com/magiconair/properties v1.8.4 // indirect
github.com/mitchellh/mapstructure v1.3.3 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pelletier/go-toml v1.8.1 // indirect
github.com/sirupsen/logrus v1.7.0 // indirect
github.com/spf13/afero v1.4.1 // indirect
github.com/spf13/cast v1.3.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/go-redis/redis v6.15.9+incompatible
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.7.1
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 // indirect
golang.org/x/net v0.0.0-20201031054903-ff519b6c9102 // indirect
golang.org/x/sys v0.0.0-20201107080550-4d91cf3a1aaf // indirect
golang.org/x/text v0.3.4 // indirect
google.golang.org/protobuf v1.25.0 // indirect
gopkg.in/ini.v1 v1.62.0 // indirect
gopkg.in/rethinkdb/rethinkdb-go.v5 v5.0.1
gopkg.in/yaml.v2 v2.3.0 // indirect
github.com/spf13/viper v1.15.0
gopkg.in/rethinkdb/rethinkdb-go.v6 v6.2.2
)

require (
github.com/gocql/gocql v1.3.1
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pelletier/go-toml/v2 v2.0.7 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/spf13/afero v1.9.5 // indirect
golang.org/x/crypto v0.7.0 // indirect
google.golang.org/protobuf v1.29.1 // indirect
)

replace github.com/gocql/gocql => github.com/scylladb/gocql v1.7.3
Loading

0 comments on commit 36ecec1

Please sign in to comment.