-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move helm/kind setup to github actions (#8)
- Loading branch information
1 parent
1caf21b
commit bd8b03e
Showing
10 changed files
with
95 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,14 +73,21 @@ jobs: | |
with: | ||
python-version: '3.x' | ||
|
||
- name: install poetry | ||
run: pip3 install poetry | ||
|
||
- name: install helm | ||
uses: azure/setup-helm@v3 | ||
with: | ||
version: 'latest' | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
id: helm | ||
|
||
- name: install poetry | ||
run: pip3 install poetry | ||
- name: install kind | ||
uses: engineerd/[email protected] | ||
with: | ||
version: "v0.17.0" | ||
skipClusterCreation: true | ||
|
||
- name: install pips | ||
run: poetry install | ||
|
@@ -91,3 +98,4 @@ jobs: | |
PY_COLORS: '1' | ||
ANSIBLE_FORCE_COLOR: '1' | ||
K8S_RELEASE: ${{ matrix.image }} | ||
HELM_BIN: ${{ steps.helm.outputs.helm-path }} |
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 |
---|---|---|
|
@@ -5,3 +5,4 @@ __pycache__/ | |
Gemfile.lock | ||
**/.ropeproject | ||
playbook.retry | ||
.tool-versions |
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,77 @@ | ||
--- | ||
- name: prepare | ||
|
||
hosts: localhost | ||
|
||
gather_facts: false | ||
|
||
tasks: | ||
|
||
- name: check local helm binary | ||
ansible.builtin.shell: "which {{ lookup('env', 'HELM_BIN', default='helm') }}" | ||
register: helm_bin_query | ||
changed_when: false | ||
|
||
- name: copy helm binary | ||
ansible.builtin.copy: | ||
src: "{{ helm_bin_query.stdout }}" | ||
dest: "{{ k8s_helm_bin }}" | ||
mode: '0755' | ||
when: helm_bin_query is succeeded | ||
|
||
- name: download helm binary | ||
when: helm_bin_query is not succeeded | ||
block: | ||
|
||
- name: query helm releases | ||
ansible.builtin.uri: | ||
url: https://api.github.com/repos/helm/helm/releases/latest | ||
register: helm_release_query | ||
|
||
- name: set kind release target | ||
ansible.builtin.set_fact: | ||
helm_release: "{{ helm_release_query.json.tag_name }}" | ||
|
||
- name: create temporary directory | ||
ansible.builtin.tempfile: | ||
state: directory | ||
prefix: kind | ||
register: _tmpdir | ||
changed_when: false | ||
|
||
- name: install helm binary | ||
block: | ||
|
||
- name: download helm release package | ||
ansible.builtin.unarchive: | ||
src: "https://get.helm.sh/helm-{{ helm_release }}-linux-amd64.tar.gz" | ||
dest: "{{ _tmpdir.path }}" | ||
remote_src: true | ||
register: helm_dl_op | ||
retries: 3 | ||
delay: 10 | ||
until: helm_dl_op is success | ||
changed_when: false | ||
|
||
- name: find helm executable | ||
ansible.builtin.find: | ||
paths: "{{ _tmpdir.path }}" | ||
file_type: file | ||
recurse: true | ||
use_regex: true | ||
patterns: | ||
- '^helm$' | ||
register: helm_bin | ||
|
||
- name: copy helm copy helm binary | ||
ansible.builtin.copy: | ||
src: "{{ helm_bin.files[0].path }}" | ||
dest: "{{ k8s_helm_bin }}" | ||
mode: '0755' | ||
|
||
always: | ||
|
||
- name: cleanup temp files | ||
ansible.builtin.file: | ||
state: absent | ||
path: "{{ _tmpdir.path }}" |
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