Skip to content

Commit 2e250c6

Browse files
author
MickMake
committed
Milestone push
1 parent 9e61ccb commit 2e250c6

File tree

7 files changed

+58
-57
lines changed

7 files changed

+58
-57
lines changed

GearBoxOS/etc/exports

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# Consider using https://bindfs.org/ for managing /projects.
1+
# Consider using https://bindfs.org/ for managing projects.
22

33

GearBoxOS/etc/profile.d/box-profile.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ HISTCONTROL=erasedups:ignoreboth
2222
shopt -s histappend
2323

2424
# 0.17.0 - Defines the base project path.
25-
BOX_PROJECTS_ROOT="/projects"
25+
BOX_PROJECTS_ROOT="/home/gearbox/projects"
2626
export BOX_PROJECTS_ROOT
2727

2828
# 0.17.0 - Defines the default project to start.
29-
DEFAULT_PROJECT="gearbox"
29+
DEFAULT_PROJECT="default"
3030
export DEFAULT_PROJECT
3131

32-
# Change inital SSH directory to be /project/gearbox
32+
# Change inital SSH directory to be /home/gearbox/projects/default
3333
cd ${BOX_PROJECTS_ROOT}/${DEFAULT_PROJECT}
3434

TODO.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
# node-docker
44
D Capture error log output and put somewhere that a user can see.
5-
D For every new /usr/local/bin/package symlink created we add to /projects/gearbox/.project/bin
5+
D For every new /usr/local/bin/package symlink created we add to /home/gearbox/projects/default/.project/bin
66
D `npm link package` for any package installed using `-g`.
77
D Use `gearbox` instead of root.
8-
D -v /projects:/projects.
8+
D -v $HOME/projects:/projects.
99

1010
# container.functions
1111
D Support WORKDIR to be $PWD - modify container.functions.

cli/commands/sync

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ declare="${RESET:=}"
1010

1111
source "${BOX_FUNCTIONS_FILE}"
1212

13-
if [ ! -f /projects/gearbox/box/SYNCED ] ; then
14-
mkdir /projects/gearbox/box
15-
rsync --archive --hard-links --perms --one-file-system /opt/gearbox/ /projects/gearbox/box
16-
sudo touch /projects/gearbox/box/SYNCED
13+
if [ ! -f /home/gearbox/projects/default/SYNCED ] ; then
14+
mkdir /home/gearbox/projects/default
15+
rsync --archive --hard-links --perms --one-file-system /opt/gearbox/ /home/gearbox/projects/default
16+
sudo touch /home/gearbox/projects/default/SYNCED
1717
fi
1818
trap "exit 0" SIGINT SIGTERM
1919

