Skip to content

Commit

Permalink
feat: allow job labels, bump deps, use ghcr.io
Browse files Browse the repository at this point in the history
Do some chores and improve the helm chart.

Signed-off-by: Utku Ozdemir <[email protected]>
  • Loading branch information
utkuozdemir committed Jan 26, 2025
1 parent 9887d25 commit b348afb
Show file tree
Hide file tree
Showing 19 changed files with 192 additions and 106 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/build-rsync-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name: build rsync image

on:
workflow_dispatch: {}
push:
branches:
- master
Expand Down Expand Up @@ -29,10 +30,18 @@ jobs:
with:
username: utkuozdemir
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/[email protected]
with:
context: ./docker/rsync/
platforms: linux/amd64,linux/arm,linux/arm64
push: true
tags: docker.io/utkuozdemir/pv-migrate-rsync:latest
tags: |
docker.io/utkuozdemir/pv-migrate-rsync:latest
ghcr.io/${{ github.repository_owner }}/pv-migrate-rsync:latest
11 changes: 10 additions & 1 deletion .github/workflows/build-sshd-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name: build sshd image

on:
workflow_dispatch: {}
push:
branches:
- master
Expand Down Expand Up @@ -29,10 +30,18 @@ jobs:
with:
username: utkuozdemir
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/[email protected]
with:
context: ./docker/sshd/
platforms: linux/amd64,linux/arm,linux/arm64
push: true
tags: docker.io/utkuozdemir/pv-migrate-sshd:latest
tags: |
docker.io/utkuozdemir/pv-migrate-sshd:latest
ghcr.io/${{ github.repository_owner }}/pv-migrate-sshd:latest
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name: build

on:
workflow_dispatch: {}
push:
branches:
- master
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/release-rsync-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ jobs:
with:
username: utkuozdemir
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set image tag as env variable
run: echo "IMAGE_VERSION=$(echo ${GITHUB_REF#refs/*/} | sed 's/^docker-rsync-//')" >> $GITHUB_ENV
- name: Build and push
Expand All @@ -32,3 +38,5 @@ jobs:
tags: |
docker.io/utkuozdemir/pv-migrate-rsync:latest
docker.io/utkuozdemir/pv-migrate-rsync:${{ env.IMAGE_VERSION }}
ghcr.io/${{ github.repository_owner }}/pv-migrate-rsync:latest
ghcr.io/${{ github.repository_owner }}/pv-migrate-rsync:${{ env.IMAGE_VERSION }}
8 changes: 8 additions & 0 deletions .github/workflows/release-sshd-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ jobs:
with:
username: utkuozdemir
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set image tag as env variable
run: echo "IMAGE_VERSION=$(echo ${GITHUB_REF#refs/*/} | sed 's/^docker-sshd-//')" >> $GITHUB_ENV
- name: Build and push
Expand All @@ -32,3 +38,5 @@ jobs:
tags: |
docker.io/utkuozdemir/pv-migrate-sshd:latest
docker.io/utkuozdemir/pv-migrate-sshd:${{ env.IMAGE_VERSION }}
ghcr.io/${{ github.repository_owner }}/pv-migrate-sshd:latest
ghcr.io/${{ github.repository_owner }}/pv-migrate-sshd:${{ env.IMAGE_VERSION }}
14 changes: 5 additions & 9 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@
linters:
enable-all: true
disable:
# not useful
- exhaustivestruct # pointless
- exhaustruct # pointless
- gomnd # magic numbers are ok mostly
- goerr113 # no need to wrap all errors, too much work
# breaking things: https://github.com/atc0005/go-ci/issues/1024
- depguard
# todo: consider enabling:
- testpackage
- gochecknoglobals
- err113 # no need to wrap all errors, too much work
- depguard # breaking things: https://github.com/atc0005/go-ci/issues/1024
- gochecknoglobals # globals are sometimes ok
- testpackage # todo: consider enabling
- exportloopref # irrelevant since Go 1.23

