Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish custom rancher chart with operator #258

Merged
merged 3 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 0 additions & 65 deletions .github/scripts/update-rancher-charts.sh

This file was deleted.

31 changes: 0 additions & 31 deletions .github/scripts/update-rancher-dep.sh

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
"type": "section",
"text": {
"type": "mrkdwn",
"text": "AKS Operator E2E test run failed."
"text": "EKS Operator E2E test run failed."
},
"accessory": {
"type": "button",
Expand Down
70 changes: 7 additions & 63 deletions .github/workflows/nightly-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,67 +2,11 @@ name: Nightly
on:
schedule:
- cron: '0 1 * * *'
workflow_dispatch:
jobs:
nightly_image:
env:
REPO_BASE: ttl.sh/eks-operator-nightly
TAG: 1d
runs-on: ubuntu-latest
outputs:
REPO: ${{ steps.setoutputs.outputs.repo}}
BUILD_DATE: ${{ steps.setoutputs.outputs.builddate}}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set current date as env variable
run: echo "NOW=$(date +'%Y%m%d')" >> $GITHUB_ENV
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3.0.0
- name: Build and push image
uses: docker/build-push-action@v5.0.0
with:
context: .
tags: ${{ env.REPO_BASE}}-${{ env.NOW }}:${{ env.TAG }}
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
target: eks-operator
file: test/e2e/Dockerfile.e2e
build-args: |
TAG=${{ env.TAG }}
REPO=${{ env.REPO_BASE }}-${{ env.NOW }}
COMMIT=${{ github.sha }}
- name: Set outputs
id: setoutputs
run: |
echo "repo=${{ env.REPO_BASE }}-${{ env.NOW }}" >> "$GITHUB_OUTPUT"
echo "builddate=${{ env.NOW }}" >> "$GITHUB_OUTPUT"
nightly_charts:
env:
REPO: ${{ needs.nightly_image.outputs.REPO }}
TAG: 1d
BUILD_DATE: ${{ needs.nightly_image.outputs.BUILD_DATE }}
runs-on: ubuntu-latest
needs: nightly_image
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Helm
uses: azure/setup-helm@v3
with:
version: 'v3.12.1'
- name: Build charts
run: |
make charts
env:
CHART_VERSION: ${{ env.BUILD_DATE }}
GIT_TAG: ${{ env.BUILD_DATE }}
- name: Push charts
run: |
helm push bin/rancher-eks-operator-crd-${{ env.BUILD_DATE }}.tgz oci://ttl.sh/eks-operator
helm push bin/rancher-eks-operator-${{ env.BUILD_DATE }}.tgz oci://ttl.sh/eks-operator
publish_nightly:
uses: rancher-sandbox/highlander-reusable-workflows/.github/workflows/operator-with-latest-rancher-build.yaml@main
with:
operator_name: eks-operator
rancher_ref: release/v2.8
operator_commit: ${{ github.sha }}
50 changes: 13 additions & 37 deletions .github/workflows/update-rancher-charts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,10 @@ name: Update EKS Operator in rancher/charts
on:
workflow_dispatch:
inputs:
ref:
description: "Branch to use for GitHub action workflow"
required: true
default: "master"
charts_ref:
description: "Submit PR against the following rancher/charts branch (e.g. dev-v2.7)"
required: true
default: "dev-v2.7"
default: "dev-v2.8"
prev_eks_operator:
description: "Previous EKS operator version (e.g. 1.1.0-rc2)"
required: true
Expand All @@ -32,35 +28,15 @@ on:
default: "true"

jobs:
create-rancher-charts-pr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{github.event.inputs.ref}}
path: eks-operator
- name: Checkout rancher/charts
uses: actions/checkout@v4
with:
fetch-depth: 0
repository: rancher/charts
ref: ${{github.event.inputs.charts_ref}}
path: charts
- name: Run release script
run: ./eks-operator/.github/scripts/update-rancher-charts.sh ${{github.event.inputs.prev_eks_operator}} ${{github.event.inputs.new_eks_operator}} ${{github.event.inputs.prev_chart}} ${{github.event.inputs.new_chart}} ${{github.event.inputs.should_replace}}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
token: ${{secrets.CI_BOT_TOKEN}}
push-to-fork: highlander-ci-bot/charts
title: 'Update EKS operator to v${{github.event.inputs.new_eks_operator}}'
body: |
Update EKS operator to v${{github.event.inputs.new_eks_operator}}

Changelog: https://github.com/rancher/eks-operator/releases/tag/v${{github.event.inputs.new_eks_operator}}

cc @rancher/highlander
branch-suffix: timestamp
base: ${{github.event.inputs.charts_ref}}
path: ./charts/
update-rancher-chart:
uses: rancher-sandbox/highlander-reusable-workflows/.github/workflows/update-rancher-charts.yaml@main
with:
charts_ref: ${{ github.event.inputs.charts_ref }}
operator: eks-operator
prev_operator_version: ${{ github.event.inputs.prev_eks_operator }}
new_operator_version: ${{ github.event.inputs.new_eks_operator }}
prev_chart_version: ${{ github.event.inputs.prev_chart }}
new_chart_version: ${{ github.event.inputs.new_chart }}
should_replace: ${{ github.event.inputs.should_replace }}
secrets:
token: ${{secrets.CI_BOT_TOKEN}}
56 changes: 9 additions & 47 deletions .github/workflows/update-rancher-dep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,19 @@ name: Update EKS operator in rancher/rancher
on:
workflow_dispatch:
inputs:
ref:
description: "Branch to use for GitHub action workflow"
required: true
default: "master"
rancher_ref:
description: "Submit PR against the following rancher/rancher branch (e.g. release/v2.7)"
required: true
default: "release/v2.7"
default: "release/v2.8"
new_eks:
description: "New EKS operator version (e.g. 1.1.0-rc2), don't include the 'v'"
required: true
default: ""

env:
GOARCH: amd64
CGO_ENABLED: 0
SETUP_GO_VERSION: '1.19.*'

jobs:
create-rancher-pr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{github.event.inputs.ref}}
path: eks-operator
- name: Checkout rancher/rancher
uses: actions/checkout@v4
with:
fetch-depth: 0
repository: rancher/rancher
ref: ${{github.event.inputs.rancher_ref}}
path: rancher
- uses: actions/setup-go@v4
with:
go-version: ${{ env.SETUP_GO_VERSION }}
- name: Run release script
run: ./eks-operator/.github/scripts/update-rancher-dep.sh ${{github.event.inputs.new_eks}}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
token: ${{secrets.CI_BOT_TOKEN}}
push-to-fork: highlander-ci-bot/rancher
title: ' Update EKS operator to v${{github.event.inputs.new_eks}}'
body: |
Update EKS operator to v${{github.event.inputs.new_eks}}

Changelog: https://github.com/rancher/eks-operator/releases/tag/v${{github.event.inputs.new_eks}}

cc @rancher/highlander
branch-suffix: timestamp
base: ${{github.event.inputs.rancher_ref}}
path: ./rancher/
update-rancher-dep:
uses: rancher-sandbox/highlander-reusable-workflows/.github/workflows/update-rancher-dep.yaml@main
with:
rancher_ref: ${{ github.event.inputs.rancher_ref }}
new_operator_version: ${{ github.event.inputs.new_eks }}
operator_repo: github.com/rancher/eks-operator
secrets:
token: ${{secrets.CI_BOT_TOKEN}}
Loading