Skip to content

Commit

Permalink
Merge branch 'master' into ingress-jenkins
Browse files Browse the repository at this point in the history
  • Loading branch information
brokenpip3 authored Feb 24, 2024
2 parents 6294325 + ec20bbe commit 3286654
Show file tree
Hide file tree
Showing 40 changed files with 1,361 additions and 330 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
has nix && use flake
4 changes: 2 additions & 2 deletions .github/workflows/auto-codespell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Codespell
uses: codespell-project/actions-codespell@v1
uses: codespell-project/actions-codespell@v2
with:
check_filenames: true
ignore_words_list: aks,ags,startin
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/auto-gen-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
steps:
# Checks out a copy of your repository on the ubuntu-latest machine
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive # Fetch the Docsy theme
fetch-depth: 0
Expand All @@ -45,7 +45,7 @@ jobs:
# Sets up node - required by Hugo
- name: Setup Node
if: env.IS_CHANGED == 'true'
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: '12.x'

Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:
# Creates pull request with generated docs
- name: Create Pull Request
if: env.IS_CHANGED == 'true'
uses: peter-evans/create-pull-request@v5
uses: peter-evans/create-pull-request@v6
with:
commit-message: Auto-updated docs
branch: docs-generator
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/auto-generate-manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up env vars
run: |
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
cp chart/jenkins-operator/crds/jenkins-crd.yaml deploy/crds/jenkins.io_jenkins_crd.yaml
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
uses: peter-evans/create-pull-request@v6
with:
commit-message: Auto-updated Kubernetes Manifests
branch: manifest-deploy-update
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/auto-stale-issue.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v8
- uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
operations-per-run: 200
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/auto-tests-bats.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,34 +26,34 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up env vars
run: |
echo "GO111MODULE=on" >> $GITHUB_ENV
echo "GO_VERSION=v$(sed -n 's/GO_VERSION=//p' config.base.env)" >> $GITHUB_ENV
echo "HELM_VERSION=v$(sed -n 's/HELM_VERSION=//p' config.base.env)" >> $GITHUB_ENV
echo "KIND_CLUSTER_NAME=$(sed -n 's/KIND_CLUSTER_NAME=//p' config.base.env)" >> $GITHUB_ENV
echo "GO_VERSION=v$(sed -n 's/GO_VERSION=//p' config.base.env | tr -d '\n' | tr -d '"')" >> $GITHUB_ENV
echo "HELM_VERSION=v$(sed -n 's/HELM_VERSION=//p' config.base.env | tr -d '\n' | tr -d '"')" >> $GITHUB_ENV
echo "KIND_CLUSTER_NAME=$(sed -n 's/KIND_CLUSTER_NAME=//p' config.base.env | tr -d '\n' | tr -d '"')" >> $GITHUB_ENV
echo "GOPATH=/home/runner/go" >> $GITHUB_ENV
- name: Prepare go environment
uses: actions/setup-go@v2
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Ensure Golang runtime dependencies
run: make go-dependencies

- name: Setup Bats and libs
uses: brokenpip3/setup-bats-libs@1.5.2
uses: bats-core/bats-action@1.5.5
with:
support-path: "${{ github.workspace }}/.bats/bats-support"
assert-path: "${{ github.workspace }}/.bats/bats-assert"
detik-path: "${{ github.workspace }}/.bats/bats-detik"
file-path: "${{ github.workspace }}/.bats/bats-file"

- name: Kind setup
uses: helm/kind-action@v1.5.0
uses: helm/kind-action@v1.9.0
with:
cluster_name: ${{env.KIND_CLUSTER_NAME}}

Expand Down
42 changes: 25 additions & 17 deletions .github/workflows/auto-tests-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,25 @@ on:
- 'backup/**'
- '*.md'

env:
MINIKUBE_CPUS_NUMBER: 2
MINIKUBE_MEMORY_AMOUNT: 6144

jobs:
run-tests:
if: github.event.pull_request.draft == false
name: Run automated tests
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up env vars
run: |
echo "GO111MODULE=on" >> $GITHUB_ENV
echo "CHANGE_MINIKUBE_NONE_USER=true" >> $GITHUB_ENV
echo "MINIKUBE_WANTUPDATENOTIFICATION=false" >> $GITHUB_ENV
echo "MINIKUBE_WANTREPORTERRORPROMPT=false" >> $GITHUB_ENV
echo "GO_VERSION=v$(sed -n 's/GO_VERSION=//p' config.base.env)" >> $GITHUB_ENV
echo "HELM_VERSION=v$(sed -n 's/HELM_VERSION=//p' config.base.env)" >> $GITHUB_ENV
echo "GO_VERSION=v$(sed -n 's/GO_VERSION=//p' config.base.env | tr -d '\n' | tr -d '"')" >> $GITHUB_ENV
echo "HELM_VERSION=v$(sed -n 's/HELM_VERSION=//p' config.base.env | tr -d '\n' | tr -d '"')" >> $GITHUB_ENV
echo "KIND_CLUSTER_NAME=$(sed -n 's/KIND_CLUSTER_NAME=//p' config.base.env | tr -d '\n' | tr -d '"')" >> $GITHUB_ENV
echo "GOPATH=/home/runner/go" >> $GITHUB_ENV
- name: Prepare go environment
uses: actions/setup-go@v2
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

