Skip to content

Commit

Permalink
[restructure] quality of life, few fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rahilarious committed Aug 1, 2023
1 parent 2155ca0 commit 399339f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
18 changes: 7 additions & 11 deletions 00-gentoo/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ RUN \
\
if [ -d /var/db/repos/gentoo/.git ]; then \
echo "##### Found git Gentoo repo #####" && \
emerge -vgkbn --quiet-build dev-vcs/git 2>/dev/null && \
emerge -vgkbn --quiet-build dev-vcs/git && \
echo '[gentoo]' >> /etc/portage/repos.conf && \
echo 'location = /var/db/repos/gentoo' >> /etc/portage/repos.conf && \
echo 'sync-type = git' >> /etc/portage/repos.conf && \
Expand All @@ -52,7 +52,7 @@ RUN \
fi && \
\
echo '###### Syncing gentoo repo #######' && \
emerge --sync 2>/dev/null && \
emerge --sync && \
\
if [ -f /etc/portage/repos.conf ]; then \
echo '##### Removing repos.conf #####' && \
Expand All @@ -61,8 +61,7 @@ RUN \
\
echo '####### Update portage,gcc,binutils,linux-headers if necessary ######' && \
emerge -v --quiet-build -gkb1u --with-bdeps=y sys-apps/portage && \
emerge -vgkbu1 --quiet-build --with-bdeps=y sys-devel/gcc sys-devel/binutils sys-kernel/linux-headers 2>/dev/null && \
emerge -c 2>/dev/null && \
emerge -vgkbu1 --quiet-build --with-bdeps=y -X "sys-devel/gcc:12" sys-devel/gcc sys-devel/binutils sys-kernel/linux-headers && \
\
emerge -vgkbn --quiet-build --with-bdeps=y sys-devel/distcc && \
echo '###### Enabling distcc ########' && \
Expand All @@ -73,8 +72,8 @@ RUN \
echo '######## Distcc servers are set as follows #######' && \
distcc-config --get-hosts && \
\
emerge -vgkbn --quiet-build --with-bdeps=y dev-vcs/git 2>/dev/null && \
emerge -vgkbn1 --quiet-build --with-bdeps=n -X 'dev-lang/rust' app-admin/ansible-core 2>/dev/null && \
emerge -vgkbn --quiet-build dev-vcs/git && \
emerge -vgkbn1 --quiet-build --with-bdeps=n -X 'dev-lang/rust' app-admin/ansible-core && \
\
mkdir -v /tmp/ansible-homelab && \
git clone "${ANSIBLE_REPO}" /tmp/ansible-homelab && \
Expand Down Expand Up @@ -110,19 +109,16 @@ RUN \
emerge --sync; \
fi && \
\
echo '############ Cleanup orphan packages #########' && \
emerge -c 2>/dev/null && \
\
echo '############ Rebuilding whole stage3 #########' && \
emerge -vgkb --quiet-build --with-bdeps=y -e @world 2>/dev/null && \
emerge -vgkb --quiet-build --with-bdeps=y -e -X "sys-devel/gcc:12" @world && \
\
echo '############ Post installation configurations #########' && \
\
echo '############ setting mg as default editor #########' && \
eselect editor set mg && \
\
echo '############ Cleaning up #########' && \
emerge -c 2>/dev/null && \
emerge -c && \
distcc-config --set-hosts "localhost" && \
sed -i -e "s|${LOCAL_MIRROR}||g" /etc/portage/make.conf/mirrors && \
rm -rf /root/.ansible /tmp/ansible* /var/tmp/portage && \
Expand Down
2 changes: 1 addition & 1 deletion 01-gentoo-distccd/extra_tag
Original file line number Diff line number Diff line change
@@ -1 +1 @@
gcc-13.1-binutils-2.40-clang-16.0
gcc-13.2-binutils-2.40-clang-16.0
11 changes: 10 additions & 1 deletion automation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
set -e

### variables
BUILD_TAG=$(date +%Y%m%d%H%M%S)
BUILD_TAG=$(date +%Y%m%d%H%M)
REGISTRIES_WITH_USERNAME="ghcr.io/rahilarious docker.io/rahilarious"
MAIN_REGISTRY_WITH_USERNAME="ghcr.io/rahilarious"
MICROARCHS="x86-64-v2 x86-64-v3"
Expand All @@ -30,10 +30,19 @@ do
exit 1
fi

### SAVE gentoo IMAGES in tar.zst to /tmp for release
if [[ ${PKG_NAME} == "gentoo" ]]
then
echo "########## Saving gentoo:${MICROARCH} image in /tmp ############"
sudo podman save ${MAIN_REGISTRY_WITH_USERNAME}/${PKG_NAME}:${MICROARCH} | zstdmt -z > /tmp/${PKG_NAME}-${MICROARCH}-${BUILD_TAG}.tar.zst
ls -lah /tmp
fi

### TAG & PUSH IMAGE
for REGISTRY_WITH_USERNAME in ${REGISTRIES_WITH_USERNAME}
do
echo "########## ${REGISTRY_WITH_USERNAME} ############"

### TAG & PUSH BASE TAG
if [[ ${REGISTRY_WITH_USERNAME} != ${MAIN_REGISTRY_WITH_USERNAME} ]]
then
Expand Down

0 comments on commit 399339f

Please sign in to comment.