From 2de53e8a98da3f90f32b0b7ef0924a75afaeb707 Mon Sep 17 00:00:00 2001 From: Johannes Schnatterer Date: Sun, 23 May 2021 16:04:43 +0200 Subject: [PATCH 1/3] Add GitHub action that execs a simple smoke test --- .github/workflows/SmokeTest.yaml | 39 ++++++++++++++++++++++++++++++++ devbox | 5 +++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/SmokeTest.yaml diff --git a/.github/workflows/SmokeTest.yaml b/.github/workflows/SmokeTest.yaml new file mode 100644 index 0000000..cdf0218 --- /dev/null +++ b/.github/workflows/SmokeTest.yaml @@ -0,0 +1,39 @@ +name: Smoke Test + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + exec: + runs-on: ubuntu-20.04 + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + - uses: actions/checkout@v2.3.4 + + # Provide required binaries + # fc-cache (fontconfig) + # gsettings (gnome) + - name: install + run: sudo apt-get update && sudo apt-get install -y ansible unzip fontconfig gnome-core snapd snap-confine + + # Uninstall gh in order to avoid error: "A later version is already installed" + - name: Uninstall preconfigured github cli + run: sudo apt-get remove gh + + - name: create vars.yaml + run: | + cat << EOF > vars.yml + mail: some@o.ne + displayName: Some one + gpgKey: "abcdef" + EOF + + - name: smoke test + run: ./devbox -e ansible_become_pass='' diff --git a/devbox b/devbox index 43f720e..05ff139 100755 --- a/devbox +++ b/devbox @@ -35,10 +35,13 @@ fi echo "starting ansible ..." echo "====================" +# If you pass "-e ansible_become_pass= Date: Mon, 24 May 2021 09:54:24 +0200 Subject: [PATCH 2/3] Smoke test: Also run incrementally --- .github/workflows/SmokeTest.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/SmokeTest.yaml b/.github/workflows/SmokeTest.yaml index cdf0218..b0a090b 100644 --- a/.github/workflows/SmokeTest.yaml +++ b/.github/workflows/SmokeTest.yaml @@ -35,5 +35,9 @@ jobs: gpgKey: "abcdef" EOF - - name: smoke test + - name: Initial smoke test + run: ./devbox -e ansible_become_pass='' + + # Make sure the playbook also succeeds on incremental run + - name: Incremental smoke test run: ./devbox -e ansible_become_pass='' From d1df5dd631c2c480bbff1207e406d1e825be6384 Mon Sep 17 00:00:00 2001 From: Johannes Schnatterer Date: Sun, 23 May 2021 21:21:35 +0200 Subject: [PATCH 3/3] Aliases files: Allow owner write. Avoids failure when running playbook more than once. --- roles/cli-tools/tasks/aliases.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/roles/cli-tools/tasks/aliases.yml b/roles/cli-tools/tasks/aliases.yml index 4b89020..a518ac5 100644 --- a/roles/cli-tools/tasks/aliases.yml +++ b/roles/cli-tools/tasks/aliases.yml @@ -2,10 +2,13 @@ get_url: url: https://raw.githubusercontent.com/ahmetb/kubectl-alias/master/.kubectl_aliases dest: ~/.kubectl_aliases - mode: '0440' + # Require owner write to allow idempotent calls of ansible + mode: '0640' + force : yes - name: Download docker_aliases get_url: url: "https://github.com/schnatterer/docker-aliases/releases/download/{{ docker_aliases_version }}/default.docker-aliases" dest: ~/.docker_aliases - mode: '0440' + mode: '0640' + force : yes