Expand All @@ -53,16 +47,30 @@ jobs:
- name: Verify code formatting
run: make verify

- name: Kind setup
uses: helm/[email protected]
with:
cluster_name: ${{env.KIND_CLUSTER_NAME}}
config: kind-cluster.yaml

- name: Prepare environment for e2e
run: |
sudo apt-get update
sudo apt-get install socat
sudo mkdir -p $HOME/.kube $HOME/.minikube
sudo chown -R $USER $HOME/.kube $HOME/.minikube
make minikube-start \
MINIKUBE_DRIVER='docker' \
MEMORY_AMOUNT=${{ env.MINIKUBE_MEMORY_AMOUNT }} \
CPUS_NUMBER=${{ env.MINIKUBE_CPUS_NUMBER }}
sudo mkdir -p $HOME/.kube
sudo chown -R $USER $HOME/.kube
- name: Jenkins Operator - e2e - list tests
run: make e2e E2E_TEST_ARGS='-ginkgo.v -ginkgo.dryRun'

- name: Jenkins Operator - e2e
run: make e2e E2E_TEST_ARGS='-ginkgo.v'

- name: Debug
if: failure()
shell: bash
continue-on-error: true
run: |
randomns=$(kubectl get ns| grep -i 'ns[0-9]\+' |cut -d ' ' -f 1)
kubectl get pods -n ${randomns}
kubectl get events -n ${randomns}
31 changes: 13 additions & 18 deletions .github/workflows/auto-tests-helm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,25 @@ on:
- 'backup/**'
- '*.md'

env:
MINIKUBE_CPUS_NUMBER: 2
MINIKUBE_MEMORY_AMOUNT: 6144

jobs:
run-tests:
if: github.event.pull_request.draft == false
name: Run automated tests
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up env vars
run: |
echo "GO111MODULE=on" >> $GITHUB_ENV
echo "CHANGE_MINIKUBE_NONE_USER=true" >> $GITHUB_ENV
echo "MINIKUBE_WANTUPDATENOTIFICATION=false" >> $GITHUB_ENV
echo "MINIKUBE_WANTREPORTERRORPROMPT=false" >> $GITHUB_ENV
echo "GO_VERSION=v$(sed -n 's/GO_VERSION=//p' config.base.env)" >> $GITHUB_ENV
echo "HELM_VERSION=v$(sed -n 's/HELM_VERSION=//p' config.base.env)" >> $GITHUB_ENV
echo "GO_VERSION=v$(sed -n 's/GO_VERSION=//p' config.base.env | tr -d '\n' | tr -d '"')" >> $GITHUB_ENV
echo "HELM_VERSION=v$(sed -n 's/HELM_VERSION=//p' config.base.env | tr -d '\n' | tr -d '"')" >> $GITHUB_ENV
echo "KIND_CLUSTER_NAME=$(sed -n 's/KIND_CLUSTER_NAME=//p' config.base.env | tr -d '\n' | tr -d '"')" >> $GITHUB_ENV
echo "GOPATH=/home/runner/go" >> $GITHUB_ENV
- name: Prepare go environment
uses: actions/setup-go@v2
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

Expand All @@ -53,20 +47,21 @@ jobs:
- name: Verify code formatting
run: make verify

- name: Kind setup
uses: helm/[email protected]
with:
cluster_name: ${{env.KIND_CLUSTER_NAME}}
config: kind-cluster.yaml

- name: Prepare environment for e2e
run: |
sudo apt-get update
sudo apt-get install socat
sudo mkdir -p $HOME/.kube $HOME/.minikube
sudo chown -R $USER $HOME/.kube $HOME/.minikube
make minikube-start \
MINIKUBE_DRIVER='docker' \
MEMORY_AMOUNT=${{ env.MINIKUBE_MEMORY_AMOUNT }} \
CPUS_NUMBER=${{ env.MINIKUBE_CPUS_NUMBER }}
sudo mkdir -p $HOME/.kube
sudo chown -R $USER $HOME/.kube
- name: Jenkins Operator - Helm Chart tests
run: |
git reset --hard
make helm-lint
eval $(bin/minikube docker-env)
make helm-e2e E2E_TEST_ARGS='-ginkgo.v'
4 changes: 2 additions & 2 deletions .github/workflows/release-backup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Check envs
run: make -C backup/pvc check-env
Expand All @@ -46,7 +46,7 @@ jobs:
- name: Login to Quay.io
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAYIO_USERNAME }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-helm-chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Deploy Helm chart
run: |
Expand All @@ -31,7 +31,7 @@ jobs:
# Creates pull request with new chart version
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
uses: peter-evans/create-pull-request@v6
with:
commit-message: Release Helm chart ${{ github.event.inputs.chartVersion }}
branch: helm-chart-release-${{ github.event.inputs.chartVersion }}
Expand Down
59 changes: 21 additions & 38 deletions .github/workflows/release-nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,33 @@ on:
description: "Flag for skipping the tests. If set to true (without quotation marks), the workflow will skip tests and go straight to releasing the nightly build. Use with caution!"
required: false

