Skip to content

Commit

Permalink
templates/packer: look for RUN_BUILDER variable
Browse files Browse the repository at this point in the history
  • Loading branch information
croissanne committed Feb 12, 2024
1 parent f436512 commit c6dc11f
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 12 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
set -euo pipefail
source /tmp/cloud_init_vars

RUN_BUILDER=${RUN_BUILDER:-}
if [[ -z "$RUN_BUILDER" ]] || [ "$RUN_BUILDER" != true ]; then
echo "RUN_BUILDER not defined or not set to 'true', not starting builder."
exit 0
fi

echo "Starting osbuild-jobsite-builder."
/usr/libexec/osbuild-composer/osbuild-jobsite-builder
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,18 @@
set -euo pipefail
source /tmp/cloud_init_vars

echo "Starting worker service."
COMPOSER_HOST=${COMPOSER_HOST:-}
COMPOSER_PORT=${COMPOSER_PORT:-}
if [[ -z "$COMPOSER_HOST" ]]; then
echo "COMPOSER_HOST not defined, not starting the worker service."
exit 0
fi

if [[ -z "$COMPOSER_PORT" ]]; then
echo "COMPOSER_PORT not defined, not starting the worker service."
exit 0
fi

echo "Starting worker service."
# Prepare osbuild-composer's remote worker services and sockets.
systemctl enable --now "osbuild-remote-worker@${COMPOSER_HOST}:${COMPOSER_PORT}"
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ ExecStart=/usr/local/libexec/worker-initialization-scripts/get_koji_creds.sh
ExecStart=/usr/local/libexec/worker-initialization-scripts/get_oci_creds.sh
ExecStart=/usr/local/libexec/worker-initialization-scripts/get_pulp_creds.sh
ExecStart=/usr/local/libexec/worker-initialization-scripts/worker_service.sh
ExecStart=/usr/local/libexec/worker-initialization-scripts/worker_builder.sh

[Install]
WantedBy=multi-user.target

0 comments on commit c6dc11f

Please sign in to comment.