Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clone GitHub repos to the local Gitea during install #212

Open
wants to merge 35 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
d20ba2e
Clone GitHub to the local Gitea during install, in order to avoid Int…
kispaljr Aug 21, 2023
7d0addd
Fix some whitespaces
kispaljr Nov 3, 2023
f304818
Adapting to Victor's changes regarding stock repo handling that happe…
kispaljr Nov 3, 2023
66f93cc
Incorporate changes suggested by Victor
kispaljr Nov 3, 2023
0b4606c
Add missing copyright header
kispaljr Nov 3, 2023
46b398d
Making ansible-lint a bit happier
kispaljr Nov 3, 2023
046db7e
Decrease wait time for creating the new repo in gitea
kispaljr Nov 3, 2023
7397965
Ansible install role: Replace auto-detection of gitea IP by receiving…
kispaljr Nov 3, 2023
5a45916
Make ansible-lint happier
kispaljr Nov 7, 2023
47b6234
Add exceptions for ansible-lint rules wherever it's justified
kispaljr Nov 7, 2023
dfe2649
Ansible: move all Gitea-specific parts out of the install role.
kispaljr Nov 8, 2023
456e465
Fix ansible-lint findings
kispaljr Nov 8, 2023
bae6445
Fix multiline strings
kispaljr Nov 8, 2023
c6f6806
Fix typo
kispaljr Nov 8, 2023
791d7be
Fix idempotency of roles
kispaljr Nov 8, 2023
83019c2
Adjust molecule test of install role
kispaljr Nov 9, 2023
3435afc
Fix ansible-linter findings
kispaljr Nov 9, 2023
9ea5b0a
Fix molecule config
kispaljr Nov 9, 2023
c69df37
Fix install/molecule config
kispaljr Nov 9, 2023
71ab799
Merge remote-tracking branch 'remotes/nokia/github-mirroring' into gi…
kispaljr Nov 9, 2023
9d02ad5
roles/install/molecule test: wait for kind cluster to be ready
kispaljr Nov 9, 2023
2973c15
Fix ansible-lint issue
kispaljr Nov 9, 2023
b90e972
Fix install/molecule test
kispaljr Nov 9, 2023
d3063ef
Fix install/molecule test
kispaljr Nov 10, 2023
85b72b9
Fix install/molecule test
kispaljr Nov 10, 2023
c810d3b
Replace calling kpt CLI with kpt ansible module
kispaljr Nov 10, 2023
73bfec2
ansible-lint
kispaljr Nov 10, 2023
62694fc
Fix install/molecule test
kispaljr Nov 10, 2023
9473f78
Restore creating the Gitea username/password secret also in nephio-sy…
kispaljr Nov 10, 2023
73ca0b4
Fix: Restore creating the Gitea username/password secret also in neph…
kispaljr Nov 10, 2023
747a8a4
debugging install role
kispaljr Nov 10, 2023
9a1564e
debugging install role
kispaljr Nov 10, 2023
4ca8526
Fix molecule test of install role: move setting local git facts from …
kispaljr Nov 10, 2023
5c0461e
Merge nephio/main into github-mirroring to be on the same base as Victor
kispaljr Nov 20, 2023
0123635
Victor's changes
kispaljr Dec 1, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions e2e/provision/playbooks/cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,16 @@
- bootstrap
- install
tasks:

# Git cloning is deliberately done directly on the localhost instead of a pod running in a management cluster.
# This way we only need to assume that the localhost can reach the Internet (i.e. http proxy vars are setup correctly),
kispaljr marked this conversation as resolved.
Show resolved Hide resolved
# but we don't have to assume that workloads running in the clusters can also reach the internet
- name: Clone GitHub repositories to gitea
ansible.builtin.include_tasks: mirror_git_repo_to_gitea.yaml
loop:
- {name: nephio-example-packages, repo_uri: https://github.com/nephio-project/nephio-example-packages.git }
- {name: free5gc-packages, repo_uri: https://github.com/nephio-project/free5gc-packages.git }

- name: Deploy repositories
ansible.builtin.include_role:
name: kpt
Expand Down
57 changes: 57 additions & 0 deletions e2e/provision/playbooks/mirror_git_repo_to_gitea.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
- name: "Create gitea repo: {{ item.name }}"
kubernetes.core.k8s:
context: kind-kind
state: present
definition:
apiVersion: infra.nephio.org/v1alpha1
kind: Repository
metadata:
name: "{{ item.name }}"
namespace: default
spec:
description: "{{ item.name }} repository"
defaultBranch: main

- name: "Pull GitHub repo {{ item.name }}"
ansible.builtin.git:
repo: "{{ item.repo_uri }}"
dest: "/tmp/repository/{{ item.name }}.git"
bare: yes

- name: "Add gitea remote to local git repo"
ansible.builtin.shell: |
cd /tmp/repository/{{ item.name }}.git ; git remote add gitea http://nephio:[email protected]:3000/nephio/{{ item.name }}.git
kispaljr marked this conversation as resolved.
Show resolved Hide resolved
kispaljr marked this conversation as resolved.
Show resolved Hide resolved

- name: "Push tags to gitea: {{ item.name }}"
ansible.builtin.shell: |
cd /tmp/repository/{{ item.name }}.git ; no_proxy="$no_proxy,172.18.0.200" NO_PROXY="$NO_PROXY,172.18.0.200" git push gitea --tags --force
kispaljr marked this conversation as resolved.
Show resolved Hide resolved
register: push_result
until: push_result is not failed
retries: 60
delay: 10

- name: "Push branches to gitea: {{ item.name }}"
ansible.builtin.shell: |
cd /tmp/repository/{{ item.name }}.git ; no_proxy="$no_proxy,172.18.0.200" NO_PROXY="$NO_PROXY,172.18.0.200" git push gitea --all --force
kispaljr marked this conversation as resolved.
Show resolved Hide resolved

- name: "Create porch repository object: {{ item.name }}"
kubernetes.core.k8s:
context: kind-kind
state: present
definition:
apiVersion: config.porch.kpt.dev/v1alpha1
kind: Repository
metadata:
name: "{{ item.name }}"
namespace: default
labels:
kpt.dev/repository-access: read-only
kpt.dev/repository-content: external-blueprints
spec:
content: Package
deployment: false
git:
branch: main
directory: /
repo: "http://172.18.0.200:3000/nephio/{{ item.name }}.git"
kispaljr marked this conversation as resolved.
Show resolved Hide resolved
type: git