fix: make shellcheck happy and use ssh agent fw
This commit is contained in:
@@ -8,7 +8,6 @@ CTX="${WORK_DIR}/ctx"
|
|||||||
|
|
||||||
IMAGE="docker.io/gentoo/stage3:amd64-desktop-openrc"
|
IMAGE="docker.io/gentoo/stage3:amd64-desktop-openrc"
|
||||||
PROFILE="default/linux/amd64/23.0/desktop"
|
PROFILE="default/linux/amd64/23.0/desktop"
|
||||||
CFLAGS="-O2 -pipe -march=x86-64-v3"
|
|
||||||
|
|
||||||
if [[ ! -d "$REPO/.git" ]]; then
|
if [[ ! -d "$REPO/.git" ]]; then
|
||||||
git clone "$REPO_URL" "$REPO"
|
git clone "$REPO_URL" "$REPO"
|
||||||
@@ -16,7 +15,7 @@ else
|
|||||||
git -C "$REPO" pull --rebase
|
git -C "$REPO" pull --rebase
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Aggregating configuration..."
|
echo "Aggregating config..."
|
||||||
rm -rf "$CTX" && mkdir -p "$CTX"/var/lib/portage
|
rm -rf "$CTX" && mkdir -p "$CTX"/var/lib/portage
|
||||||
|
|
||||||
# config types to merge
|
# config types to merge
|
||||||
@@ -29,7 +28,7 @@ for type in "${CONFIGS[@]}"; do
|
|||||||
inject() {
|
inject() {
|
||||||
local src=$1 prefix=$2
|
local src=$1 prefix=$2
|
||||||
[[ ! -e "$src" ]] && return
|
[[ ! -e "$src" ]] && return
|
||||||
|
|
||||||
if [[ -d "$src" ]]; then
|
if [[ -d "$src" ]]; then
|
||||||
for f in "$src"/*; do
|
for f in "$src"/*; do
|
||||||
[[ -f "$f" ]] && cp "$f" "$dest/${prefix}-$(basename "$f")"
|
[[ -f "$f" ]] && cp "$f" "$dest/${prefix}-$(basename "$f")"
|
||||||
@@ -58,8 +57,6 @@ cp "$REPO/binhost/make.conf" "$CTX/etc/portage/make.conf"
|
|||||||
{
|
{
|
||||||
# we don't want build to fail bcs of EULA check..
|
# we don't want build to fail bcs of EULA check..
|
||||||
echo 'ACCEPT_LICENSE="*"'
|
echo 'ACCEPT_LICENSE="*"'
|
||||||
echo "CFLAGS=\"$CFLAGS\""
|
|
||||||
echo "CXXFLAGS=\"$CFLAGS\""
|
|
||||||
} >> "$CTX/etc/portage/make.conf"
|
} >> "$CTX/etc/portage/make.conf"
|
||||||
|
|
||||||
echo "Starting Builder..."
|
echo "Starting Builder..."
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ HOSTNAME_TAG="${HOSTNAME:-$(hostname)}"
|
|||||||
# remote trigger
|
# remote trigger
|
||||||
SERVER_USER="mira"
|
SERVER_USER="mira"
|
||||||
SERVER_IP="192.168.102.148"
|
SERVER_IP="192.168.102.148"
|
||||||
SERVER_BINHOST_DIR="~/gentoo-pill"
|
SERVER_BINHOST_DIR="$HOME/gentoo-pill"
|
||||||
|
|
||||||
HOST_DIR="$PILL_REPO/hosts/$HOSTNAME_TAG"
|
HOST_DIR="$PILL_REPO/hosts/$HOSTNAME_TAG"
|
||||||
echo "> Syncing configuration for: $HOSTNAME_TAG"
|
echo "Syncing configuration for: $HOSTNAME_TAG"
|
||||||
|
|
||||||
if [[ -d "$PILL_REPO/.git" ]]; then
|
if [[ -d "$PILL_REPO/.git" ]]; then
|
||||||
git -C "$PILL_REPO" pull --rebase --autostash
|
git -C "$PILL_REPO" pull --rebase --autostash
|
||||||
@@ -21,16 +21,16 @@ fi
|
|||||||
|
|
||||||
mkdir -p "$HOST_DIR"
|
mkdir -p "$HOST_DIR"
|
||||||
|
|
||||||
echo "> Syncing World file component..."
|
echo "Syncing World file component..."
|
||||||
cp /var/lib/portage/world "$HOST_DIR/world"
|
cp /var/lib/portage/world "$HOST_DIR/world"
|
||||||
|
|
||||||
CONFIGS=(package.use package.accept_keywords package.license package.mask package.unmask package.env repos.conf)
|
CONFIGS=(package.use package.accept_keywords package.license package.mask package.unmask package.env repos.conf)
|
||||||
|
|
||||||
echo "> Syncing Portage components..."
|
echo "Syncing Portage components..."
|
||||||
for type in "${CONFIGS[@]}"; do
|
for type in "${CONFIGS[@]}"; do
|
||||||
local_src="/etc/portage/$type"
|
local_src="/etc/portage/$type"
|
||||||
repo_dest="$HOST_DIR/$type"
|
repo_dest="$HOST_DIR/$type"
|
||||||
|
|
||||||
# rm -rf "$repo_dest"
|
# rm -rf "$repo_dest"
|
||||||
|
|
||||||
if [[ -e "$local_src" ]]; then
|
if [[ -e "$local_src" ]]; then
|
||||||
@@ -40,21 +40,21 @@ for type in "${CONFIGS[@]}"; do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "> Pushing..."
|
echo "Pushing..."
|
||||||
cd "$PILL_REPO"
|
cd "$PILL_REPO"
|
||||||
|
|
||||||
if [[ -n $(git status --porcelain) ]]; then
|
if [[ -n $(git status --porcelain) ]]; then
|
||||||
git add .
|
git add .
|
||||||
git commit -m "sync: $HOSTNAME_TAG $(date +'%Y-%m-%d %H:%M')"
|
git commit -m "sync: $HOSTNAME_TAG $(date +'%Y-%m-%d %H:%M')"
|
||||||
git push
|
git push
|
||||||
echo "> Changes pushed successfully."
|
echo "Changes pushed successfully."
|
||||||
|
|
||||||
# trigger the remote
|
# trigger the remote
|
||||||
if [[ -n "$SERVER_IP" ]]; then
|
if [[ -n "$SERVER_IP" ]]; then
|
||||||
echo "> Triggering binhost build @ [$SERVER_IP]..."
|
echo "Triggering binhost build @ [$SERVER_IP]..."
|
||||||
ssh "${SERVER_USER}@${SERVER_IP}" \
|
ssh -A "${SERVER_USER}@${SERVER_IP}" \
|
||||||
"cd ${SERVER_BINHOST_DIR} && ./binhost.sh"
|
"cd \"${SERVER_BINHOST_DIR}\" && ./binhost.sh"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "> No changes, binhost trig skipped"
|
echo "No changes, binhost trig skipped"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user