Skip to content
This repository was archived by the owner on May 31, 2025. It is now read-only.

Commit 7805771

Browse files
Replace uses of SCRIPT_DIR with ROOT_DIR
Using SCRIPT_DIR forces us to refer to any other source files relative to the current bash file. Setting ROOT_DIR to be the root of the git repo makes things simpler and less error prone.
1 parent b976394 commit 7805771

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

bash_fns/mkuser.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
source "$SCRIPT_DIR/bash_fns/detect_os.sh"
1+
source "$ROOT_DIR/bash_fns/detect_os.sh"
22

33
function mkuser() {
44
local UN="$1"

setup-bb-master.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22

33
set -e
4-
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
4+
ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && git rev-parse --show-toplevel)
55

66
cd
77
rm -rf bb-dir
@@ -12,4 +12,4 @@ source sandbox/bin/activate
1212
pip install 'buildbot[bundle]'==0.9.4
1313
pip install txrequests
1414
buildbot create-master master
15-
cp "$SCRIPT_DIR"/bb_master_config/* master/
15+
cp "$ROOT_DIR"/bb_master_config/* master/

setup-bb-worker.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22

33
set -e
4-
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
4+
ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && git rev-parse --show-toplevel)
55

66
if [[ -z $WORKER_BB_SECRETS_FILE ]]; then
77
echo "Need WORKER_BB_SECRETS_FILE=[ubuntu|freebsd]_bb_secrets.json defined!"

setup-worker-account.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/usr/bin/env bash
22

33
set -e
4-
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
4+
ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && git rev-parse --show-toplevel)
55

6-
source "$SCRIPT_DIR/bash_fns/mkuser.sh"
6+
source "$ROOT_DIR/bash_fns/mkuser.sh"
77

88
if [[ -z $WORKER_UNIX_SECRETS_FILE ]]; then
99
echo "Need WORKER_UNIX_SECRETS_FILE=[ubuntu|freebsd]_unix_secrets.json defined!"

ubuntu-master/setup-bb-master-account.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/usr/bin/env bash
22

3-
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
3+
ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && git rev-parse --show-toplevel)
44

5-
source "$SCRIPT_DIR/../bash_fns/detect_os.sh"
6-
source "$SCRIPT_DIR/../bash_fns/mkuser.sh"
5+
source "$ROOT_DIR/bash_fns/detect_os.sh"
6+
source "$ROOT_DIR/bash_fns/mkuser.sh"
77

88
UNIX_UN=`jq --raw-output '.["unix_un"]' ~/secrets/master_unix_secrets.json`
99
UNIX_PW=`jq --raw-output '.["unix_pw"]' ~/secrets/master_unix_secrets.json`

ubuntu-master/setup-nginx.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
3+
ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && git rev-parse --show-toplevel)
44

55
MASTER_HOST=`jq --raw-output '.["master_host"]' ~/secrets/public.json`
66
ADMIN_EMAIL=`jq --raw-output '.["admin_email"]' ~/secrets/public.json`
@@ -11,9 +11,9 @@ if [[ -z $MASTER_HOST || -z $ADMIN_EMAIL ]]; then
1111
fi
1212

1313
# Get our configuration files where we want them.
14-
cp "$SCRIPT_DIR/../nginx/master.nginx.conf" /etc/nginx/sites-available/master
15-
cp "$SCRIPT_DIR/../nginx/master-bootstrap.nginx.conf" /etc/nginx/sites-available/master-bootstrap
16-
cp "$SCRIPT_DIR/../nginx/ssl-params.nginx.conf" /etc/nginx/snippets/ssl-params.conf
14+
cp "$ROOT_DIR/nginx/master.nginx.conf" /etc/nginx/sites-available/master
15+
cp "$ROOT_DIR/nginx/master-bootstrap.nginx.conf" /etc/nginx/sites-available/master-bootstrap
16+
cp "$ROOT_DIR/nginx/ssl-params.nginx.conf" /etc/nginx/snippets/ssl-params.conf
1717

1818

1919
# Rewrite the configuration files to use whatever hostname we're configured for.

0 commit comments

Comments
 (0)