Skip to content

Commit

Permalink
Merge "ci - use deploy/config instead of /tmp/config"
Browse files Browse the repository at this point in the history
  • Loading branch information
Microzuul CI authored and Gerrit Code Review committed Jan 17, 2024
2 parents a684056 + f8591c1 commit 734cc99
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 81 deletions.
15 changes: 2 additions & 13 deletions doc/developer/howtos/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,10 @@ This Prometheus instance is configured to collect metrics from a deployed Softwa

## How to open a review on the test Gerrit

First checkout the **config** repository.

```sh
# Get the Gerrit admin user API key
gerrit_admin_api_key=$(./tools/get-secret.sh gerrit-admin-api-key)
# Then checkout the config repository
git -c http.sslVerify=false clone "https://admin:${gerrit_admin_api_key}@gerrit.sfop.me/a/config" /tmp/config
cd /tmp/config
git config http.sslverify false
git remote add gerrit "https://admin:${gerrit_admin_api_key}@gerrit.sfop.me/a/config"
```

Then add a change and send the review:
The checkout of the **config** repository is done by the `dev prepare` command.

```sh
cd deploy/config
touch myfile
git add myfile && git commit -m"Add myfile"
git review
Expand Down
2 changes: 1 addition & 1 deletion playbooks/group_vars/all.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
config_path: /tmp/config
config_path: "{{ zuul.project.src_dir }}/deploy/config"
fqdn: sfop.me

validate_certs: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
args:
chdir: "{{ config_path }}"
loop:
- "git add {{ config_path }}/nodepool/nodepool-builder.yaml"
- "git add nodepool/nodepool-builder.yaml"
- "git commit -m 'Add nodepool/nodepool-builder.yaml'"

- ansible.builtin.include_role:
Expand Down Expand Up @@ -126,9 +126,9 @@
args:
chdir: "{{ config_path }}"
loop:
- "git add {{ config_path }}/nodepool/nodepool-builder.yaml"
- "git add {{ config_path }}/nodepool/dib-ansible/dummy.yaml"
- "git add {{ config_path }}/nodepool/dib-ansible/inventory.yaml"
- "git add nodepool/nodepool-builder.yaml"
- "git add nodepool/dib-ansible/dummy.yaml"
- "git add nodepool/dib-ansible/inventory.yaml"
- "git commit -m 'Add nodepool builder image config'"

- name: Update config repo change
Expand Down Expand Up @@ -163,4 +163,4 @@
kubectl exec nodepool-builder-0 -- bash -c "grep 'in callback plugin' /var/lib/nodepool/builds/logs/*"
register: timestamp_error
failed_when: timestamp_error is success
ignore_errors: true
ignore_errors: true
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
args:
chdir: "{{ config_path }}"
loop:
- "git add {{ config_path }}/nodepool/nodepool.yaml"
- "git add nodepool/nodepool.yaml"
- "git commit -m 'Add nodepool/nodepool.yaml'"

- ansible.builtin.include_role:
Expand Down Expand Up @@ -113,7 +113,7 @@
args:
chdir: "{{ config_path }}"
loop:
- "git add {{ config_path }}/nodepool/nodepool.yaml"
- "git add nodepool/nodepool.yaml"
- "git commit -m 'Add nodepool/nodepool.yaml'"

- name: Update config repo change
Expand Down
6 changes: 3 additions & 3 deletions roles/health-check/config-update-zuul/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
args:
chdir: "{{ config_path }}"
loop:
- "git add {{ config_path }}/zuul/main.yaml"
- "git commit -m 'Add {{ config_path }}/zuul/main.yaml'"
- "git add zuul/main.yaml"
- "git commit -m 'Add zuul/main.yaml'"

- ansible.builtin.include_role:
name: "health-check/config-repo-submit-change"
Expand All @@ -58,7 +58,7 @@
args:
chdir: "{{ config_path }}"
loop:
- "git add {{ config_path }}/zuul/main.yaml"
- "git add zuul/main.yaml"
- "git commit --amend --no-edit"

- name: Submit change and verify Zuul console output
Expand Down
2 changes: 1 addition & 1 deletion roles/run-tests/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
when: "{{ mode == 'standalone' }}"
- name: utils/manage-hosts
- name: utils/get-gerrit-admin-user-api-key
- name: utils/config-repo-get-or-reset
- name: utils/config-repo-reset
loop_control:
loop_var: role

Expand Down
56 changes: 0 additions & 56 deletions roles/utils/config-repo-get-or-reset/tasks/main.yml

This file was deleted.

14 changes: 14 additions & 0 deletions roles/utils/config-repo-reset/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
- name: Config repo, reset
ansible.builtin.command: "{{ git_cmd }}"
args:
chdir: "{{ config_path }}"
loop:
- git fetch --all
- git checkout master
- git reset --hard origin/master --
- git clean -f -d
loop_control:
loop_var: git_cmd
tags:
- skip_ansible_lint

0 comments on commit 734cc99

Please sign in to comment.