Skip to content

Commit

Permalink
Switch everything to use mirrors (#2131)
Browse files Browse the repository at this point in the history
Co-authored-by: ricolin <[email protected]>
  • Loading branch information
mnaser and ricolin authored Nov 15, 2024
1 parent 3b65b66 commit 102dfbe
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 11 deletions.
2 changes: 1 addition & 1 deletion roles/defaults/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ func AssertAtmosphereImage(t *testing.T, expected string, value string) {
image, err := GetImageByKey(imageName)
require.NoError(t, err)

assert.Equal(t, expected, image)
assert.Contains(t, image, expected)
}
13 changes: 10 additions & 3 deletions zuul.d/jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
- job:
name: atmosphere-golang-go-test
parent: atmosphere-golang-go
pre-run:
- zuul.d/playbooks/common/switch-to-atmosphere-mirror.yml
vars:
go_command: test ./... -v

Expand All @@ -34,20 +36,25 @@
- job:
name: atmosphere-build-collection
parent: build-ansible-collection
pre-run: zuul.d/playbooks/build-collection/pre.yml
pre-run:
- zuul.d/playbooks/common/switch-to-atmosphere-mirror.yml
- zuul.d/playbooks/build-collection/pre.yml
irrelevant-files:
- ^doc/

- job:
name: atmosphere-publish-collection
parent: publish-ansible-collection-vexxhost
pre-run: zuul.d/playbooks/build-collection/pre.yml
pre-run:
- zuul.d/playbooks/build-collection/pre.yml

- job:
name: atmosphere-molecule
parent: tox
abstract: true
pre-run: zuul.d/playbooks/molecule/pre.yml
pre-run:
- zuul.d/playbooks/common/switch-to-atmosphere-mirror.yml
- zuul.d/playbooks/molecule/pre.yml
run: zuul.d/playbooks/molecule/run.yml
post-run: zuul.d/playbooks/molecule/post.yml
irrelevant-files:
Expand Down
15 changes: 15 additions & 0 deletions zuul.d/playbooks/common/switch-to-atmosphere-mirror.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
- name: Switch to Atmosphere image mirror
hosts: all
tasks:
# TODO(mnaser): Drop this when we can use https://github.com/vexxhost/atmosphere/pull/977
- name: Prefix all images for the job to point to mirror
ansible.builtin.shell: |
sed -i '/registry.atmosphere.dev/!s/ \(.*\): \(.*\)$/ \1: registry.atmosphere.dev\/\2/' roles/defaults/vars/main.yml
args:
chdir: "{{ zuul.project.src_dir }}"

- name: Print out the image list
ansible.builtin.shell: |
cat roles/defaults/vars/main.yml
args:
chdir: "{{ zuul.project.src_dir }}"
7 changes: 0 additions & 7 deletions zuul.d/playbooks/molecule/pre.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,6 @@
opts: nodev,nosuid,size=512M
state: mounted

# TODO(mnaser): Drop this when we can use https://github.com/vexxhost/atmosphere/pull/977
- name: Prefix all images for the job to point to mirror
ansible.builtin.shell: |
sed -i '/registry.atmosphere.dev/!s/ \(.*\): \(.*\)$/ \1: registry.atmosphere.dev\/\2/' roles/defaults/vars/main.yml
args:
chdir: "{{ zuul.project.src_dir }}"

# TODO(mnaser): Drop this when we move to PBR
- name: Add current folder to Git's safe directories
become: true
Expand Down

0 comments on commit 102dfbe

Please sign in to comment.