linters-settings:
gci:
Expand Down
9 changes: 9 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
version: 2
before:
hooks:
- go mod download
Expand Down Expand Up @@ -74,19 +75,22 @@ changelog:
dockers:
- image_templates:
- docker.io/utkuozdemir/pv-migrate:{{ .Tag }}-amd64
- ghcr.io/utkuozdemir/pv-migrate:{{ .Tag }}-amd64
use: buildx
dockerfile: Dockerfile
build_flag_templates:
- --platform=linux/amd64
- image_templates:
- docker.io/utkuozdemir/pv-migrate:{{ .Tag }}-arm64
- ghcr.io/utkuozdemir/pv-migrate:{{ .Tag }}-arm64
use: buildx
goarch: arm64
dockerfile: Dockerfile
build_flag_templates:
- --platform=linux/arm64
- image_templates:
- docker.io/utkuozdemir/pv-migrate:{{ .Tag }}-armv7
- ghcr.io/utkuozdemir/pv-migrate:{{ .Tag }}-armv7
use: buildx
goarch: arm
goarm: "7"
Expand All @@ -100,6 +104,11 @@ docker_manifests:
- docker.io/utkuozdemir/pv-migrate:{{ .Tag }}-amd64
- docker.io/utkuozdemir/pv-migrate:{{ .Tag }}-arm64
- docker.io/utkuozdemir/pv-migrate:{{ .Tag }}-armv7
- name_template: ghcr.io/utkuozdemir/pv-migrate:{{ .Tag }}
image_templates:
- ghcr.io/utkuozdemir/pv-migrate:{{ .Tag }}-amd64
- ghcr.io/utkuozdemir/pv-migrate:{{ .Tag }}-arm64
- ghcr.io/utkuozdemir/pv-migrate:{{ .Tag }}-armv7

# To test docker image push, uncomment the following and run
# goreleaser release --skip-validate --rm-dist --debug
Expand Down
6 changes: 3 additions & 3 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

There are various installation methods for different use cases.

## Using Homebrew (MacOS/Linux)
## Using Homebrew (macOS/Linux)
If you have homebrew, the installation is as simple as:
```bash
brew tap utkuozdemir/pv-migrate
Expand All @@ -26,14 +26,14 @@ $ kubectl krew update
$ kubectl krew install pv-migrate
```

## By downloading the binaries (MacOS/Linux/Windows)
## By downloading the binaries (macOS/Linux/Windows)

