From a5b86fc6a30f9a701a6b62cf9aa5798d478c9690 Mon Sep 17 00:00:00 2001 From: Leonardo Rossetti Date: Jul 06 2022 13:17:07 +0000 Subject: seed dev env --- diff --git a/checkout-seed-files/README.md b/checkout-seed-files/README.md new file mode 100644 index 0000000..de40982 --- /dev/null +++ b/checkout-seed-files/README.md @@ -0,0 +1,9 @@ +# Checkout Seed Files + +Development environment for seed files script(s) + +## Running + +``` +podman-compose up +``` diff --git a/checkout-seed-files/docker-compose.yaml b/checkout-seed-files/docker-compose.yaml new file mode 100644 index 0000000..b0f56fb --- /dev/null +++ b/checkout-seed-files/docker-compose.yaml @@ -0,0 +1,10 @@ +version: "3.9" +services: + rpm-git-seed: + build: "./images/rpm-repos" + # image: quay.io/lrossett/rpm-repos:latest + retart: always + volumes: + - "./volumes/dev:/devenv" + command: ["sleep", "infinity"] + diff --git a/checkout-seed-files/images/rpm-repos/Dockerfile b/checkout-seed-files/images/rpm-repos/Dockerfile new file mode 100644 index 0000000..1c266d5 --- /dev/null +++ b/checkout-seed-files/images/rpm-repos/Dockerfile @@ -0,0 +1,28 @@ +FROM quay.io/fedora/fedora:36 + +ARG SEED_SCRIPT_URL=https://pagure.io/fedora-infra/ansible/raw/main/f/roles/git/make_checkout_seed/files/make-git-checkout-seed.sh +ARG REPORT_SCRIPT_URL=https://pagure.io/fedora-infra/ansible/raw/main/f/roles/git/make_checkout_seed/files/alternative_arch_report.py + +RUN dnf install -y \ +crun \ +git \ +tar \ +xz \ +python2 \ +python2-devel \ +mailx \ +sendmail + +COPY files/get-repos /usr/local/bin + +RUN mkdir -p \ +/dev \ +/srv/git/repositories/rpms \ +/srv/cache/lookaside \ +/srv/git_seed/{git-checkout,rpm-specs} + +RUN curl ${SEED_SCRIPT_URL} > /usr/local/bin/make-git-checkout-seed.sh && \ +chmod +x /usr/local/bin/make-git-checkout-seed.sh + +RUN curl ${REPORT_SCRIPT_URL} > /usr/local/bin/alternative_arch_report.py && \ +chmod +x /usr/local/bin/alternative_arch_report.py diff --git a/checkout-seed-files/images/rpm-repos/Makefile b/checkout-seed-files/images/rpm-repos/Makefile new file mode 100644 index 0000000..4be7f30 --- /dev/null +++ b/checkout-seed-files/images/rpm-repos/Makefile @@ -0,0 +1,18 @@ +shell := /bin/bash +REG := quay.io +ORG := lrossett +NAME := rpm-repos +TAG := latest +IMAGE := ${REG}/${ORG}/${NAME}:${TAG} +CRI := podman + +build: + ${CRI} build -t ${IMAGE} . + +push: build + ${CRI} push ${IMAGE} + +debug: build + ${CRI} run -it --entrypoint /bin/bash ${IMAGE} + +.PHONY: build push debug diff --git a/checkout-seed-files/images/rpm-repos/files/get-repos b/checkout-seed-files/images/rpm-repos/files/get-repos new file mode 100755 index 0000000..6f22e91 --- /dev/null +++ b/checkout-seed-files/images/rpm-repos/files/get-repos @@ -0,0 +1,12 @@ +#!/bin/bash + +: "${SCM_URL:=https://src.fedoraproject.org/rpms}" +: "${SCM_REPOS:=time,python-flask,aalib,rpkg}" +: "${REPO_DIR:=/srv/git/repositories/rpms}" + +for repo in $(echo $SCM_REPOS | tr ',' '\n'); do + ( + cd $REPO_DIR; + git clone --bare $SCM_URL/$repo.git; + ) +done diff --git a/checkout-seed-files/volumes/dev/.keepme b/checkout-seed-files/volumes/dev/.keepme new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/checkout-seed-files/volumes/dev/.keepme