mirror of
https://github.com/clearlinux/koji-setup-scripts.git
synced 2026-04-28 11:03:50 +00:00
Conditionally run swupd during setup
swupd should only be run during setup when on an officially released version of Clear that has an upadate stream. Development versions are usually indicated when the VERSION_ID is equal to 1 and do not have an update stream. In these cases, the assumption is that all required software is already installed prior to setup. However, add checks for only the most critical dependencies before continuing with the setup so that it more obvious to the user that these are missing when they are. Signed-off-by: George T Kramer <george.t.kramer@intel.com>
This commit is contained in:
@@ -7,7 +7,9 @@ SCRIPT_DIR="$(dirname "$(realpath "$0")")"
|
||||
source "$SCRIPT_DIR"/globals.sh
|
||||
source "$SCRIPT_DIR"/parameters.sh
|
||||
|
||||
swupd bundle-add scm-server httpd
|
||||
swupd bundle-add scm-server || :
|
||||
check_dependency gitolite
|
||||
check_dependency git
|
||||
|
||||
## GITOLITE SETUP
|
||||
mkdir -p "$GIT_DIR"
|
||||
@@ -29,6 +31,9 @@ sudo -u "$GIT_USER" gitolite setup -pk "$GITOLITE_PUB_KEY_FILE"
|
||||
usermod -s /bin/bash gitolite
|
||||
|
||||
if $IS_ANONYMOUS_GIT_NEEDED; then
|
||||
swupd bundle-add httpd || :
|
||||
check_dependency httpd
|
||||
|
||||
## GIT PROTOCOL CLONING
|
||||
mkdir -p /etc/systemd/system
|
||||
cat > /etc/systemd/system/git-daemon.service <<- EOF
|
||||
|
||||
@@ -7,8 +7,8 @@ SCRIPT_DIR="$(dirname "$(realpath "$0")")"
|
||||
source "$SCRIPT_DIR"/globals.sh
|
||||
source "$SCRIPT_DIR"/parameters.sh
|
||||
|
||||
# Install kojid
|
||||
swupd bundle-add koji
|
||||
swupd bundle-add koji || :
|
||||
check_dependency kojid
|
||||
|
||||
# Create mock folders and permissions
|
||||
mkdir -p /etc/mock/koji
|
||||
|
||||
@@ -7,7 +7,9 @@ SCRIPT_DIR="$(dirname "$(realpath "$0")")"
|
||||
source "$SCRIPT_DIR"/globals.sh
|
||||
source "$SCRIPT_DIR"/parameters.sh
|
||||
|
||||
swupd bundle-add nfs-utils
|
||||
swupd bundle-add nfs-utils || :
|
||||
check_dependency rpcbind
|
||||
check_dependency rpc.nfsd
|
||||
|
||||
# Export server directory to be mounted by clients
|
||||
echo "$KOJI_DIR $KOJI_SLAVE_FQDN(ro,no_root_squash)" >> /etc/exports
|
||||
|
||||
@@ -7,8 +7,11 @@ SCRIPT_DIR="$(dirname "$(realpath "$0")")"
|
||||
source "$SCRIPT_DIR"/globals.sh
|
||||
source "$SCRIPT_DIR"/parameters.sh
|
||||
|
||||
# INSTALL KOJI
|
||||
swupd bundle-add koji
|
||||
swupd bundle-add koji || :
|
||||
check_dependency koji
|
||||
check_dependency httpd
|
||||
check_dependency kojira
|
||||
check_dependency postgres
|
||||
|
||||
## SETTING UP SSL CERTIFICATES FOR AUTHENTICATION
|
||||
mkdir -p "$KOJI_PKI_DIR"/{certs,private}
|
||||
|
||||
@@ -7,7 +7,9 @@ SCRIPT_DIR="$(dirname "$(realpath "$0")")"
|
||||
source "$SCRIPT_DIR"/globals.sh
|
||||
source "$SCRIPT_DIR"/parameters.sh
|
||||
|
||||
swupd bundle-add koji
|
||||
swupd bundle-add package-utils || :
|
||||
check_dependency dnf
|
||||
check_dependency createrepo_c
|
||||
|
||||
mkdir -p "$MASH_DIR"
|
||||
chown -R kojiadmin:kojiadmin "$MASH_DIR"
|
||||
|
||||
@@ -13,4 +13,16 @@ export HTTPD_USER=httpd
|
||||
export HTTPD_DOCUMENT_ROOT=/var/www/html
|
||||
|
||||
export KOJI_PKI_DIR=/etc/pki/koji
|
||||
|
||||
check_dependency() {
|
||||
if [[ "$#" -ne 1 ]]; then
|
||||
echo "Incorrect number of arguments!" >&2
|
||||
exit 1
|
||||
fi
|
||||
if ! type "$1"; then
|
||||
echo "$1 not found!" >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
#### END DO NOT EDIT ####
|
||||
|
||||
Reference in New Issue
Block a user