-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from burmanm/workflow_build
Fix caching directories to match with newer Dockerfile, add workflow
- Loading branch information
Showing
13 changed files
with
163 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
name: k8ssandra-client build for external calls | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
chartName: | ||
description: 'Name of the chart to be embedded in the image' | ||
required: true | ||
type: string | ||
chartVersion: | ||
description: 'Target version to upgrade CRDs to. If used with git, give the tag name' | ||
required: true | ||
type: string | ||
repoName: | ||
description: 'Name of the Helm repository if not default' | ||
required: false | ||
type: string | ||
repoURL: | ||
description: 'URL of the target repository if repoName is set' | ||
required: false | ||
type: string | ||
gitRepo: | ||
description: 'git repository to be embedded in the image' | ||
required: false | ||
type: string | ||
chartDir: | ||
description: 'Directory of the chart in the git repository to be embedded in the image' | ||
required: false | ||
type: string | ||
tokenSecret: | ||
description: 'Secret name to be used as GitHub token if gitRepo is set' | ||
required: false | ||
type: string | ||
jobs: | ||
create_the_image: | ||
runs-on: ubuntu-latest | ||
env: | ||
GH_TOKEN: ${{ secrets[format('{0}', inputs.tokenSecret)] }} | ||
steps: | ||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- uses: azure/setup-helm@v3 | ||
if: ${{ env.ACT }} | ||
with: | ||
version: '3.13.1' | ||
id: install | ||
- name: Set up QEMU | ||
if: ${{ !env.ACT }} | ||
uses: docker/setup-qemu-action@v2 | ||
- name: Login to DockerHub | ||
if: ${{ !env.ACT }} | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_PASSWORD }} | ||
- name: Create release name | ||
id: vars | ||
run: | | ||
echo "tag=${{ inputs.chartName }}-${{ inputs.chartVersion }}" >> $GITHUB_OUTPUT | ||
- name: Download the requested charts | ||
if: ${{ !inputs.gitRepo }} | ||
id: download_charts | ||
run: | | ||
helm repo add ${{ inputs.repoName }} ${{ inputs.repoURL }} | ||
helm repo update | ||
helm pull ${{ inputs.repoName }}/${{ inputs.chartName }} --version ${{ inputs.chartVersion }} | ||
mkdir -p build/${{ inputs.repoName }} | ||
tar -xvf ${{ inputs.chartName }}-${{ inputs.chartVersion }}.tgz -C build/${{ inputs.repoName }} | ||
- name: Download the requested chart from another repository | ||
if: ${{ inputs.gitRepo }} | ||
id: download_charts_github | ||
run: | | ||
gh repo clone ${{ inputs.gitRepo }} ${{ inputs.repoName }} | ||
cd ${{ inputs.repoName }} | ||
git checkout ${{ inputs.chartVersion }} | ||
cd .. | ||
mkdir -p build/${{ inputs.repoName }} | ||
cp -R ${{ inputs.repoName }}/${{ inputs.chartDir }}/* build/${{ inputs.repoName }} | ||
helm dependency update build/${{ inputs.repoName }} | ||
- name: Build and push | ||
id: docker_build | ||
uses: docker/build-push-action@v3 | ||
with: | ||
load: false | ||
file: cmd/kubectl-k8ssandra/Dockerfile | ||
push: ${{ github.event_name != 'pull_request' && !env.ACT }} | ||
tags: k8ssandra/k8ssandra-client:${{ steps.vars.outputs.tag }} | ||
platforms: linux/amd64,linux/arm64 | ||
context: . | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,3 +23,4 @@ bin/ | |
# Local History for Visual Studio Code | ||
.history/ | ||
.vscode/ | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.