Skip to content

Commit

Permalink
[all] Switching to curly braces output redirection syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
rahilarious committed Aug 23, 2023
1 parent 3e30945 commit 4ad3cd5
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 52 deletions.
84 changes: 47 additions & 37 deletions 00-gentoo/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,39 +16,47 @@ RUN \
echo '##### Configuring make.conf ######' && \
cp /etc/portage/make.conf /etc/portage/original-make.conf && \
sed -i "s|-O2|-march=x86-64-${MICROARCH_LEVEL} -O2|g" /etc/portage/make.conf && \
echo "GOAMD64=${MICROARCH_LEVEL}" >> /etc/portage/make.conf && \
echo "RUSTFLAGS='-C target-cpu=x86-64-${MICROARCH_LEVEL} -C strip=symbols -C opt-level=2'" >> /etc/portage/make.conf && \
echo "FEATURES='${PORTAGE_FEATURES}'" >> /etc/portage/make.conf && \
echo 'ACCEPT_KEYWORDS="~${ARCH}"' >> /etc/portage/make.conf && \
echo "GENTOO_MIRRORS='${LOCAL_MIRROR} http://ftp.fau.de/gentoo http://ftp.snt.utwente.nl/pub/os/linux/gentoo http://ftp-stud.hs-esslingen.de/pub/Mirrors/gentoo/ http://distfiles.gentoo.org'" >> /etc/portage/make.conf && \
echo "CPU_FLAGS_X86='${PORTAGE_CPU_FLAGS}'" >> /etc/portage/make.conf && \
echo "USE='lto jit -iptables nftables pgo -smartcard tofu graphite'" >> /etc/portage/make.conf && \
echo 'BINPKG_FORMAT="gpkg"' >> /etc/portage/make.conf && \
echo 'CLEAN_DELAY="3"' >> /etc/portage/make.conf && \
echo "MAKEOPTS=\"-j$(nproc --ignore=${SUBSTRACT_NO_OF_CPU_BY}) -l$(nproc)\"" >> /etc/portage/make.conf && \
{ \
echo "GOAMD64=${MICROARCH_LEVEL}"; \
echo "RUSTFLAGS='-C target-cpu=x86-64-${MICROARCH_LEVEL} -C strip=symbols -C opt-level=2'"; \
echo "FEATURES='${PORTAGE_FEATURES}'"; \
echo 'ACCEPT_KEYWORDS="~${ARCH}"'; \
echo "GENTOO_MIRRORS='${LOCAL_MIRROR} http://ftp.fau.de/gentoo http://ftp.snt.utwente.nl/pub/os/linux/gentoo http://ftp-stud.hs-esslingen.de/pub/Mirrors/gentoo/ http://distfiles.gentoo.org'"; \
echo "CPU_FLAGS_X86='${PORTAGE_CPU_FLAGS}'"; \
echo "USE='lto jit -iptables nftables pgo -smartcard tofu graphite'"; \
echo 'BINPKG_FORMAT="gpkg"'; \
echo 'CLEAN_DELAY="3"'; \
echo "MAKEOPTS=\"-j$(nproc --ignore=${SUBSTRACT_NO_OF_CPU_BY}) -l$(nproc)\""; \
} >> /etc/portage/make.conf && \
\
if [ -n "${BINHOST_URI}" ]; then \
echo '##### Configuring binrepos.conf ######' && \
echo '[binhost]' >> /etc/portage/binrepos.conf && \
echo "priority=100" >> /etc/portage/binrepos.conf && \
echo "sync-uri=${BINHOST_URI}" >> /etc/portage/binrepos.conf; \
{ \
echo '[binhost]'; \
echo "priority=100"; \
echo "sync-uri=${BINHOST_URI}"; \
} >> /etc/portage/binrepos.conf; \
fi && \
\
echo '##### Configuring locale.gen in case glibc needs update ######' && \
echo 'en_IN UTF-8' >> /etc/locale.gen && \
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen && \
echo "en_US ISO-8859-1" >> /etc/locale.gen && \
{ \
echo 'en_IN UTF-8'; \
echo "en_US.UTF-8 UTF-8"; \
echo "en_US ISO-8859-1"; \
} >> /etc/locale.gen && \
\
if [ -d /var/db/repos/gentoo/.git ]; then \
echo "##### Found git Gentoo repo #####" && \
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 && \
echo 'sync-uri = https://github.com/gentoo-mirror/gentoo.git' >> /etc/portage/repos.conf && \
echo 'clone-depth = 1' >> /etc/portage/repos.conf && \
echo 'sync-depth = 1' >> /etc/portage/repos.conf && \
echo 'autosync = yes' >> /etc/portage/repos.conf; \
{ \
echo '[gentoo]'; \
echo 'location = /var/db/repos/gentoo'; \
echo 'sync-type = git'; \
echo 'sync-uri = https://github.com/gentoo-mirror/gentoo.git'; \
echo 'clone-depth = 1'; \
echo 'sync-depth = 1'; \
echo 'autosync = yes'; \
} >> /etc/portage/repos.conf; \
fi && \
\
echo '###### Syncing gentoo repo #######' && \
Expand Down Expand Up @@ -84,20 +92,22 @@ RUN \
echo '############ Dirty trick to force it as container #########' && \
sed -i -e '/virtualization_type/d' /tmp/ansible-homelab/playbooks/set_facts.yml && \
\
echo 'gentoo_base_packages:' >> /tmp/ansible-homelab/host_vars/currenthost.yml && \
echo ' - app-editors/mg' >> /tmp/ansible-homelab/host_vars/currenthost.yml && \
echo ' - app-misc/tmux' >> /tmp/ansible-homelab/host_vars/currenthost.yml && \
echo ' - app-shells/bash-completion' >> /tmp/ansible-homelab/host_vars/currenthost.yml && \
echo ' - app-text/tree' >> /tmp/ansible-homelab/host_vars/currenthost.yml && \
echo ' - sys-apps/lsb-release' >> /tmp/ansible-homelab/host_vars/currenthost.yml && \
echo ' - sys-process/htop' >> /tmp/ansible-homelab/host_vars/currenthost.yml && \
echo 'portage_features:' >> /tmp/ansible-homelab/host_vars/currenthost.yml && \
echo " - '${PORTAGE_FEATURES}'" >> /tmp/ansible-homelab/host_vars/currenthost.yml && \
echo "portage_local_mirror: '${LOCAL_MIRROR}'" >> /tmp/ansible-homelab/host_vars/currenthost.yml && \
echo "portage_march: x86-64-${MICROARCH_LEVEL}" >> /tmp/ansible-homelab/host_vars/currenthost.yml && \
echo "portage_goamd64: ${MICROARCH_LEVEL}" >> /tmp/ansible-homelab/host_vars/currenthost.yml && \
echo "portage_cpu_flags: '${PORTAGE_CPU_FLAGS}'" >> /tmp/ansible-homelab/host_vars/currenthost.yml && \
echo "gentoo_binpkg_server_uri: '${BINHOST_URI}'" >> /tmp/ansible-homelab/host_vars/currenthost.yml && \
{ \
echo 'gentoo_base_packages:'; \
echo ' - app-editors/mg'; \
echo ' - app-misc/tmux'; \
echo ' - app-shells/bash-completion'; \
echo ' - app-text/tree'; \
echo ' - sys-apps/lsb-release'; \
echo ' - sys-process/htop'; \
echo 'portage_features:'; \
echo " - '${PORTAGE_FEATURES}'"; \
echo "portage_local_mirror: '${LOCAL_MIRROR}'"; \
echo "portage_march: x86-64-${MICROARCH_LEVEL}"; \
echo "portage_goamd64: ${MICROARCH_LEVEL}"; \
echo "portage_cpu_flags: '${PORTAGE_CPU_FLAGS}'"; \
echo "gentoo_binpkg_server_uri: '${BINHOST_URI}'"; \
} >> /tmp/ansible-homelab/host_vars/currenthost.yml && \
\
ansible-playbook -l currenthost local.yml && \
\
Expand Down
8 changes: 5 additions & 3 deletions 01-gentoo-distccd/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ RUN \
\
if [ -n "${BINHOST_URI}" ]; then \
echo '##### Configuring binrepos.conf ######' && \
echo '[binhost]' >> /etc/portage/binrepos.conf && \
echo "priority=100" >> /etc/portage/binrepos.conf && \
echo "sync-uri=${BINHOST_URI}" >> /etc/portage/binrepos.conf; \
{ \
echo '[binhost]'; \
echo "priority=100"; \
echo "sync-uri=${BINHOST_URI}"; \
} >> /etc/portage/binrepos.conf; \
fi && \
\
emerge -vbgk --quiet-build ${PKG_NAME} && \
Expand Down
8 changes: 5 additions & 3 deletions 02-gentoo-caddy/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ RUN \
\
if [ -n "${BINHOST_URI}" ]; then \
echo '##### Configuring binrepos.conf ######' && \
echo '[binhost]' >> /etc/portage/binrepos.conf && \
echo "priority=100" >> /etc/portage/binrepos.conf && \
echo "sync-uri=${BINHOST_URI}" >> /etc/portage/binrepos.conf; \
{ \
echo '[binhost]'; \
echo "priority=100"; \
echo "sync-uri=${BINHOST_URI}"; \
} >> /etc/portage/binrepos.conf; \
fi && \
\
mkdir -p /srv /config/caddy /data/caddy && \
Expand Down
8 changes: 5 additions & 3 deletions 03-gentoo-coredns/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ RUN \
\
if [ -n "${BINHOST_URI}" ]; then \
echo '##### Configuring binrepos.conf ######' && \
echo '[binhost]' >> /etc/portage/binrepos.conf && \
echo "priority=100" >> /etc/portage/binrepos.conf && \
echo "sync-uri=${BINHOST_URI}" >> /etc/portage/binrepos.conf; \
{ \
echo '[binhost]'; \
echo "priority=100"; \
echo "sync-uri=${BINHOST_URI}"; \
} >> /etc/portage/binrepos.conf; \
fi && \
\
emerge -vbgk --with-bdeps=y -o --quiet-build ${PKG_NAME} && \
Expand Down
8 changes: 5 additions & 3 deletions 04-gentoo-transmission/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ RUN \
\
if [ -n "${BINHOST_URI}" ]; then \
echo '##### Configuring binrepos.conf ######' && \
echo '[binhost]' >> /etc/portage/binrepos.conf && \
echo "priority=100" >> /etc/portage/binrepos.conf && \
echo "sync-uri=${BINHOST_URI}" >> /etc/portage/binrepos.conf; \
{ \
echo '[binhost]'; \
echo "priority=100"; \
echo "sync-uri=${BINHOST_URI}"; \
} >> /etc/portage/binrepos.conf; \
fi && \
\
emerge -vbgk --with-bdeps=y -o --quiet-build ${PKG_NAME} && \
Expand Down
8 changes: 5 additions & 3 deletions 05-gentoo-syncthing/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ RUN \
\
if [ -n "${BINHOST_URI}" ]; then \
echo '##### Configuring binrepos.conf ######' && \
echo '[binhost]' >> /etc/portage/binrepos.conf && \
echo "priority=100" >> /etc/portage/binrepos.conf && \
echo "sync-uri=${BINHOST_URI}" >> /etc/portage/binrepos.conf; \
{ \
echo '[binhost]'; \
echo "priority=100"; \
echo "sync-uri=${BINHOST_URI}"; \
} >> /etc/portage/binrepos.conf; \
fi && \
\
emerge -vbgk --with-bdeps=y -o --quiet-build ${PKG_NAME} && \
Expand Down

0 comments on commit 4ad3cd5

Please sign in to comment.