This repository has been archived by the owner on Aug 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cf38270
commit f018f27
Showing
3 changed files
with
2 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,6 @@ | ||
#!/bin/bash | ||
# This hook installs the centos dependencies needed to run the charm, | ||
# creates the dispatch executable, regenerates the symlinks for start and | ||
# upgrade-charm, and kicks off the operator framework. | ||
# This hook creates the dispatch executable and kicks off the operator framework. | ||
|
||
set -e | ||
|
||
# Source the os-release information into the env. | ||
. /etc/os-release | ||
|
||
if ! [[ -f '.installed' ]] | ||
then | ||
# Determine if we are running in centos or ubuntu, if centos | ||
# provision the needed prereqs. | ||
if [[ $ID == 'ubuntu' ]] | ||
then | ||
echo "Running Ubuntu." | ||
echo "Nothing to do." | ||
elif [[ $ID == 'centos' ]] | ||
then | ||
# Determine the centos version and install prereqs accordingly | ||
major=$(cat /etc/centos-release | tr -dc '0-9.'|cut -d \. -f1) | ||
echo "Running CentOS$major, installing prereqs." | ||
if [[ $major == "7" ]] | ||
then | ||
yum -y install epel-release | ||
yum -y install yum-priorities python3 | ||
elif [[ $major == "8" ]] | ||
then | ||
dnf -y install epel-release | ||
dnf -y install yum-priorities python3 | ||
else | ||
echo "Running unsuppored version of centos: $major" | ||
exit -1 | ||
fi | ||
else | ||
echo "Running unsuppored os: $ID" | ||
exit -1 | ||
fi | ||
touch .installed | ||
fi | ||
|
||
JUJU_DISPATCH_PATH="${JUJU_DISPATCH_PATH:-$0}" PYTHONPATH=lib:venv ./src/charm.py |