-
Notifications
You must be signed in to change notification settings - Fork 637
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This was mostly me working around a limitation in chart-releaser where it does not allow for uploading a chart to an existing release.
- Loading branch information
Showing
7 changed files
with
81 additions
and
57 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -8,6 +8,8 @@ jobs: | |
promote: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Log in to GHCR | ||
run: | | ||
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin | ||
|
@@ -23,3 +25,16 @@ jobs: | |
docker tag ghcr.io/${{ github.repository }}:${{ github.event.release.tag_name }} quay.io/${{ github.repository }}:latest | ||
docker push quay.io/${{ github.repository }}:${{ github.event.release.tag_name }} | ||
docker push quay.io/${{ github.repository }}:latest | ||
- name: Configure git | ||
run: | | ||
git config user.name "$GITHUB_ACTOR" | ||
git config user.email "[email protected]" | ||
- name: Release Helm chart | ||
run: | | ||
ansible-playbook ansible/helm-release.yml -v \ | ||
-e operator_image=quay.io/${{ github.repository }} \ | ||
-e chart_owner=${{ github.repository_owner }} \ | ||
-e tag=${{ github.event.release.tag_name }} \ | ||
-e gh_token=${{ secrets.GITHUB_TOKEN }} |
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 |
---|---|---|
|
@@ -4,3 +4,5 @@ | |
/bundle | ||
/bundle_tmp* | ||
/bundle.Dockerfile | ||
/charts | ||
/.cr-release-packages |
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,47 @@ | ||
--- | ||
- hosts: localhost | ||
vars: | ||
chart_repo: awx-operator | ||
tasks: | ||
- name: Look up release | ||
uri: | ||
url: "https://api.github.com/repos/{{ chart_owner }}/{{ chart_repo }}/releases/tags/{{ tag }}" | ||
register: release | ||
ignore_errors: yes | ||
|
||
- fail: | ||
msg: | | ||
Release must exist before running this playbook | ||
when: release is not success | ||
|
||
- name: Build and package helm chart | ||
command: | | ||
make helm-chart helm-package | ||
environment: | ||
VERSION: "{{ tag }}" | ||
IMAGE_TAG_BASE: "{{ operator_image }}" | ||
args: | ||
chdir: "{{ playbook_dir }}/../" | ||
|
||
# Move to chart releaser after https://github.com/helm/chart-releaser/issues/122 exists | ||
- name: Upload helm chart | ||
uri: | ||
url: "https://uploads.github.com/repos/{{ chart_owner }}/{{ chart_repo }}/releases/{{ release.json.id }}/assets?name=awx-operator-{{ tag }}.tgz" | ||
src: "{{ playbook_dir }}/../.cr-release-packages/awx-operator-{{ tag }}.tgz" | ||
headers: | ||
Authorization: "token {{ gh_token }}" | ||
Content-Type: "application/octet-stream" | ||
status_code: | ||
- 200 | ||
- 201 | ||
register: asset_upload | ||
changed_when: asset_upload.json.state == "uploaded" | ||
|
||
- name: Publish helm index | ||
command: | | ||
make helm-index | ||
environment: | ||
CHART_OWNER: "{{ chart_owner }}" | ||
CR_TOKEN: "{{ gh_token }}" | ||
args: | ||
chdir: "{{ playbook_dir }}/../" |
Empty file.