Skip to content

Commit

Permalink
Merge pull request #4 from cybozu-go/use-ghcr-pushgateway
Browse files Browse the repository at this point in the history
Use ghcr.io/cybozu/pushgateway
  • Loading branch information
yokaze authored Jan 5, 2024
2 parents a47d64a + 53ddad1 commit 6e8db1f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions e2e/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -96,20 +96,20 @@ update-tools-version: login-gh
NEW_VERSION=$$(echo $(latest_gh) | cut -b 2-); \
sed -i -e "s/YQ_VERSION := .*/YQ_VERSION := $${NEW_VERSION}/g" Makefile.versions

$(call get-latest-tag,pushgateway)
$(call get-latest-gh-package-tag,pushgateway)
NEW_VERSION=$$(echo $(latest_tag)); \
sed -i -e "s/PUSHGATEWAY_IMAGE_VERSION := .*/PUSHGATEWAY_IMAGE_VERSION := $${NEW_VERSION}/g" Makefile.versions

# usage: get-latest-tag NAME
define get-latest-tag
$(eval latest_tag := $(shell wget -O - https://quay.io/api/v1/repository/cybozu/$1/tag/ | jq -r '.tags[] | .name' | awk '/.*\..*\./ {print $$1; exit}'))
endef

# usage get-latest-gh OWNER/REPO
define get-latest-gh
$(eval latest_gh := $(shell $(GH) release list --repo $1 | grep Latest | cut -f3))
endef

# usage: get-latest-gh-package-tag NAME
define get-latest-gh-package-tag
$(eval latest_tag := $(shell curl -sSf -H "Authorization: Bearer $(shell curl -sSf "https://ghcr.io/token?scope=repository%3Acybozu%2F$1%3Apull&service=ghcr.io" | jq -r .token)" https://ghcr.io/v2/cybozu/$1/tags/list | jq -r '.tags[]' | sort -Vr | head -n 1))
endef

.PHONY: gh
gh: $(GH)
$(GH): $(BIN_DIR)
Expand Down
2 changes: 1 addition & 1 deletion e2e/Makefile.versions
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
E2ETEST_K8S_VERSION := 1.26.3
KIND_VERSION := 0.20.0
KUSTOMIZE_VERSION := 5.1.0
PUSHGATEWAY_IMAGE_VERSION := 1.5.1.1
PUSHGATEWAY_IMAGE_VERSION := 1.6.0.3
GH_VERSION := 2.30.0
ACTIONS_CACHE_VERSION := 3
ACTIONS_CHECKOUT_VERSION := 3
Expand Down
4 changes: 2 additions & 2 deletions e2e/manifests/pushgateway/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spec:
spec:
containers:
- name: pushgateway
image: quay.io/cybozu/pushgateway:1.5.1.1
image: ghcr.io/cybozu/pushgateway:1.6.0.3
ports:
- containerPort: 9091
livenessProbe:
Expand All @@ -33,4 +33,4 @@ spec:
path: /-/ready
port: 9091
initialDelaySeconds: 10
timeoutSeconds: 10
timeoutSeconds: 10
4 changes: 2 additions & 2 deletions e2e/manifests/pushgateway/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ resources:
- deployment.yaml
- service.yaml
images:
- name: quay.io/cybozu/pushgateway
newTag: 1.5.1.1
- name: ghcr.io/cybozu/pushgateway
newTag: 1.6.0.3

0 comments on commit 6e8db1f

Please sign in to comment.