Skip to content

Commit

Permalink
Merge branch 'argoproj-labs:master' into sean/update-docs-ns
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmorton authored Jun 26, 2024
2 parents 3ce7b19 + fc1999f commit b6d29cd
Show file tree
Hide file tree
Showing 59 changed files with 4,923 additions and 1,958 deletions.
18 changes: 10 additions & 8 deletions .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@

aeece
Artifactory
applicationid
atlassian
Bitbucket
bitbucketserver
bacd
CVE
credref
DEBU
DEBU
dockerhub
eec
fbd
ffb
gitlab
GPG
helmvalues
html
installationid
jfrog
JFrog
mep
mypass
myregistry
myuser
otherapp
openpgp
PRIVATEKEYDATA
repocreds
rollbacked
someimage
somerepo
ssw
wildcard
wildcards
wohoo
yyyy
YYYY
47 changes: 30 additions & 17 deletions .github/workflows/ci-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Setup Golang
uses: actions/setup-go@v1
uses: actions/setup-go@v4
with:
go-version: '1.18'
go-version: '1.22'
- name: Download all Go modules
run: |
go mod download
Expand All @@ -31,16 +31,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install Kustomize v2
run: |
set -xo pipefail
KUSTOMIZE_VERSION=2.0.2
URL="https://github.com/kubernetes-sigs/kustomize/releases/download/v${KUSTOMIZE_VERSION}/kustomize_${KUSTOMIZE_VERSION}_linux_amd64"
BINNAME=kustomize2
curl -sLf --retry 3 -o /tmp/kustomize2 "$URL"
sudo mv /tmp/kustomize2 /usr/local/bin/kustomize2
chmod +x /usr/local/bin/kustomize2
URL="https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv5.1.0/kustomize_v5.1.0_linux_amd64.tar.gz"
BINNAME=kustomize
curl -sLf --retry 3 -o /tmp/kustomize.tar.gz "$URL"
chksum=$(sha256sum /tmp/kustomize.tar.gz | awk '{ print $1; }')
if test "${chksum}" != "52f4cf1ba34d38fd55a9bef819e329c9a4561f5f57f8f539346038ab5026dda8"; then
echo "Checksum mismatch" >&2
exit 1
fi
tar -C /tmp -xvzf /tmp/kustomize.tar.gz
sudo mv /tmp/kustomize /usr/local/bin/kustomize
chmod +x /usr/local/bin/kustomize
- name: Run make manifests
run: |
make manifests
Expand All @@ -53,28 +58,36 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Setup Golang
uses: actions/setup-go@v4
with:
go-version: '1.22'
cache: false
env:
GO111MODULE: off
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v2
uses: golangci/golangci-lint-action@v5
with:
version: v1.46.2
version: v1.57.2
args: --timeout 5m
test:
name: Ensure unit tests are passing
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Setup Golang
uses: actions/setup-go@v1
uses: actions/setup-go@v3
with:
go-version: '1.18'
go-version: '1.22'
- name: Run tests
env:
GNUPG_DISABLED: true
run: |
make test
- name: Upload code coverage information to codecov.io
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.out
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: argocd-image-updater
- name: Setup qemu
Expand Down
119 changes: 119 additions & 0 deletions .github/workflows/init-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: Init Argo CD Image Updater Release
on:
workflow_dispatch:
inputs:
TARGET_BRANCH:
description: 'TARGET_BRANCH to checkout (e.g. release-0.14)'
required: true
type: string

TARGET_VERSION:
description: 'TARGET_VERSION to build manifests (e.g. 0.14.0-rc1) Note: the `v` prefix is not used'
required: true
type: string

permissions: {}

env:
TARGET_REMOTE: upstream
TARGET_TAG: "v${{ inputs.TARGET_VERSION }}"

jobs:
prepare-release:
permissions:
contents: write # for peter-evans/create-pull-request to create branch
pull-requests: write # for peter-evans/create-pull-request to create a PR
name: Automatically generate version and manifests on ${{ inputs.TARGET_BRANCH }}
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@8410ad0602e1e429cee44a835ae9f77f654a6694 # v4.0.0
with:
fetch-depth: 0
fetch-tags: true
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ inputs.TARGET_BRANCH }}

