diff --git a/press/docker/Dockerfile b/press/docker/Dockerfile index 5aa79a6fac..8fafc99e5f 100644 --- a/press/docker/Dockerfile +++ b/press/docker/Dockerfile @@ -7,8 +7,11 @@ ENV DEBIAN_FRONTEND noninteractive ENV OPENBLAS_NUM_THREADS 1 ENV MKL_NUM_THREADS 1 -#update replace archive.ubuntu.com by sg.archive.ubuntu.com in source.list -RUN sed -i -e "s/archive\.ubuntu\.com/sg\.archive\.ubuntu\.com/" /etc/apt/sources.list +#replace archive.ubuntu.com by mirror server in source.list +{% if doc.mirror_server %} +RUN sed -i -e "s/archive.ubuntu.com/{{doc.mirror_server}}/" /etc/apt/sources.list +RUN sed -i -e "s/security.ubuntu.com/{{doc.mirror_server}}/" /etc/apt/sources.list +{% endif %} # Install essential packages RUN --mount=type=cache,target=/var/cache/apt apt-get update \ diff --git a/press/playbooks/mirror.yml b/press/playbooks/mirror.yml index 83e68d0dfa..b11307560f 100644 --- a/press/playbooks/mirror.yml +++ b/press/playbooks/mirror.yml @@ -5,18 +5,18 @@ become_user: root gather_facts: yes roles: + - role: essentials + - role: user + - role: nginx + - role: agent - role: mirror - # - role: essentials - # - role: user - # - role: nginx - # - role: agent - # - role: node_exporter - # - role: deadlock_logger - # - role: filebeat - # - role: clamav - # - role: aide - # - role: additional_process_hardening - # - role: warning_banners - # - role: auditd - # - role: sshd_hardening - # - role: pam + - role: node_exporter + - role: deadlock_logger + - role: filebeat + - role: clamav + - role: aide + - role: additional_process_hardening + - role: warning_banners + - role: auditd + - role: sshd_hardening + - role: pam diff --git a/press/press/doctype/deploy_candidate/deploy_candidate.json b/press/press/doctype/deploy_candidate/deploy_candidate.json index 1549e98a62..db509f2c42 100644 --- a/press/press/doctype/deploy_candidate/deploy_candidate.json +++ b/press/press/doctype/deploy_candidate/deploy_candidate.json @@ -7,6 +7,7 @@ "field_order": [ "status", "is_remote_builder_used", + "mirror_server", "column_break_2", "group", "team", @@ -406,6 +407,12 @@ "fieldtype": "Int", "label": "Retry Count", "read_only": 1 + }, + { + "fieldname": "mirror_server", + "fieldtype": "Link", + "label": "Mirror Server", + "options": "Mirror Server" } ], "links": [ @@ -422,7 +429,7 @@ "link_fieldname": "document_name" } ], - "modified": "2024-05-24 11:50:55.127138", + "modified": "2024-06-05 11:13:35.702377", "modified_by": "Administrator", "module": "Press", "name": "Deploy Candidate", diff --git a/press/press/doctype/deploy_candidate/deploy_candidate.py b/press/press/doctype/deploy_candidate/deploy_candidate.py index c1eef960e3..b4022e6f54 100644 --- a/press/press/doctype/deploy_candidate/deploy_candidate.py +++ b/press/press/doctype/deploy_candidate/deploy_candidate.py @@ -108,6 +108,7 @@ class DeployCandidate(Document): manually_failed: DF.Check merge_all_rq_queues: DF.Check merge_default_and_short_rq_queues: DF.Check + mirror_server: DF.Link | None packages: DF.Table[DeployCandidatePackage] pending_duration: DF.Time | None pending_end: DF.Datetime | None diff --git a/press/press/doctype/release_group/release_group.py b/press/press/doctype/release_group/release_group.py index 220f9271df..76057b1b40 100644 --- a/press/press/doctype/release_group/release_group.py +++ b/press/press/doctype/release_group/release_group.py @@ -547,6 +547,7 @@ def create_deploy_candidate(self, apps_to_update=None) -> "Optional[DeployCandid "dependencies": dependencies, "packages": packages, "environment_variables": environment_variables, + "mirror_server": self.mirror_server, } ).insert()