@@ -40,8 +40,8 @@ sync_run_once() {
4040
endMessage="Done."
4141
fi
4242
printf "${startMessage}"
43-
rsync --dry-run --archive --hard-links --perms --recursive --links --safe-links --keep-dirlinks --times --delete-after /projects/gearbox/box/ /opt/gearbox
44-
rsync --archive --hard-links --perms --recursive --links --safe-links --keep-dirlinks --times --delete-after /projects/gearbox/box/ /opt/gearbox
43+
rsync --dry-run --archive --hard-links --perms --recursive --links --safe-links --keep-dirlinks --times --delete-after /home/gearbox/projects/default/ /opt/gearbox
44+
rsync --archive --hard-links --perms --recursive --links --safe-links --keep-dirlinks --times --delete-after /home/gearbox/projects/default/ /opt/gearbox
4545
if ! [ -z "${endMessage}" ] ; then
4646
echo -e "${endMessage}"
4747
fi

cli/includes/functions

+42-41
Original file line numberDiff line numberDiff line change
@@ -6,65 +6,66 @@ export BOX_NAME="gearbox"
66
export BOX_ARGS_ALL="$*"
77

88
# Defines the root directory of all projects.
9-
declare="${BOX_PROJECTS_ROOT:=/projects}"
9+
declare="${BOX_PROJECTS_ROOT:=/home/${USER}/projects}"
1010

1111
# Defines the current project in use for a single project box.
12-
declare="${BOX_CURRENT_PROJECT:=gearbox}"
12+
declare="${BOX_CURRENT_PROJECT:=default}"
1313

1414
export BOX_CURRENT_PROJECT_DIR="${BOX_PROJECTS_ROOT}/${BOX_CURRENT_PROJECT}"
15-
export BOX_PROJECT_DIR="${BOX_PROJECTS_ROOT}/${BOX_CURRENT_PROJECT}"
16-
17-
18-
export BOX_USER="gearbox"
19-
export BOX_USER_UID="1000"
20-
export BOX_USER_GID="1000"
21-
export BOX_USER_HOME="/home/gearbox"
22-
export BOX_USER_FILE="${BOX_USER_HOME}/user.json"
23-
24-
export BOX_BASE_DIR="/opt/gearbox"
25-
export BOX_DYN_DIR="/var/lib/gearbox"
26-
export BOX_CONFIG_FILE="${BOX_BASE_DIR}/box.json"
27-
28-
export BOX_VERSION="$(cat ${BOX_BASE_DIR}/version)"
29-
export BOX_ETC_DIR="${BOX_BASE_DIR}/etc"
30-
export BOX_RELEASES_DIR="${BOX_ETC_DIR}/releases"
31-
export BOX_RELEASE_DIR="${BOX_RELEASES_DIR}/${BOX_VERSION}"
32-
export BOX_RELEASE_JSON="${BOX_RELEASE_DIR}/project.json"
33-
export BOX_CLI_DIR="${BOX_BASE_DIR}/cli"
34-
export BOX_CLI_CMD="${BOX_BASE_DIR}/bin/box"
35-
export BOX_WEB_ROOT_DIR="${BOX_CURRENT_PROJECT_DIR}/www"
36-
export BOX_WATCHERS_DIR="${BOX_WEB_ROOT_DIR}/watchers"
37-
export BOX_PHPCLI=${BOX_BASE_DIR}/bin/php
38-
export BOX_CACHE_DIR="/tmp/box-cache"
15+
export PROJECT_ROOT="${BOX_PROJECTS_ROOT}/${BOX_CURRENT_PROJECT}"
16+
export BOX_PROJECT_DIR="${BOX_PROJECTS_ROOT}/${BOX_CURRENT_PROJECT}"
17+
18+
19+
export BOX_USER="gearbox"
20+
export BOX_USER_UID="1000"
21+
export BOX_USER_GID="1000"
22+
export BOX_USER_HOME="/home/gearbox"
23+
export BOX_USER_FILE="${BOX_USER_HOME}/user.json"
24+
25+
export BOX_BASE_DIR="/opt/gearbox"
26+
export BOX_DYN_DIR="/var/lib/gearbox"
27+
export BOX_CONFIG_FILE="${BOX_BASE_DIR}/box.json"
28+
29+
export BOX_VERSION="$(cat ${BOX_BASE_DIR}/version)"
30+
export BOX_ETC_DIR="${BOX_BASE_DIR}/etc"
31+
export BOX_RELEASES_DIR="${BOX_ETC_DIR}/releases"
32+
export BOX_RELEASE_DIR="${BOX_RELEASES_DIR}/${BOX_VERSION}"
33+
export BOX_RELEASE_JSON="${BOX_RELEASE_DIR}/project.json"
34+
export BOX_CLI_DIR="${BOX_BASE_DIR}/cli"
35+
export BOX_CLI_CMD="${BOX_BASE_DIR}/bin/box"
36+
export BOX_WEB_ROOT_DIR="${BOX_CURRENT_PROJECT_DIR}/www"
37+
export BOX_WATCHERS_DIR="${BOX_WEB_ROOT_DIR}/watchers"
38+
export BOX_PHPCLI=${BOX_BASE_DIR}/bin/php
39+
export BOX_CACHE_DIR="/tmp/box-cache"
3940
mkdir -p "${BOX_CACHE_DIR}"
4041
sudo chown --silent --preserve-root --recursive "${BOX_USER}:${BOX_USER}" "${BOX_CACHE_DIR}"
4142

42-
export BOX_GIT_DIR="${BOX_BASE_DIR}/.git"
43-
export BOX_LOGS_DIR="${BOX_PROJECT_DIR}/logs"
44-
export BOX_SQL_DIR="${BOX_PROJECT_DIR}/sql"
43+
export BOX_GIT_DIR="${BOX_BASE_DIR}/.git"
44+
export BOX_LOGS_DIR="${BOX_PROJECT_DIR}/logs"
45+
export BOX_SQL_DIR="${BOX_PROJECT_DIR}/sql"
4546
export BOX_SQL_PROVISION_LOCK="${BOX_PROJECT_DIR}.provisioned"
46-
export BOX_COMPOSER_FILE="${BOX_PROJECT_DIR}/composer.json"
47-
export BOX_PROJECT_FILE="${BOX_PROJECT_DIR}/project.json"
47+
export BOX_COMPOSER_FILE="${BOX_PROJECT_DIR}/composer.json"
48+
export BOX_PROJECT_FILE="${BOX_PROJECT_DIR}/project.json"
4849

4950

50-
export BOX_COMMANDS_DIR="${BOX_CLI_DIR}/commands"
51-
export BOX_INCLUDES_DIR="${BOX_CLI_DIR}/includes"
51+
export BOX_COMMANDS_DIR="${BOX_CLI_DIR}/commands"
52+
export BOX_INCLUDES_DIR="${BOX_CLI_DIR}/includes"
5253

53-
export BOX_COLORS_FILE="${BOX_INCLUDES_DIR}/colors"
54-
export BOX_FUNCTIONS_FILE="${BOX_INCLUDES_DIR}/functions"
54+
export BOX_COLORS_FILE="${BOX_INCLUDES_DIR}/colors"
55+
export BOX_FUNCTIONS_FILE="${BOX_INCLUDES_DIR}/functions"
5556

56-
export BOX_FILES_DIR="${BOX_CLI_DIR}/files"
57+
export BOX_FILES_DIR="${BOX_CLI_DIR}/files"
5758

58-
export BOX_TESTS_DIR="${BOX_CLI_DIR}/tests"
59+
export BOX_TESTS_DIR="${BOX_CLI_DIR}/tests"
5960

60-
export BOX_SCRIPTS_REPO="https://github.com/gearboxworks/box-scripts/"
61+
export BOX_SCRIPTS_REPO="https://github.com/gearboxworks/box-scripts/"
6162

62-
export BOX_DEPLOY_LOCK_SLUG="deploy-lock"
63+
export BOX_DEPLOY_LOCK_SLUG="deploy-lock"
6364

64-
export BOX_TMP_DIR="/tmp/box-tmp"
65+
export BOX_TMP_DIR="/tmp/box-tmp"
6566
mkdir -p "${BOX_TMP_DIR}"
6667
sudo chown --silent --preserve-root --recursive "${BOX_USER}:${BOX_USER}" "${BOX_TMP_DIR}"
67-
export DEPLOY_LOG="${BOX_TMP_DIR}/deploy.log"
68+
export DEPLOY_LOG="${BOX_TMP_DIR}/deploy.log"
6869

6970
source ${BOX_INCLUDES_DIR}/colors
7071

cli/includes/general.functions

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ declare="${BOX_ERROR_FILE:=}"
1818

1919
#
2020
# Checks if the Virtualbox gearbox mount point is there.
21-
# Return: [ /projects/gearbox | /var/www | "" ]
21+
# Return: [ /home/gearbox/projects | /var/www | "" ]
2222
#
2323
function check_mount()
2424
{
25-
MOUNT_DIR="$(mount -v | awk '$3~/^(\/projects\/gearbox|\/var\/www)$/{print$3}')"
25+
MOUNT_DIR="$(mount -v | awk '$3~/^(\/home\/gearbox\/projects\/default|\/var\/www)$/{print$3}')"
2626
echo ${MOUNT_DIR}
2727
}
2828

cli/tests/includes/framework

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ export _TESTS_FUNCS=""
5252
function tests_IncrPassed() {
5353
(( _TESTS_PASSED++ ))
5454
(( _TESTS_TOTAL++ ))
55-
echo "P: ${_TESTS_PASSED}, F: ${_TESTS_FAILED}, T: ${_TESTS_TOTAL}, F(): ${_TESTS_FUNCS}" >> /projects/gearbox/test.log
55+
echo "P: ${_TESTS_PASSED}, F: ${_TESTS_FAILED}, T: ${_TESTS_TOTAL}, F(): ${_TESTS_FUNCS}" >> /home/gearbox/projects/default/test.log
5656
}
5757
function tests_IncrFailed() {
5858
(( _TESTS_FAILED++ ))
5959
(( _TESTS_TOTAL++ ))
60-
echo "P: ${_TESTS_PASSED}, F: ${_TESTS_FAILED}, T: ${_TESTS_TOTAL}, F(): ${_TESTS_FUNCS}" >> /projects/gearbox/test.log
60+
echo "P: ${_TESTS_PASSED}, F: ${_TESTS_FAILED}, T: ${_TESTS_TOTAL}, F(): ${_TESTS_FUNCS}" >> /home/gearbox/projects/default/test.log
6161
}
6262

6363
#

0 commit comments

Comments
 (0)