1
0
mirror of https://github.com/HariSekhon/DevOps-Bash-tools.git synced 2025-02-06 11:00:21 +00:00

updates srcdir/setup paths

This commit is contained in:
Hari Sekhon 2023-05-08 23:23:57 +01:00
parent 539bd784f1
commit 0fc0c010c3
32 changed files with 44 additions and 44 deletions

View File

@ -28,7 +28,7 @@ fi
export PATH="$PATH:/opt/appveyor/host-agent"
if ! type -P appveyor-host-agent &>/dev/null; then
"$srcdir/setup/install_appveyor_byoc.sh"
"$srcdir/../setup/install_appveyor_byoc.sh"
clear
fi

View File

@ -44,7 +44,7 @@ help_usage "$@"
#min_args 1 "$@"
if ! command -v eksctl &>/dev/null; then
"$srcdir/setup/install_eksctl.sh"
"$srcdir/../setup/install_eksctl.sh"
echo
fi

View File

@ -55,7 +55,7 @@ export COMPOSE_PROJECT_NAME="bash-tools"
export COMPOSE_FILE="$srcdir/../docker-compose/keycloak.yml"
if ! type docker-compose &>/dev/null; then
"$srcdir/setup/install_docker_compose.sh"
"$srcdir/../setup/install_docker_compose.sh"
fi
action="${1:-up}"

View File

@ -61,7 +61,7 @@ else
#gem install --user-install travis --no-rdoc --no-ri
#"$srcdir/ruby_gem_install_if_absent.sh" travis
# handles SSL linking issues on Mac
NONINTERACTIVE=1 "$srcdir/setup/install_travis.sh"
NONINTERACTIVE=1 "$srcdir/../setup/install_travis.sh"
for path in ~/.gem/ruby/*/bin; do
[ -d "$path" ] || continue
echo "adding $path to \$PATH"

View File

@ -74,7 +74,7 @@ pipeline="${PWD##*/}"
job="$pipeline/build"
if ! type docker-compose &>/dev/null; then
"$srcdir/setup/install_docker_compose.sh"
"$srcdir/../setup/install_docker_compose.sh"
fi
action="${1:-up}"

View File

@ -55,7 +55,7 @@ export COMPOSE_PROJECT_NAME="bash-tools"
export COMPOSE_FILE="$srcdir/../docker-compose/gocd.yml"
if ! type docker-compose &>/dev/null; then
"$srcdir/setup/install_docker_compose.sh"
"$srcdir/../setup/install_docker_compose.sh"
fi
action="${1:-up}"

View File

@ -28,7 +28,7 @@ setup/ci_git_set_dir_safe.sh
if [ -n "$*" ]; then
echo "$@"
else
sed 's/#.*//; s/:/ /' "$srcdir/setup/repos.txt"
sed 's/#.*//; s/:/ /' "$srcdir/../setup/repos.txt"
fi |
grep -v -e bash-tools -e '^[[:space:]]*$' |
while read -r repo dir; do

View File

@ -19,7 +19,7 @@ srcdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$srcdir"
sed 's/#.*//; s/:/ /' "$srcdir/setup/repos.txt" |
sed 's/#.*//; s/:/ /' "$srcdir/../setup/repos.txt" |
grep -vi -e bash-tools \
-e template \
-e jenkins \
@ -47,7 +47,7 @@ while read -r repo dir; do
echo "$filename"
done
else
sed 's/#.*//; /^[[:space:]]*$/d' "$srcdir/setup/ci.txt"
sed 's/#.*//; /^[[:space:]]*$/d' "$srcdir/../setup/ci.txt"
fi |
while read -r filename; do
target="../$dir/$filename"

View File

@ -22,7 +22,7 @@ cd "$srcdir"
if [ -n "$*" ]; then
echo "$@"
else
sed 's/#.*//; s/:/ /' "$srcdir/setup/repos.txt"
sed 's/#.*//; s/:/ /' "$srcdir/../setup/repos.txt"
fi |
grep -vi -e bash-tools \
-e playlist \
@ -36,7 +36,7 @@ while read -r repo dir; do
echo "WARNING: repo dir $dir not found, skipping..."
continue
fi
sed 's/#.*//; /^[[:space:]]*$/d' "$srcdir/setup/repo-configs.txt" |
sed 's/#.*//; /^[[:space:]]*$/d' "$srcdir/../setup/repo-configs.txt" |
while read -r filename; do
target="../$dir/$filename"
if [ -f "$target" ] || [ -n "${NEW:-}" ]; then

View File