- name: Check if TARGET_VERSION is well formed.
run: |
set -ue
# Target version must not contain 'v' prefix
if echo "${{ inputs.TARGET_VERSION }}" | grep -e '^v'; then
echo "::error::Target version '${{ inputs.TARGET_VERSION }}' should not begin with a 'v' prefix, refusing to continue." >&2
exit 1
fi
if ! echo "${{ inputs.TARGET_VERSION }}" | egrep -q '^[0-9]+\.[0-9]+\.[0-9]+$'; then
echo "Error: Target version '${{ inputs.TARGET_VERSION }}' is not well-formed. Must be X.Y.Z" >&2
exit 1
fi
- name: Checking for current git branch
run: |
set -ue
RELEASE_BRANCH=$(git rev-parse --abbrev-ref HEAD || true)
if [[ $RELEASE_BRANCH = release-* ]]; then
echo "*** branch is $RELEASE_BRANCH"
else
echo "Error: Branch $RELEASE_BRANCH is not release branch" >&2
exit 1
fi
- name: Checking for existence of git tag
run: |
set -ue
if git show-ref --tags "${{ env.TARGET_TAG }}" --quiet; then
echo "Error: Tag with version ${{ env.TARGET_TAG }} already exists." >&2
exit 1
fi
- name: Create VERSION information
run: |
set -ue
if ! test -f VERSION; then
echo "Error: You should be in repository root." >&2
exit 1
fi
echo "Bumping version from $(cat VERSION) to ${{ inputs.TARGET_VERSION }}"
echo "${{ inputs.TARGET_VERSION }}" > VERSION
- name: Install Kustomize
uses: imranismail/setup-kustomize@v2
with:
kustomize-version: '5.2.1'

- name: Generate new set of manifests
run: |
set -ue
echo kustomize version $(kustomize version)
make manifests IMAGE_TAG="${{ env.TARGET_TAG }}"
git diff
- name: Create pull request
id: create-pull-request
uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e # v6.0.5
with:
commit-message: "Bump version to ${{ inputs.TARGET_VERSION }}"
title: "Bump version to ${{ inputs.TARGET_VERSION }} on ${{ inputs.TARGET_BRANCH }} branch"
body: Updating VERSION and manifests to ${{ inputs.TARGET_VERSION }}
branch: update-version
branch-suffix: random
signoff: true
labels: release

- name: Next steps
run: |
echo "Created release PR: ${{ steps.create-pull-request.outputs.pull-request-url }}"
echo "Once this PR is merged, pull from ${{ env.TARGET_REMOTE }} ${{ inputs.TARGET_BRANCH }}, tag the release, and build release artifacts."
echo "If everything is fine, push changes to GitHub and container registry:"
echo " git fetch ${{ env.TARGET_REMOTE }} ${{ inputs.TARGET_BRANCH }}"
echo " git switch ${{ inputs.TARGET_BRANCH }}"
echo " git pull ${{ env.TARGET_REMOTE }} ${{ inputs.TARGET_BRANCH }}"
echo " git tag ${{ env.TARGET_TAG }}"
echo " make multiarch-image"
echo " make release-binaries"
echo " git push ${{ env.TARGET_REMOTE }} ${{ inputs.TARGET_BRANCH }} ${{ env.TARGET_TAG }}"
echo " make IMAGE_TAG='${{ env.TARGET_TAG }}' multiarch-image-push"
echo
echo "Then, create release tag and execute upload-multiarch-release-assets.sh"
19 changes: 0 additions & 19 deletions .github/workflows/spelling.yml

This file was deleted.

17 changes: 7 additions & 10 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
run:
timeout: 2m
skip-files:
- ".*\\.pb\\.go"
skip-dirs:
- vendor/
linters:
enable:
- gofmt
- vet
- deadcode
- goimports
- varcheck
- structcheck
- ineffassign
- unconvert
- unparam
- unused
linters-settings:
goimports:
local-prefixes: github.com/argoproj-labs/argocd-image-updater
service:
golangci-lint-version: 1.26.0
issues:
exclude-files:
- ".*\\.pb\\.go"
exclude-dirs:
- vendor/
4 changes: 4 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
version: 2
formats: all
build:
os: ubuntu-22.04
tools:
python: "3.12"
mkdocs:
fail_on_warning: false
python:
Expand Down
2 changes: 2 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# All
* @jannfis @chengfang @pasha-codefresh
10 changes: 4 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.18 AS builder
FROM golang:1.22 AS builder

RUN mkdir -p /src/argocd-image-updater
WORKDIR /src/argocd-image-updater
Expand All @@ -10,13 +10,11 @@ COPY . .
RUN mkdir -p dist && \
make controller

FROM alpine:latest
FROM alpine:3.19

RUN apk update && \
apk upgrade && \
apk add ca-certificates git openssh-client python3 py3-pip && \
pip3 install --upgrade pip && \
pip3 install awscli && \
apk add ca-certificates git openssh-client aws-cli tini && \
rm -rf /var/cache/apk/*

RUN mkdir -p /usr/local/bin
Expand All @@ -28,4 +26,4 @@ COPY hack/git-ask-pass.sh /usr/local/bin/git-ask-pass.sh

USER 1000

ENTRYPOINT ["/usr/local/bin/argocd-image-updater"]
ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/argocd-image-updater"]
4 changes: 3 additions & 1 deletion OWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ owners:
- jannfis

approvers:
- chengfang
- pasha-codefresh

reviewers:
reviewers:
Loading

0 comments on commit b6d29cd

Please sign in to comment.