1. Go to the [releases](https://github.com/utkuozdemir/pv-migrate/releases) and download
the latest release archive for your platform.
2. Extract the archive.
3. Move the binary to somewhere in your `PATH`.

Sample steps for MacOS:
Sample steps for macOS:
```bash
$ VERSION=<VERSION_TAG>
$ wget https://github.com/utkuozdemir/pv-migrate/releases/download/${VERSION}/pv-migrate_${VERSION}_darwin_x86_64.tar.gz
Expand Down
6 changes: 6 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ tasks:
hairyhenderson/gomplate:stable
--file /project/USAGE.md.gotmpl --out /project/USAGE.md
update-helm-chart-docs:
desc: update helm chart docs
dir: helm/pv-migrate
cmds:
- helm-docs

build:
desc: build
cmds:
Expand Down
3 changes: 2 additions & 1 deletion USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,5 @@ $ pv-migrate \
--source old-pvc --dest new-pvc
```

**For further customization on the rendered manifests** (custom labels, annotations etc.), see the [Helm chart values](helm/pv-migrate).
**For further customization on the rendered manifests**
(custom labels, annotations, etc.), see the [Helm chart values](helm/pv-migrate).
3 changes: 2 additions & 1 deletion USAGE.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,5 @@ $ pv-migrate \
--source old-pvc --dest new-pvc
```

**For further customization on the rendered manifests** (custom labels, annotations etc.), see the [Helm chart values](helm/pv-migrate).
**For further customization on the rendered manifests**
(custom labels, annotations, etc.), see the [Helm chart values](helm/pv-migrate).
48 changes: 24 additions & 24 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ require (
require (
dario.cat/mergo v1.0.1 // indirect
github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6 // indirect
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect
github.com/BurntSushi/toml v1.4.0 // indirect
github.com/MakeNowJust/heredoc v1.0.0 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
Expand All @@ -38,16 +38,16 @@ require (
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/chai2010/gettext-go v1.0.3 // indirect
github.com/containerd/containerd v1.7.24 // indirect
github.com/containerd/containerd v1.7.25 // indirect
github.com/containerd/errdefs v1.0.0 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/containerd/platforms v0.2.1 // indirect
github.com/cyphar/filepath-securejoin v0.3.6 // indirect
github.com/cyphar/filepath-securejoin v0.4.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/cli v27.4.1+incompatible // indirect
github.com/docker/cli v27.5.1+incompatible // indirect
github.com/docker/distribution v2.8.3+incompatible // indirect
github.com/docker/docker v27.4.1+incompatible // indirect
github.com/docker/docker v27.5.1+incompatible // indirect
github.com/docker/docker-credential-helpers v0.8.2 // indirect
github.com/docker/go-connections v0.5.0 // indirect
github.com/docker/go-metrics v0.0.1 // indirect
Expand Down Expand Up @@ -89,15 +89,15 @@ require (
github.com/lib/pq v1.10.9 // indirect
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
github.com/mailru/easyjson v0.9.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/moby/locker v1.0.1 // indirect
github.com/moby/spdystream v0.5.0 // indirect
github.com/moby/term v0.5.0 // indirect
github.com/moby/term v0.5.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
Expand All @@ -110,7 +110,7 @@ require (
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_golang v1.20.5 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.61.0 // indirect
github.com/prometheus/common v0.62.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/rubenv/sql-migrate v1.7.1 // indirect
Expand All @@ -124,31 +124,31 @@ require (
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
github.com/xlab/treeprint v1.2.0 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 // indirect
go.opentelemetry.io/otel v1.33.0 // indirect
go.opentelemetry.io/otel/metric v1.33.0 // indirect
go.opentelemetry.io/otel/trace v1.33.0 // indirect
golang.org/x/net v0.33.0 // indirect
golang.org/x/oauth2 v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 // indirect
go.opentelemetry.io/otel v1.34.0 // indirect
go.opentelemetry.io/otel/metric v1.34.0 // indirect
go.opentelemetry.io/otel/trace v1.34.0 // indirect
golang.org/x/net v0.34.0 // indirect
golang.org/x/oauth2 v0.25.0 // indirect
golang.org/x/sys v0.29.0 // indirect
golang.org/x/term v0.28.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/time v0.8.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241216192217-9240e9c98484 // indirect
google.golang.org/grpc v1.69.2 // indirect
google.golang.org/protobuf v1.36.0 // indirect
golang.org/x/time v0.9.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250124145028-65684f501c47 // indirect
google.golang.org/grpc v1.70.0 // indirect
google.golang.org/protobuf v1.36.4 // indirect
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
k8s.io/apiextensions-apiserver v0.32.0 // indirect
k8s.io/apiserver v0.32.0 // indirect
k8s.io/component-base v0.32.0 // indirect
k8s.io/apiextensions-apiserver v0.32.1 // indirect
k8s.io/apiserver v0.32.1 // indirect
k8s.io/component-base v0.32.1 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/kube-openapi v0.0.0-20241212222426-2c72e554b1e7 // indirect
k8s.io/kubectl v0.32.0 // indirect
k8s.io/kubectl v0.32.1 // indirect
oras.land/oras-go v1.2.6 // indirect
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
sigs.k8s.io/kustomize/api v0.18.0 // indirect
sigs.k8s.io/kustomize/kyaml v0.18.1 // indirect
sigs.k8s.io/kustomize/api v0.19.0 // indirect
sigs.k8s.io/kustomize/kyaml v0.19.0 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.5.0 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)
Loading

0 comments on commit b348afb

Please sign in to comment.