From 768c5f296b0c5ff5f22ead03642db5dca194089f Mon Sep 17 00:00:00 2001 From: ckonstanski Date: Tue, 19 Dec 2023 21:40:43 -0700 Subject: salt in a virtualenv --- bootstrap/run_salt.sh | 9 +++++---- build-docker-containers.sh | 4 ++-- pillar/gentoo_baseimage/gentoo_baseimage.sls | 7 +++++++ salt/gentoo_baseimage/gentoo_baseimage/files/build.sh | 2 +- .../gentoo_baseimage/files/eselect-repo.conf | 4 ++++ salt/gentoo_baseimage/gentoo_baseimage/files/installdeps.sh | 13 ------------- salt/gentoo_baseimage/gentoo_baseimage/files/make.conf | 3 ++- 7 files changed, 21 insertions(+), 21 deletions(-) create mode 100644 salt/gentoo_baseimage/gentoo_baseimage/files/eselect-repo.conf diff --git a/bootstrap/run_salt.sh b/bootstrap/run_salt.sh index d36e5d5..f8eaa02 100755 --- a/bootstrap/run_salt.sh +++ b/bootstrap/run_salt.sh @@ -1,8 +1,9 @@ #!/bin/bash -e -working_dir="${1}" -build_basedir="${2}" -local_build="${3:-false}" +salt_bin="${1}" +working_dir="${2}" +build_basedir="${3}" +local_build="${4:-false}" salt_running_p() { ps -ef | grep -F "salt-call" | grep -v "grep" @@ -13,7 +14,7 @@ while salt_running_p; do sleep 5 done -salt-call \ +${salt_bin}/salt-call \ --local \ --pillar-root=${working_dir}/pillar \ --file-root=${working_dir}/salt \ diff --git a/build-docker-containers.sh b/build-docker-containers.sh index 5c5038f..422183f 100755 --- a/build-docker-containers.sh +++ b/build-docker-containers.sh @@ -11,9 +11,9 @@ sudo rm -rf ${builddir} cp ${HOME}/config.yaml.gentoo-baseimage ${working_dir}/bootstrap/config.yaml # run salt to create build scripts -sudo ${working_dir}/bootstrap/run_salt.sh ${working_dir} ${builddir} ${local_build} +${working_dir}/bootstrap/run_salt.sh ${SALT_BIN} ${working_dir} ${builddir} ${local_build} # build new docker container -sudo ${builddir}/ci/build.sh +${builddir}/ci/build.sh exit 0 diff --git a/pillar/gentoo_baseimage/gentoo_baseimage.sls b/pillar/gentoo_baseimage/gentoo_baseimage.sls index f50b4d1..c9ee865 100644 --- a/pillar/gentoo_baseimage/gentoo_baseimage.sls +++ b/pillar/gentoo_baseimage/gentoo_baseimage.sls @@ -59,3 +59,10 @@ gentoo_baseimage: mode: "0644" is_template: True relative_to_buildroot: True + eselect_repo_conf: + name: eselect-repo.conf + path: data/etc/portage/repos.conf + source: eselect-repo.conf + mode: "0644" + is_template: True + relative_to_buildroot: True diff --git a/salt/gentoo_baseimage/gentoo_baseimage/files/build.sh b/salt/gentoo_baseimage/gentoo_baseimage/files/build.sh index e0f0cb1..d06e6dd 100644 --- a/salt/gentoo_baseimage/gentoo_baseimage/files/build.sh +++ b/salt/gentoo_baseimage/gentoo_baseimage/files/build.sh @@ -27,7 +27,7 @@ for image in $(docker images | awk '{print $3}'); do done echo "Building docker image" -docker build -t {{ pillar["gentoo_baseimage"]["image_name"] }}:{{ pillar["ci"]["tag"] }} . +docker build --progress plain -t {{ pillar["gentoo_baseimage"]["image_name"] }}:{{ pillar["ci"]["tag"] }} . {% if pillar["ci"]["local_build"] == False %} echo "Push docker image to the registry" diff --git a/salt/gentoo_baseimage/gentoo_baseimage/files/eselect-repo.conf b/salt/gentoo_baseimage/gentoo_baseimage/files/eselect-repo.conf new file mode 100644 index 0000000..b129b3a --- /dev/null +++ b/salt/gentoo_baseimage/gentoo_baseimage/files/eselect-repo.conf @@ -0,0 +1,4 @@ +[lisp] +location = /var/db/repos/lisp +sync-type = git +sync-uri = https://anongit.gentoo.org/git/proj/lisp.git diff --git a/salt/gentoo_baseimage/gentoo_baseimage/files/installdeps.sh b/salt/gentoo_baseimage/gentoo_baseimage/files/installdeps.sh index 6c1964f..9aaf18f 100644 --- a/salt/gentoo_baseimage/gentoo_baseimage/files/installdeps.sh +++ b/salt/gentoo_baseimage/gentoo_baseimage/files/installdeps.sh @@ -13,17 +13,4 @@ source /etc/profile eselect news read all eselect news purge etc-update --automode -5 -emerge app-portage/layman -layman -L -layman -a lisp -echo 'source "/var/lib/layman/make.conf"' >> /etc/portage/make.conf -cat >/var/lib/layman/make.conf <