env:
MINIKUBE_CPUS_NUMBER: 2
MINIKUBE_MEMORY_AMOUNT: 6144

jobs:
publish-image:
name: Publish nightly snapshot
runs-on: ubuntu-latest
steps:
- name: Prep - check out code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Prep - Set up env vars
run: |
echo "GO111MODULE=on" >> $GITHUB_ENV
echo "CHANGE_MINIKUBE_NONE_USER=true" >> $GITHUB_ENV
echo "MINIKUBE_WANTUPDATENOTIFICATION=false" >> $GITHUB_ENV
echo "MINIKUBE_WANTREPORTERRORPROMPT=false" >> $GITHUB_ENV
echo "GO_VERSION=v$(sed -n 's/GO_VERSION=//p' config.base.env)" >> $GITHUB_ENV
echo "HELM_VERSION=v$(sed -n 's/HELM_VERSION=//p' config.base.env)" >> $GITHUB_ENV
echo "KIND_CLUSTER_NAME=$(sed -n 's/KIND_CLUSTER_NAME=//p' config.base.env)" >> $GITHUB_ENV
echo "GO_VERSION=v$(sed -n 's/GO_VERSION=//p' config.base.env | tr -d '\n' | tr -d '"')" >> $GITHUB_ENV
echo "HELM_VERSION=v$(sed -n 's/HELM_VERSION=//p' config.base.env | tr -d '\n' | tr -d '"')" >> $GITHUB_ENV
echo "KIND_CLUSTER_NAME=$(sed -n 's/KIND_CLUSTER_NAME=//p' config.base.env | tr -d '\n' | tr -d '"')" >> $GITHUB_ENV
echo "GOPATH=/home/runner/go" >> $GITHUB_ENV
- name: Prep - setup BATS
- name: Prep - setup Bats and bats libs
if: ${{ github.event.inputs.skipTests != 'true' }}
uses: mig4/setup-bats@v1
uses: bats-core/bats[email protected]
with:
bats-version: 1.9.0

- name: Prep - setup Bats libs
if: ${{ github.event.inputs.skipTests != 'true' }}
uses: brokenpip3/[email protected]
support-path: "${{ github.workspace }}/.bats/bats-support"
assert-path: "${{ github.workspace }}/.bats/bats-assert"
detik-path: "${{ github.workspace }}/.bats/bats-detik"
file-path: "${{ github.workspace }}/.bats/bats-file"

- name: Prep - go environment
uses: actions/setup-go@v2
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

Expand All @@ -57,12 +49,15 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install socat
sudo mkdir -p $HOME/.kube $HOME/.minikube
sudo chown -R $USER $HOME/.kube $HOME/.minikube
make minikube-start \
MINIKUBE_DRIVER='docker' \
MEMORY_AMOUNT=${{ env.MINIKUBE_MEMORY_AMOUNT }} \
CPUS_NUMBER=${{ env.MINIKUBE_CPUS_NUMBER }}
sudo mkdir -p $HOME/.kube
sudo chown -R $USER $HOME/.kube
- name: Prep - Kind setup
if: ${{ github.event.inputs.skipTests != 'true' }}
uses: helm/[email protected]
with:
cluster_name: ${{env.KIND_CLUSTER_NAME}}
config: kind-cluster.yaml

- name: Test - e2e
if: ${{ github.event.inputs.skipTests != 'true' }}
Expand All @@ -73,26 +68,14 @@ jobs:
run: |
git reset --hard
make helm-lint
eval $(bin/minikube docker-env)
make helm-e2e E2E_TEST_ARGS='-ginkgo.v'
- name: Prep - Destroy minikube
if: ${{ github.event.inputs.skipTests != 'true' }}
run: |
make minikube-destroy
- name: Prep - Kind setup
if: ${{ github.event.inputs.skipTests != 'true' }}
uses: helm/[email protected]
with:
cluster_name: ${{env.KIND_CLUSTER_NAME}}

- name: Test - bats
if: ${{ github.event.inputs.skipTests != 'true' }}
run: make bats-tests

- name: Post - Login to Quay.io
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAYIO_USERNAME }}
Expand Down
Loading

0 comments on commit 3286654

Please sign in to comment.