@ -32,7 +32,7 @@ usage(){
}
if ! type -P circleci &>/dev/null; then
"$srcdir/setup/install_circleci.sh"
"$srcdir/../setup/install_circleci.sh"
fi
if [ $# -gt 1 ]; then

View File

@ -67,7 +67,7 @@ not_blank "$projects" || die "ERROR: no project specified and GCloud SDK core.pr
export PATH="$PATH:"~/bin
if ! type -P cloud_sql_proxy &>/dev/null; then
"$srcdir/setup/install_cloud_sql_proxy.sh"
"$srcdir/../setup/install_cloud_sql_proxy.sh"
fi
mkdir -p -v "$SOCKDIR"

View File

@ -41,5 +41,5 @@ if [ $# -gt 0 ]; then
run "$x"
done
else
run "$srcdir/setup/repos.txt"
run "$srcdir/../setup/repos.txt"
fi

View File

@ -71,7 +71,7 @@ if [ -z "${NO_TEST:-}" ]; then
opts="$opts test"
fi
repofile="$srcdir/setup/repos.txt"
repofile="$srcdir/../setup/repos.txt"
repolist="${REPOS:-}"
if [ -n "$repolist" ]; then

View File

@ -67,7 +67,7 @@ fi
if [ -n "${REPOS:-}" ]; then
tr '[:space:]' '\n' <<< "$REPOS"
elif [ -n "${srcdir:-}" ]; then
sed 's/#.*//; s/:/ /; /^[[:space:]]*$/d' < "$srcdir/setup/repos.txt"
sed 's/#.*//; s/:/ /; /^[[:space:]]*$/d' < "$srcdir/../setup/repos.txt"
else
echo "\$REPOS not set and \$srcdir not set/available, possibly due to 'curl ... | bash' usage, cannot determine list of repos to pull and build" >&2
exit 1

View File

@ -18,7 +18,7 @@ set -euo pipefail
[ -n "${DEBUG:-}" ] && set -x
srcdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
repofile="$srcdir/setup/repos.txt"
repofile="$srcdir/../setup/repos.txt"
if [ -f "$repofile" ]; then
echo "processing repos from local file: $repofile" >&2

View File

@ -34,7 +34,7 @@ mkdir -pv "$git_base_dir"
cd "$git_base_dir"
sed 's/#.*//; s/:/ /; /^[[:space:]]*$/d' "$srcdir/setup/repos.txt" |
sed 's/#.*//; s/:/ /; /^[[:space:]]*$/d' "$srcdir/../setup/repos.txt" |
while read -r repo dir; do
if [ -z "$dir" ]; then
dir="$repo"

View File

@ -27,7 +27,7 @@ mkdir -pv "$git_base_dir"
cd "$git_base_dir"
sed 's/#.*//; s/:/ /; /^[[:digit:]]*$/d' "$srcdir/setup/repos.txt" |
sed 's/#.*//; s/:/ /; /^[[:digit:]]*$/d' "$srcdir/../setup/repos.txt" |
while read -r repo dir; do
if [ -z "$dir" ]; then
dir="$repo"

View File

@ -38,4 +38,4 @@ help_usage "$@"
#min_args 1 "$@"
# this script is standalone without lib dependency so can be called directly from bootstrapped CI before submodules, since that is the exact problem that needs to be solved to allow CI/CD systems with incorrect ownership of the checkout directory to be able to checkout the necessary git submodules
"$srcdir/setup/ci_git_set_dir_safe.sh" "${1:-.}"
"$srcdir/../setup/ci_git_set_dir_safe.sh" "${1:-.}"

View File

@ -25,7 +25,7 @@ mkdir -pv "$git_base_dir"
cd "$git_base_dir"
repofile="$srcdir/setup/repos.txt"
repofile="$srcdir/../setup/repos.txt"
if [ $# -gt 0 ]; then
repolist="$*"

View File

@ -60,7 +60,7 @@ else
usage
fi
#sed 's/#.*//; s/:/ /; /^[[:space:]]*$/d' "$srcdir/setup/repos.txt" |
#sed 's/#.*//; s/:/ /; /^[[:space:]]*$/d' "$srcdir/../setup/repos.txt" |
echo "DevOps-Golang-tools go-tools" |
while read -r repo dir; do
if [ -z "$dir" ]; then

View File

@ -72,10 +72,10 @@ Jenkinsfile=Jenkinsfile
export COMPOSE_PROJECT_NAME="bash-tools"
export COMPOSE_FILE="$srcdir/../docker-compose/jenkins.yml"
plugins_txt="$srcdir/setup/jenkins-plugins.txt"
plugins_txt="$srcdir/../setup/jenkins-plugins.txt"
if ! type docker-compose &>/dev/null; then
"$srcdir/setup/install_docker_compose.sh"
"$srcdir/../setup/install_docker_compose.sh"
fi
action="${1:-up}"

View File

@ -46,8 +46,8 @@ help_usage "$@"
min_args 1 "$@"
type -P helm &>/dev/null || "$srcdir/setup/install_helm.sh"
type -P yq &>/dev/null || "$srcdir/setup/install_yq.sh"
type -P helm &>/dev/null || "$srcdir/../setup/install_helm.sh"
type -P yq &>/dev/null || "$srcdir/../setup/install_yq.sh"
# if there are no repositories to show will return exit code 1 so || :
helm_repos="$(helm repo list -o yaml | yq -r '.[] | [.name, .url] | @tsv' || :)"

View File

@ -53,7 +53,7 @@ help_usage "$@"
min_args 1 "$@"
type -P yq &>/dev/null || "$srcdir/setup/install_yq.sh"
type -P yq &>/dev/null || "$srcdir/../setup/install_yq.sh"
yq '.helmCharts[] | [.repo, .name, .version, .valuesFile] | @tsv' "$@" --no-doc --no-colors |
sed '/^[[:space:]]*$/d' |

View File

@ -36,10 +36,10 @@ help_usage "$@"
export COMPOSE_PROJECT_NAME="bash-tools"
export COMPOSE_FILE="$srcdir/../docker-compose/prometheus.yml"
export PROMETHEUS_URL="http://localhost:9090"
export PROMETHEUS_CONFIG="${2:-$srcdir/setup/prometheus.yml}"
export PROMETHEUS_CONFIG="${2:-$srcdir/../setup/prometheus.yml}"
if ! type docker-compose &>/dev/null; then
"$srcdir/setup/install_docker_compose.sh"
"$srcdir/../setup/install_docker_compose.sh"
fi
action="${1:-up}"

View File

@ -160,7 +160,7 @@ if ! docker_container_exists "$container_name"; then
-e MYSQL_ROOT_PASSWORD="$password" \
$docker_sql_mount_switches \
"$docker_image":"$version"
#-v "$srcdir/setup/mysql/conf.d/my.cnf:/etc/mysql/conf.d/" \
#-v "$srcdir/../setup/mysql/conf.d/my.cnf:/etc/mysql/conf.d/" \
fi
wait_for_mysql_ready "$container_name"

View File

@ -160,7 +160,7 @@ if ! docker_container_exists "$container_name"; then
-e MYSQL_ROOT_PASSWORD="$password" \
$docker_sql_mount_switches \
"$docker_image":"$version"
#-v "$srcdir/setup/mysql/conf.d/my.cnf:/etc/mysql/conf.d/" \
#-v "$srcdir/../setup/mysql/conf.d/my.cnf:/etc/mysql/conf.d/" \
fi

View File

@ -47,7 +47,7 @@ HOMEBREW_PACKAGES_TAP="${TAP:-}"
process_package_args "$@" |
if [ -n "${HOMEBREW_PACKAGES_TAP:-}" ]; then
while read -r tap package; do
grep -Eq "^${tap}[[:space:]]+$package$" <(sed 's/#.*//; /^[[:digit:]]*$/d' "$srcdir/setup/"brew-packages*taps.txt) &&
grep -Eq "^${tap}[[:space:]]+$package$" <(sed 's/#.*//; /^[[:digit:]]*$/d' "$srcdir/../setup/"brew-packages*taps.txt) &&
echo "$tap $package"
done
else
@ -55,6 +55,6 @@ else
# shellcheck disable=SC2046
tr ' ' '\n' |
# Mac's grep is buggy, doesn't matches utimer unless sort -r to try it before '^r$' - but then gives false positives on other packages
#grep -Fx -f <(sed 's/#.*//; s/^[[:space:]]*//; s/[[:space:]]*$//; /^[[:space:]]*$/d' "$srcdir/setup/"brew-packages*.txt | sort -ur)
command ggrep -Fx -f <(sed 's/#.*//; s/^[[:space:]]*//; s/[[:space:]]*$//; /^[[:space:]]*$/d' "$srcdir/setup/"brew-packages*.txt)
#grep -Fx -f <(sed 's/#.*//; s/^[[:space:]]*//; s/[[:space:]]*$//; /^[[:space:]]*$/d' "$srcdir/../setup/"brew-packages*.txt | sort -ur)
command ggrep -Fx -f <(sed 's/#.*//; s/^[[:space:]]*//; s/[[:space:]]*$//; /^[[:space:]]*$/d' "$srcdir/../setup/"brew-packages*.txt)
fi

View File

@ -47,7 +47,7 @@ HOMEBREW_PACKAGES_TAP="${TAP:-}"
process_package_args "$@" |
if [ -n "${HOMEBREW_PACKAGES_TAP:-}" ]; then
while read -r tap package; do
grep -Eq "^#?${tap}[[:space:]]+$package$" <(sed 's/#.*//; /^[[:digit:]]*$/d' "$srcdir/setup/"brew-packages*taps.txt) ||
grep -Eq "^#?${tap}[[:space:]]+$package$" <(sed 's/#.*//; /^[[:digit:]]*$/d' "$srcdir/../setup/"brew-packages*taps.txt) ||
echo "$tap $package"
done
else
@ -55,10 +55,10 @@ else
# shellcheck disable=SC2046
tr ' ' '\n' |
# Mac's grep is buggy, doesn't matches utimer unless sort -r to try it before '^r$' - but then gives false positives on other packages
#grep -vFx -f <(sed 's/#.*//; s/^[[:space:]]*//; s/[[:space:]]*$//; /^[[:space:]]*$/d' "$srcdir/setup/"brew-packages*.txt | sort)
command ggrep -vFx -f <(sed 's/#.*//; s/^[[:space:]]*//; s/[[:space:]]*$//; /^[[:space:]]*$/d' "$srcdir/setup/"brew-packages*.txt) |
#grep -vFx -f <(sed 's/#.*//; s/^[[:space:]]*//; s/[[:space:]]*$//; /^[[:space:]]*$/d' "$srcdir/../setup/"brew-packages*.txt | sort)
command ggrep -vFx -f <(sed 's/#.*//; s/^[[:space:]]*//; s/[[:space:]]*$//; /^[[:space:]]*$/d' "$srcdir/../setup/"brew-packages*.txt) |
while read -r package; do
grep -Eqi "^#${package}([[:space:]]|$)" "$srcdir/setup/"brew-packages*.txt || echo "$package"
grep -Eqi "^#${package}([[:space:]]|$)" "$srcdir/../setup/"brew-packages*.txt || echo "$package"
done |
sort -u
fi

View File

@ -156,13 +156,13 @@ if ! docker_container_exists "$container_name"; then
--name "$container_name" \
$docker_opts \
-e POSTGRES_PASSWORD="$password" \
-v "$srcdir/setup/postgresql.conf:/etc/postgresql/postgresql.conf" \
-v "$srcdir/../setup/postgresql.conf:/etc/postgresql/postgresql.conf" \
$docker_sql_mount_switches \
"$docker_image":"$version" \
$(if [ "${version:0:1}" = 8 ] || [ "${version:0:3}" = '9.0' ]; then echo postgres; fi) \
-c 'config_file=/etc/postgresql/postgresql.conf'
# can't mount postgresql.conf here because it prevents /var/lib/postgresql/data from being initialized
#-v "$srcdir/setup/postgresql.conf:/var/lib/postgresql/data/postgresql.conf"
#-v "$srcdir/../setup/postgresql.conf:/var/lib/postgresql/data/postgresql.conf"
fi
wait_for_postgres_ready "$container_name"

View File

@ -19,7 +19,7 @@ set -euo pipefail
[ -n "${DEBUG:-}" ] && set -x
srcdir="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
conf_files="$(sed 's/#.*//; /^[[:space:]]*$/d' "$srcdir/setup/files.txt")"
conf_files="$(sed 's/#.*//; /^[[:space:]]*$/d' "$srcdir/../setup/files.txt")"
setup_file(){
local filename="$1"
@ -68,7 +68,7 @@ for filename in $conf_files; do
ln -sv $opts -- "$PWD/$filename" ~ || continue
# if we link .vimrc then run the vundle install and get plugins to prevent vim errors every startup
if [ "$filename" = .vimrc ]; then
"$srcdir/setup/install_vundle.sh" || :
"$srcdir/../setup/install_vundle.sh" || :
fi
fi
done

View File

@ -19,7 +19,7 @@ set -euo pipefail
[ -n "${DEBUG:-}" ] && set -x
srcdir="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
conf_files="$(sed 's/#.*//; /^[[:space:]]*$/d' "$srcdir/setup/files.txt")"
conf_files="$(sed 's/#.*//; /^[[:space:]]*$/d' "$srcdir/../setup/files.txt")"
# unreliable that HOME is set, ensure shell evaluates to the right thing before we use it
[ -n "${HOME:-}" ] || HOME=~

View File

@ -114,7 +114,7 @@ project="GitHub"
export TEAMCITY_URL="http://${DOCKER_HOST:-localhost}:8111"
if ! type docker-compose &>/dev/null; then
"$srcdir/setup/install_docker_compose.sh"
"$srcdir/../setup/install_docker_compose.sh"
fi
action="${1:-up}"