From e739c1424df8ab6e5ad76c76839f11dba9d80d0b Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sat, 6 Feb 2021 22:39:43 -0800 Subject: [PATCH 01/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20test=20before=20co?= =?UTF-8?q?mmand?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitpod.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitpod.yml b/.gitpod.yml index 0e9d9fbc..aa8d7712 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -12,7 +12,9 @@ ports: onOpen: ignore tasks: - - init: | + - before: | + touch text.txt + init: | . bash/third-party/spinner.sh && start_spinner "Initializing MySql..." && gp await-port 3306 && From 880c42eb908da5d8489655f136486f7028eba042 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sat, 6 Feb 2021 22:42:16 -0800 Subject: [PATCH 02/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20test=20before=20co?= =?UTF-8?q?mmand?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitpod.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index aa8d7712..89797812 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -12,8 +12,7 @@ ports: onOpen: ignore tasks: - - before: | - touch text.txt + - before: touch ~/text.txt init: | . bash/third-party/spinner.sh && start_spinner "Initializing MySql..." && From 69acc888bfeee35b0cf1cc9093691e901b9546f4 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sat, 6 Feb 2021 23:36:43 -0800 Subject: [PATCH 03/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20approach=20to=20fi?= =?UTF-8?q?xing=20https://github.com/apolopena/gitpod-laravel8-starter/iss?= =?UTF-8?q?ues/30?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitpod.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitpod.yml b/.gitpod.yml index 89797812..4b90b2f1 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -12,7 +12,7 @@ ports: onOpen: ignore tasks: - - before: touch ~/text.txt + - before: bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/emoji-log ~/.gitconfig && bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/git-aliases ~/.gitconfig && init: | . bash/third-party/spinner.sh && start_spinner "Initializing MySql..." && From 8b62a5e17c53f7018c5b816c2a7be76430367e5b Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sat, 6 Feb 2021 23:38:53 -0800 Subject: [PATCH 04/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20fix=2030?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/init-gitpod.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bash/init-gitpod.sh b/bash/init-gitpod.sh index 95dca0d5..f05037c4 100644 --- a/bash/init-gitpod.sh +++ b/bash/init-gitpod.sh @@ -76,8 +76,8 @@ bash bash/init-rake-tasks.sh # Aliases for git msg="Writing git aliases" log_silent "$msg" && start_spinner "$msg" && -bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/emoji-log ~/.gitconfig && -bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/git-aliases ~/.gitconfig && +#bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/emoji-log ~/.gitconfig && +#bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/git-aliases ~/.gitconfig && stop_spinner $? log "try: git a or: git aliases for a list your git aliases.\n" From a54dce45fa0a9f27afa15f7578842d164c4996da Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sat, 6 Feb 2021 23:43:50 -0800 Subject: [PATCH 05/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20fix=2030?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitpod.yml | 2 +- bash/init-gitpod.sh | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index 4b90b2f1..0dda5b44 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -12,7 +12,7 @@ ports: onOpen: ignore tasks: - - before: bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/emoji-log ~/.gitconfig && bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/git-aliases ~/.gitconfig && + - before: bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/emoji-log ~/.gitconfig && bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/git-aliases ~/.gitconfig init: | . bash/third-party/spinner.sh && start_spinner "Initializing MySql..." && diff --git a/bash/init-gitpod.sh b/bash/init-gitpod.sh index f05037c4..62337dc8 100644 --- a/bash/init-gitpod.sh +++ b/bash/init-gitpod.sh @@ -74,12 +74,12 @@ fi bash bash/init-rake-tasks.sh # Aliases for git -msg="Writing git aliases" -log_silent "$msg" && start_spinner "$msg" && +#msg="Writing git aliases" +#log_silent "$msg" && start_spinner "$msg" && #bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/emoji-log ~/.gitconfig && #bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/git-aliases ~/.gitconfig && -stop_spinner $? -log "try: git a or: git aliases for a list your git aliases.\n" +#stop_spinner $? +#log "try: git a or: git aliases for a list your git aliases.\n" # Messages for github_changelog_generator [ "$installed_changelog_gen" == 1 ] && From 73bafa3cd924821a9e84a06ccdff566e8fa72afb Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sat, 6 Feb 2021 23:54:20 -0800 Subject: [PATCH 06/71] =?UTF-8?q?=F0=9F=90=9B=20FIX:=20persistent=20rake?= =?UTF-8?q?=20tasks=20#30?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitpod.yml | 5 ++++- bash/init-gitpod.sh | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index 0dda5b44..66003a51 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -12,7 +12,10 @@ ports: onOpen: ignore tasks: - - before: bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/emoji-log ~/.gitconfig && bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/git-aliases ~/.gitconfig + - before: | + bash bash/init-rake-tasks.sh && + bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/emoji-log ~/.gitconfig && + bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/git-aliases ~/.gitconfig init: | . bash/third-party/spinner.sh && start_spinner "Initializing MySql..." && diff --git a/bash/init-gitpod.sh b/bash/init-gitpod.sh index 62337dc8..923ece1b 100644 --- a/bash/init-gitpod.sh +++ b/bash/init-gitpod.sh @@ -71,7 +71,7 @@ fi # Rake tasks (will be written to ~/.rake). # Some rake tasks are dynamic and depend on the configuration in starter.ini -bash bash/init-rake-tasks.sh +# bash bash/init-rake-tasks.sh # Aliases for git #msg="Writing git aliases" From 06a8bcc526de45a53eff7fbba2c77f7bb3ea04bf Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sat, 6 Feb 2021 23:57:41 -0800 Subject: [PATCH 07/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20finiky?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitpod.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index 66003a51..6b1e7ee5 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -12,10 +12,7 @@ ports: onOpen: ignore tasks: - - before: | - bash bash/init-rake-tasks.sh && - bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/emoji-log ~/.gitconfig && - bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/git-aliases ~/.gitconfig + - before: bash bash/init-rake-tasks.sh && bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/emoji-log ~/.gitconfig && bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/git-aliases ~/.gitconfig init: | . bash/third-party/spinner.sh && start_spinner "Initializing MySql..." && From 1329e294072b1206f44f007745d32750ef92fabc Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 10:41:23 -0800 Subject: [PATCH 08/71] Format: added a linebreak --- bash/init-rake-tasks.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bash/init-rake-tasks.sh b/bash/init-rake-tasks.sh index f102280e..964ba6f6 100644 --- a/bash/init-rake-tasks.sh +++ b/bash/init-rake-tasks.sh @@ -1,6 +1,7 @@ #!/bin/bash parse="bash bash/utils.sh parse_ini_value starter.ini" + # BEGIN: dynamic rake task functions add_changelog_rake() { local rake='changelog' @@ -32,6 +33,7 @@ EOF # BEGIN: conditionally add dynamic rake tasks if [ "$(eval $parse github-changelog-generator install)" ]; then add_changelog_rake + [ $? != 0 ] && exit 1 fi # END: conditionally add dynamic rake tasks From 2c72f059b63b7e554d153c59d62f30c1a05858b6 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 10:44:29 -0800 Subject: [PATCH 09/71] =?UTF-8?q?=F0=9F=90=9B=20FIX:=20dialing=20in=20http?= =?UTF-8?q?s://github.com/apolopena/gitpod-laravel8-starter/issues/30?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/before-tasks.sh | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 bash/before-tasks.sh diff --git a/bash/before-tasks.sh b/bash/before-tasks.sh new file mode 100644 index 00000000..3da481dd --- /dev/null +++ b/bash/before-tasks.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +# Gitpod currently does not persist files in the home directory so we must write them +# in everytime the workspace starts. We do this in the -before task in .gitpod.yml + +# Log to the console and a file +log () { + if [ -z "$2" ]; then + bash bash/utils.sh log "$1" /var/log/workspace-init.log + else + bash bash/utils.sh log "$1" /var/log/workspace-init.log -e + fi +} + +# Log only to a file +log_silent () { + if [ -z "$2" ]; then + bash bash/utils.sh log_silent "$1" /var/log/workspace-init.log + else + bash bash/utils.sh log_silent "$1" /var/log/workspace-init.log -e + fi +} + +# Rake tasks (will be written to ~/.rake). +# Some rake tasks are dynamic and depend on the configuration in starter.ini +msg="Writing rake tasks" +log_silent "$msg" && start_spinner "$msg" && +bash bash/init-rake-tasks.sh +&& stop_spinner $? + +# Aliases for git +msg="Writing git aliases" +log_silent "$msg" && start_spinner "$msg" && +bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/emoji-log ~/.gitconfig && +bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/git-aliases ~/.gitconfig && +stop_spinner $? +log "try: git a or: git aliases for a list your git aliases.\n" \ No newline at end of file From 3bc52db3c73027cfe01ea2c1070e48248f2e2d5d Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 10:50:50 -0800 Subject: [PATCH 10/71] =?UTF-8?q?=F0=9F=90=9B=20FIX:=20before-tasks.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitpod.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitpod.yml b/.gitpod.yml index 6b1e7ee5..a8f9458b 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -12,7 +12,7 @@ ports: onOpen: ignore tasks: - - before: bash bash/init-rake-tasks.sh && bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/emoji-log ~/.gitconfig && bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/git-aliases ~/.gitconfig + - before: bash bash/before-tasks.sh init: | . bash/third-party/spinner.sh && start_spinner "Initializing MySql..." && From 2d3b7e2301448caaad2a9c69356dd8de676c5610 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 10:53:27 -0800 Subject: [PATCH 11/71] =?UTF-8?q?=F0=9F=90=9B=20FIX:=20before-tasks.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/before-tasks.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bash/before-tasks.sh b/bash/before-tasks.sh index 3da481dd..22ffd3f1 100644 --- a/bash/before-tasks.sh +++ b/bash/before-tasks.sh @@ -3,6 +3,8 @@ # Gitpod currently does not persist files in the home directory so we must write them # in everytime the workspace starts. We do this in the -before task in .gitpod.yml +. bash/spinner.sh + # Log to the console and a file log () { if [ -z "$2" ]; then From 64048b28ed0c5a8ff45991ac89e8accf7780cf58 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 10:54:44 -0800 Subject: [PATCH 12/71] =?UTF-8?q?=F0=9F=90=9B=20FIX:=20before-tasks.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/before-tasks.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash/before-tasks.sh b/bash/before-tasks.sh index 22ffd3f1..d9cfdd5a 100644 --- a/bash/before-tasks.sh +++ b/bash/before-tasks.sh @@ -3,7 +3,7 @@ # Gitpod currently does not persist files in the home directory so we must write them # in everytime the workspace starts. We do this in the -before task in .gitpod.yml -. bash/spinner.sh +. bash/third-party/spinner.sh # Log to the console and a file log () { From 136393e1f452cb8f42df37d52697e0dd60545107 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 10:57:31 -0800 Subject: [PATCH 13/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20culprit=20spinner?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/before-tasks.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/bash/before-tasks.sh b/bash/before-tasks.sh index d9cfdd5a..3260e74a 100644 --- a/bash/before-tasks.sh +++ b/bash/before-tasks.sh @@ -3,8 +3,6 @@ # Gitpod currently does not persist files in the home directory so we must write them # in everytime the workspace starts. We do this in the -before task in .gitpod.yml -. bash/third-party/spinner.sh - # Log to the console and a file log () { if [ -z "$2" ]; then @@ -26,14 +24,12 @@ log_silent () { # Rake tasks (will be written to ~/.rake). # Some rake tasks are dynamic and depend on the configuration in starter.ini msg="Writing rake tasks" -log_silent "$msg" && start_spinner "$msg" && +log "$msg" && bash bash/init-rake-tasks.sh -&& stop_spinner $? # Aliases for git msg="Writing git aliases" -log_silent "$msg" && start_spinner "$msg" && +log "$msg" && bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/emoji-log ~/.gitconfig && bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/git-aliases ~/.gitconfig && -stop_spinner $? log "try: git a or: git aliases for a list your git aliases.\n" \ No newline at end of file From 654b4e38c3ef411e056a05ada8f1bd022e508aba Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 12:53:15 -0800 Subject: [PATCH 14/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20persistance=20hack?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/before-tasks.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bash/before-tasks.sh b/bash/before-tasks.sh index 3260e74a..4048b518 100644 --- a/bash/before-tasks.sh +++ b/bash/before-tasks.sh @@ -21,6 +21,10 @@ log_silent () { fi } +# Hack: Persist any important files outside of /workspace +bash bash/helpers.sh persist_file /var/log/workspace-image.log +bash bash/helpers.sh persist_file /var/log/workspace-init.log + # Rake tasks (will be written to ~/.rake). # Some rake tasks are dynamic and depend on the configuration in starter.ini msg="Writing rake tasks" From 1279b124c0505a497b1b968ad2f8c1a6eea96cf9 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 12:55:18 -0800 Subject: [PATCH 15/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20persistance=20hack?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/helpers.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bash/helpers.sh b/bash/helpers.sh index f272c037..25a36d14 100644 --- a/bash/helpers.sh +++ b/bash/helpers.sh @@ -98,6 +98,16 @@ add_global_rake_task() { echo -e "$1" > "$root/$file" } +persist_file() { + local store="/workspace/$(basename $GITPOD_REPO_ROOT)--store" + local dest="$store/$(dirname ${1#/})" + local file="$dest/$(basename $1)" + mkdir -p $store + mkdir -p $dest + [ -f $1 ] && cp $1 $file || echo "error: $ does not exist" +} + + # Call functions from this script gracefully if declare -f "$1" > /dev/null then From 4a2ed785bccb956bd3a65eacc7d4e2bd8eef26be Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 18:24:35 -0800 Subject: [PATCH 16/71] =?UTF-8?q?=F0=9F=90=9B=20FIX:=20persistant=20init?= =?UTF-8?q?=20flag=20for=20the=20project?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/helpers.sh | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/bash/helpers.sh b/bash/helpers.sh index 25a36d14..213154be 100644 --- a/bash/helpers.sh +++ b/bash/helpers.sh @@ -98,8 +98,13 @@ add_global_rake_task() { echo -e "$1" > "$root/$file" } +# Begin: persistance hacks +get_store_root() { + echo "/workspace/$(basename $GITPOD_REPO_ROOT)--store" +} + persist_file() { - local store="/workspace/$(basename $GITPOD_REPO_ROOT)--store" + local store=$(get_store_root) local dest="$store/$(dirname ${1#/})" local file="$dest/$(basename $1)" mkdir -p $store @@ -107,6 +112,25 @@ persist_file() { [ -f $1 ] && cp $1 $file || echo "error: $ does not exist" } +inited_file () { + echo "$get_store_root/is_inited.lock" +} + + +mark_as_inited() { + local file=$(inited_file) + local store=$(get_store_root) + mkdir -p $(get_store_root) + [! -e $file ] && touch $file +} + +is_inited() { + [ -e $(inited_file) ] && echo 1 || echo 0 +} +# End: persistance hacks + + + # Call functions from this script gracefully if declare -f "$1" > /dev/null From ea507d6329f6ee3192f1672e8983ac00cf704a50 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 19:32:55 -0800 Subject: [PATCH 17/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20persisting=20log?= =?UTF-8?q?=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitpod.yml | 4 +++- bash/helpers.sh | 9 ++++++++- bash/init-complete.sh | 7 ++++++- bash/init-gitpod.sh | 15 +-------------- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index a8f9458b..a6a46f0a 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -26,7 +26,9 @@ tasks: name: Init - openMode: split-left command: | - bash bash/clear-term.sh && UP=$(pgrep mysql | wc -l); if [ "$UP" -ne 1 ]; then . bash/third-party/spinner.sh && start_spinner "Initializing MySql..." && gp await-port 3306 && stop_spinner $?; fi + bash bash/clear-term.sh && + sudo bash/helpers.sh restore_persistant_files + UP=$(pgrep mysql | wc -l); if [ "$UP" -ne 1 ]; then . bash/third-party/spinner.sh && start_spinner "Initializing MySql..." && gp await-port 3306 && stop_spinner $?; fi gp await-port 3306 && sleep 1.5 && bash -i bash/helpers.sh start_server diff --git a/bash/helpers.sh b/bash/helpers.sh index 213154be..fa718819 100644 --- a/bash/helpers.sh +++ b/bash/helpers.sh @@ -112,11 +112,18 @@ persist_file() { [ -f $1 ] && cp $1 $file || echo "error: $ does not exist" } +restore_persistant_files() { + # TODO make this dynamic + local image_log="$(get_store_root)/var/log/workspace-image.log" + [ -e $image_log ] sudo cp $image_log /var/log/workspace-image.log + local image_log="$(get_store_root)/var/log/workspace-init.log" + [ -e $init_log ] sudo cp $init_log /var/log/workspace-init.log +} + inited_file () { echo "$get_store_root/is_inited.lock" } - mark_as_inited() { local file=$(inited_file) local store=$(get_store_root) diff --git a/bash/init-complete.sh b/bash/init-complete.sh index 7d408735..6c9989fa 100644 --- a/bash/init-complete.sh +++ b/bash/init-complete.sh @@ -1,5 +1,7 @@ #!/bin/bash +# Note: allways call thi file last in the initialization sequence + workspace_log='/var/log/workspace-image.log' init_log='/var/log/workspace-init.log' echo -e "\n\e[38;5;171mSUMMARY 📃\e[0m\n" @@ -11,4 +13,7 @@ echo -en "\e[38;5;194mResults of the gitpod initialization\e[0m \e[38;5;34m$init cat $init_log echo -en "\e[0m" echo -en "\n\e[38;5;171mALL DONE 🚀\e[0m\n" -echo -e "\e[38;5;194mIf everything looks good in the above results then push the newly created\n project files to your git repo and get started coding your project\e[0m" \ No newline at end of file +echo -e "\e[38;5;194mIf everything looks good in the above results then push the newly created\n project files to your git repo and get started coding your project\e[0m" + +# Set initialized flag - Keep this at the bottom of the file +bash bash/helpers.sh mark_as_inited \ No newline at end of file diff --git a/bash/init-gitpod.sh b/bash/init-gitpod.sh index 923ece1b..962c481c 100644 --- a/bash/init-gitpod.sh +++ b/bash/init-gitpod.sh @@ -18,7 +18,6 @@ log_silent () { fi } - # Load spinner . bash/third-party/spinner.sh @@ -69,20 +68,8 @@ if [ ! -d "$GITPOD_REPO_ROOT/bootstrap" ]; then rmdir ~/test-app fi -# Rake tasks (will be written to ~/.rake). -# Some rake tasks are dynamic and depend on the configuration in starter.ini -# bash bash/init-rake-tasks.sh - -# Aliases for git -#msg="Writing git aliases" -#log_silent "$msg" && start_spinner "$msg" && -#bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/emoji-log ~/.gitconfig && -#bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/git-aliases ~/.gitconfig && -#stop_spinner $? -#log "try: git a or: git aliases for a list your git aliases.\n" - # Messages for github_changelog_generator [ "$installed_changelog_gen" == 1 ] && log "You may auto generate a CHANGELOG.md from github commits by running the command:\nrake changelog [...options]\n" && log "See starter.ini (github_changelog_generator section) for configurable options" && -log "For a full list of options see the github-changelog-generator repository on github" +log "For a full list of options see the github-changelog-generator repository on github" \ No newline at end of file From d2469bc85385fd6bac01229f5ffc475c388ce409 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 19:38:55 -0800 Subject: [PATCH 18/71] =?UTF-8?q?=F0=9F=90=9B=20FIX:=20typo=20line=20131?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/helpers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash/helpers.sh b/bash/helpers.sh index fa718819..499c2b6c 100644 --- a/bash/helpers.sh +++ b/bash/helpers.sh @@ -128,7 +128,7 @@ mark_as_inited() { local file=$(inited_file) local store=$(get_store_root) mkdir -p $(get_store_root) - [! -e $file ] && touch $file + [ ! -e $file ] && touch $file } is_inited() { From adafb75ccc7a787db48db86ca2e9ba713b61c4c5 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 19:41:28 -0800 Subject: [PATCH 19/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20file=20persistance?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitpod.yml | 1 - bash/helpers.sh | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index a6a46f0a..16bdfc12 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -26,7 +26,6 @@ tasks: name: Init - openMode: split-left command: | - bash bash/clear-term.sh && sudo bash/helpers.sh restore_persistant_files UP=$(pgrep mysql | wc -l); if [ "$UP" -ne 1 ]; then . bash/third-party/spinner.sh && start_spinner "Initializing MySql..." && gp await-port 3306 && stop_spinner $?; fi gp await-port 3306 && diff --git a/bash/helpers.sh b/bash/helpers.sh index 499c2b6c..6b1fa158 100644 --- a/bash/helpers.sh +++ b/bash/helpers.sh @@ -121,7 +121,7 @@ restore_persistant_files() { } inited_file () { - echo "$get_store_root/is_inited.lock" + echo "$(get_store_root)/is_inited.lock" } mark_as_inited() { From 9935531946bdf51667fbfa128395fe87665f1562 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 19:56:23 -0800 Subject: [PATCH 20/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20file=20persistance?= =?UTF-8?q?=20for=20image-init.log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/before-tasks.sh | 4 ---- bash/helpers.sh | 4 ++-- bash/init-complete.sh | 3 +++ 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/bash/before-tasks.sh b/bash/before-tasks.sh index 4048b518..3260e74a 100644 --- a/bash/before-tasks.sh +++ b/bash/before-tasks.sh @@ -21,10 +21,6 @@ log_silent () { fi } -# Hack: Persist any important files outside of /workspace -bash bash/helpers.sh persist_file /var/log/workspace-image.log -bash bash/helpers.sh persist_file /var/log/workspace-init.log - # Rake tasks (will be written to ~/.rake). # Some rake tasks are dynamic and depend on the configuration in starter.ini msg="Writing rake tasks" diff --git a/bash/helpers.sh b/bash/helpers.sh index 6b1fa158..79ad2c30 100644 --- a/bash/helpers.sh +++ b/bash/helpers.sh @@ -114,8 +114,8 @@ persist_file() { restore_persistant_files() { # TODO make this dynamic - local image_log="$(get_store_root)/var/log/workspace-image.log" - [ -e $image_log ] sudo cp $image_log /var/log/workspace-image.log + #local image_log="$(get_store_root)/var/log/workspace-image.log" + #[ -e $image_log ] sudo cp $image_log /var/log/workspace-image.log local image_log="$(get_store_root)/var/log/workspace-init.log" [ -e $init_log ] sudo cp $init_log /var/log/workspace-init.log } diff --git a/bash/init-complete.sh b/bash/init-complete.sh index 6c9989fa..2d20fe4f 100644 --- a/bash/init-complete.sh +++ b/bash/init-complete.sh @@ -15,5 +15,8 @@ echo -en "\e[0m" echo -en "\n\e[38;5;171mALL DONE 🚀\e[0m\n" echo -e "\e[38;5;194mIf everything looks good in the above results then push the newly created\n project files to your git repo and get started coding your project\e[0m" + +# Hack: Persist the workspace-init.log since the .gitpod.Dockerfile will wipe it out and it wont come back after the first run +bash bash/helpers.sh persist_file /var/log/workspace-init.log # Set initialized flag - Keep this at the bottom of the file bash bash/helpers.sh mark_as_inited \ No newline at end of file From 519dab4be19fe3ebe1b45ba4e44a60b4eb169c30 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 20:06:29 -0800 Subject: [PATCH 21/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20file=20persistance?= =?UTF-8?q?=20for=20image-init.log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitpod.yml | 1 + bash/before-tasks.sh | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index 16bdfc12..8d5c15e2 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -36,6 +36,7 @@ tasks: command: | default_server=$(bash bash/utils.sh parse_ini_value starter.ini development default_server); open_preview $default_server name: Main Terminal + - openMode: split-left vscode: extensions: diff --git a/bash/before-tasks.sh b/bash/before-tasks.sh index 3260e74a..2dc6fded 100644 --- a/bash/before-tasks.sh +++ b/bash/before-tasks.sh @@ -24,12 +24,12 @@ log_silent () { # Rake tasks (will be written to ~/.rake). # Some rake tasks are dynamic and depend on the configuration in starter.ini msg="Writing rake tasks" -log "$msg" && +#log "$msg" && bash bash/init-rake-tasks.sh # Aliases for git msg="Writing git aliases" -log "$msg" && +#log "$msg" && bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/emoji-log ~/.gitconfig && bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/git-aliases ~/.gitconfig && -log "try: git a or: git aliases for a list your git aliases.\n" \ No newline at end of file +#log "try: git a or: git aliases for a list your git aliases.\n" \ No newline at end of file From 231d06dad1c51b73427a0dc9c29190a7517166e5 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 20:09:44 -0800 Subject: [PATCH 22/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20file=20persistance?= =?UTF-8?q?=20for=20image-init.log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitpod.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitpod.yml b/.gitpod.yml index 8d5c15e2..b68c7b09 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -26,7 +26,7 @@ tasks: name: Init - openMode: split-left command: | - sudo bash/helpers.sh restore_persistant_files + sudo bash bash/helpers.sh restore_persistant_files UP=$(pgrep mysql | wc -l); if [ "$UP" -ne 1 ]; then . bash/third-party/spinner.sh && start_spinner "Initializing MySql..." && gp await-port 3306 && stop_spinner $?; fi gp await-port 3306 && sleep 1.5 && From 42de1bbf13ba5e6b245063e869c98026dea92658 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 20:10:52 -0800 Subject: [PATCH 23/71] =?UTF-8?q?=F0=9F=90=9B=20FIX:=20type?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/before-tasks.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash/before-tasks.sh b/bash/before-tasks.sh index 2dc6fded..7dd37596 100644 --- a/bash/before-tasks.sh +++ b/bash/before-tasks.sh @@ -31,5 +31,5 @@ bash bash/init-rake-tasks.sh msg="Writing git aliases" #log "$msg" && bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/emoji-log ~/.gitconfig && -bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/git-aliases ~/.gitconfig && +bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/git-aliases ~/.gitconfig #log "try: git a or: git aliases for a list your git aliases.\n" \ No newline at end of file From d4da83f9867987d7bdeb1468a79579a4eb19657d Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 20:13:18 -0800 Subject: [PATCH 24/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20file=20persistance?= =?UTF-8?q?=20for=20image-init.log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/helpers.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bash/helpers.sh b/bash/helpers.sh index 79ad2c30..9b2e78dd 100644 --- a/bash/helpers.sh +++ b/bash/helpers.sh @@ -106,7 +106,7 @@ get_store_root() { persist_file() { local store=$(get_store_root) local dest="$store/$(dirname ${1#/})" - local file="$dest/$(basename $1)" + local file="$dest/$(basename "$1")" mkdir -p $store mkdir -p $dest [ -f $1 ] && cp $1 $file || echo "error: $ does not exist" @@ -117,7 +117,7 @@ restore_persistant_files() { #local image_log="$(get_store_root)/var/log/workspace-image.log" #[ -e $image_log ] sudo cp $image_log /var/log/workspace-image.log local image_log="$(get_store_root)/var/log/workspace-init.log" - [ -e $init_log ] sudo cp $init_log /var/log/workspace-init.log + [ -e $init_log ] && sudo cp $init_log /var/log/workspace-init.log } inited_file () { From d477a9753bb3c880e54d1becd1930d4bfe2d6f6b Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 20:18:02 -0800 Subject: [PATCH 25/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20file=20persistance?= =?UTF-8?q?=20for=20image-init.log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitpod.yml | 2 +- bash/helpers.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index b68c7b09..9697bbfb 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -29,7 +29,7 @@ tasks: sudo bash bash/helpers.sh restore_persistant_files UP=$(pgrep mysql | wc -l); if [ "$UP" -ne 1 ]; then . bash/third-party/spinner.sh && start_spinner "Initializing MySql..." && gp await-port 3306 && stop_spinner $?; fi gp await-port 3306 && - sleep 1.5 && + sleep 5.5 && bash -i bash/helpers.sh start_server name: Web Server - openMode: split-left diff --git a/bash/helpers.sh b/bash/helpers.sh index 9b2e78dd..5d34204b 100644 --- a/bash/helpers.sh +++ b/bash/helpers.sh @@ -109,7 +109,7 @@ persist_file() { local file="$dest/$(basename "$1")" mkdir -p $store mkdir -p $dest - [ -f $1 ] && cp $1 $file || echo "error: $ does not exist" + [ -f $1 ] && cp $1 "$file" || echo "error: $ does not exist" } restore_persistant_files() { From cfe86b6311c2c7bc006eaa1c5a559e2e3e101284 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 20:20:33 -0800 Subject: [PATCH 26/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20file=20persistance?= =?UTF-8?q?=20for=20image-init.log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/helpers.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bash/helpers.sh b/bash/helpers.sh index 5d34204b..a906ee92 100644 --- a/bash/helpers.sh +++ b/bash/helpers.sh @@ -104,12 +104,17 @@ get_store_root() { } persist_file() { + echo "persist_file called for $1" local store=$(get_store_root) local dest="$store/$(dirname ${1#/})" local file="$dest/$(basename "$1")" mkdir -p $store mkdir -p $dest - [ -f $1 ] && cp $1 "$file" || echo "error: $ does not exist" + if [ -f $1 ]; then + cp "$1" "$file" + else + echo "error: $ does not exist" + fi } restore_persistant_files() { From 9e97c9ebfd9853046e082b6c1e9df3ce83d2aac4 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 20:22:39 -0800 Subject: [PATCH 27/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20file=20persistance?= =?UTF-8?q?=20for=20image-init.log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitpod.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index 9697bbfb..531de912 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -27,10 +27,6 @@ tasks: - openMode: split-left command: | sudo bash bash/helpers.sh restore_persistant_files - UP=$(pgrep mysql | wc -l); if [ "$UP" -ne 1 ]; then . bash/third-party/spinner.sh && start_spinner "Initializing MySql..." && gp await-port 3306 && stop_spinner $?; fi - gp await-port 3306 && - sleep 5.5 && - bash -i bash/helpers.sh start_server name: Web Server - openMode: split-left command: | From c3544816d664ab3942264c23371fe7baa270ed68 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 20:58:08 -0800 Subject: [PATCH 28/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20file=20persistance?= =?UTF-8?q?=20for=20image-init.log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitpod.yml | 2 +- bash/helpers.sh | 18 +++++++----------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index 531de912..26b385f1 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -26,7 +26,7 @@ tasks: name: Init - openMode: split-left command: | - sudo bash bash/helpers.sh restore_persistant_files + [ bash bash/helpers.sh is_inited == 0 && sudo bash bash/helpers.sh restore_persistant_files name: Web Server - openMode: split-left command: | diff --git a/bash/helpers.sh b/bash/helpers.sh index a906ee92..9ac6df72 100644 --- a/bash/helpers.sh +++ b/bash/helpers.sh @@ -104,25 +104,21 @@ get_store_root() { } persist_file() { + local err="helpers.sh: persist: error:" echo "persist_file called for $1" local store=$(get_store_root) local dest="$store/$(dirname ${1#/})" local file="$dest/$(basename "$1")" - mkdir -p $store - mkdir -p $dest - if [ -f $1 ]; then - cp "$1" "$file" - else - echo "error: $ does not exist" - fi + mkdir -p $store && mkdir -p $dest + [ -f $1 ] && cp $1 $file echo "$err $1 does not exist" } restore_persistant_files() { + local err="helpers.sh: restore_persistant_files: error:" # TODO make this dynamic - #local image_log="$(get_store_root)/var/log/workspace-image.log" - #[ -e $image_log ] sudo cp $image_log /var/log/workspace-image.log - local image_log="$(get_store_root)/var/log/workspace-init.log" - [ -e $init_log ] && sudo cp $init_log /var/log/workspace-init.log + local init_log_orig=/var/log/workspace-init.log + local init_log="$(get_store_root)$init_log_orig" + [ -e $init_log ] && cp $init_log $init_log_orig || echo "$err $init_log NOT FOUND" } inited_file () { From df1aae025fb750e964fa0022fcdf16dddaa659a9 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 20:59:09 -0800 Subject: [PATCH 29/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20file=20persistance?= =?UTF-8?q?=20for=20image-init.log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitpod.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitpod.yml b/.gitpod.yml index 26b385f1..1b939bdd 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -26,7 +26,7 @@ tasks: name: Init - openMode: split-left command: | - [ bash bash/helpers.sh is_inited == 0 && sudo bash bash/helpers.sh restore_persistant_files + [ bash bash/helpers.sh is_inited == 0 ] && sudo bash bash/helpers.sh restore_persistant_files name: Web Server - openMode: split-left command: | From ce00fa43f84d706ba999eff71099f72a8478976d Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 20:59:36 -0800 Subject: [PATCH 30/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20file=20persistance?= =?UTF-8?q?=20for=20image-init.log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitpod.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitpod.yml b/.gitpod.yml index 1b939bdd..964ed0d8 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -26,7 +26,7 @@ tasks: name: Init - openMode: split-left command: | - [ bash bash/helpers.sh is_inited == 0 ] && sudo bash bash/helpers.sh restore_persistant_files + [ bash bash/helpers.sh is_inited == 1 ] && sudo bash bash/helpers.sh restore_persistant_files name: Web Server - openMode: split-left command: | From 459cc54a0359c63e33033be86f63289e2b42d4d4 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 21:00:37 -0800 Subject: [PATCH 31/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20file=20persistance?= =?UTF-8?q?=20for=20image-init.log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitpod.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitpod.yml b/.gitpod.yml index 964ed0d8..531de912 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -26,7 +26,7 @@ tasks: name: Init - openMode: split-left command: | - [ bash bash/helpers.sh is_inited == 1 ] && sudo bash bash/helpers.sh restore_persistant_files + sudo bash bash/helpers.sh restore_persistant_files name: Web Server - openMode: split-left command: | From 39c532a0898ded9303d9e65e5dcf1fa8292c82e3 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 21:09:36 -0800 Subject: [PATCH 32/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20file=20persistance?= =?UTF-8?q?=20for=20image-init.log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/helpers.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/bash/helpers.sh b/bash/helpers.sh index 9ac6df72..a5d2412c 100644 --- a/bash/helpers.sh +++ b/bash/helpers.sh @@ -100,6 +100,7 @@ add_global_rake_task() { # Begin: persistance hacks get_store_root() { + echo "GIT_REPO_ROOT=$GITPOD_REPO_ROOT" echo "/workspace/$(basename $GITPOD_REPO_ROOT)--store" } From 26a83b425ab64508d4fc5666c5067de1d2c2af0e Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 21:21:11 -0800 Subject: [PATCH 33/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20file=20persistance?= =?UTF-8?q?=20for=20image-init.log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/before-tasks.sh | 6 +++++- bash/helpers.sh | 3 +-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bash/before-tasks.sh b/bash/before-tasks.sh index 7dd37596..ba7fc0ad 100644 --- a/bash/before-tasks.sh +++ b/bash/before-tasks.sh @@ -32,4 +32,8 @@ msg="Writing git aliases" #log "$msg" && bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/emoji-log ~/.gitconfig && bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/git-aliases ~/.gitconfig -#log "try: git a or: git aliases for a list your git aliases.\n" \ No newline at end of file +#log "try: git a or: git aliases for a list your git aliases.\n" + +if [ bash/helpers.sh is_inited == 1]; then + sudo bash bash/helpers.sh restore_persistant_files +fi \ No newline at end of file diff --git a/bash/helpers.sh b/bash/helpers.sh index a5d2412c..ea342e1b 100644 --- a/bash/helpers.sh +++ b/bash/helpers.sh @@ -100,7 +100,6 @@ add_global_rake_task() { # Begin: persistance hacks get_store_root() { - echo "GIT_REPO_ROOT=$GITPOD_REPO_ROOT" echo "/workspace/$(basename $GITPOD_REPO_ROOT)--store" } @@ -111,7 +110,7 @@ persist_file() { local dest="$store/$(dirname ${1#/})" local file="$dest/$(basename "$1")" mkdir -p $store && mkdir -p $dest - [ -f $1 ] && cp $1 $file echo "$err $1 does not exist" + [ -f $1 ] && cp $1 $file || echo "$err $1 does not exist" } restore_persistant_files() { From e52a39881be0946be07001f04ff9a174ad92695d Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 21:22:09 -0800 Subject: [PATCH 34/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20file=20persistance?= =?UTF-8?q?=20for=20image-init.log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/before-tasks.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash/before-tasks.sh b/bash/before-tasks.sh index ba7fc0ad..16e29761 100644 --- a/bash/before-tasks.sh +++ b/bash/before-tasks.sh @@ -34,6 +34,6 @@ bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/emoji-log ~/ bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/git-aliases ~/.gitconfig #log "try: git a or: git aliases for a list your git aliases.\n" -if [ bash/helpers.sh is_inited == 1]; then +if [ bash/helpers.sh is_inited == 1 ]; then sudo bash bash/helpers.sh restore_persistant_files fi \ No newline at end of file From 6e57411e899a888ef3ed4a4011123762db0de12d Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 21:24:12 -0800 Subject: [PATCH 35/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20file=20persistance?= =?UTF-8?q?=20for=20image-init.log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitpod.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index 531de912..0d02bf56 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -25,14 +25,15 @@ tasks: bash bash/init-complete.sh name: Init - openMode: split-left - command: | - sudo bash bash/helpers.sh restore_persistant_files + UP=$(pgrep mysql | wc -l); if [ "$UP" -ne 1 ]; then . bash/third-party/spinner.sh && start_spinner "Initializing MySql..." && gp await-port 3306 && stop_spinner $?; fi + gp await-port 3306 && + sleep 5.5 && + bash -i bash/helpers.sh start_server name: Web Server - openMode: split-left command: | default_server=$(bash bash/utils.sh parse_ini_value starter.ini development default_server); open_preview $default_server name: Main Terminal - - openMode: split-left vscode: extensions: From 9e164c6ce06bea4d709039046ba583d69ec19212 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 21:28:28 -0800 Subject: [PATCH 36/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20file=20persistance?= =?UTF-8?q?=20for=20image-init.log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitpod.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitpod.yml b/.gitpod.yml index 0d02bf56..f5fd2259 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -25,6 +25,7 @@ tasks: bash bash/init-complete.sh name: Init - openMode: split-left + command: | UP=$(pgrep mysql | wc -l); if [ "$UP" -ne 1 ]; then . bash/third-party/spinner.sh && start_spinner "Initializing MySql..." && gp await-port 3306 && stop_spinner $?; fi gp await-port 3306 && sleep 5.5 && From 5424cd1afdbd7c46302370d4cccf2b9c293d3a72 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 21:33:06 -0800 Subject: [PATCH 37/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20file=20persistance?= =?UTF-8?q?=20for=20image-init.log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/before-tasks.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash/before-tasks.sh b/bash/before-tasks.sh index 16e29761..c414b7c5 100644 --- a/bash/before-tasks.sh +++ b/bash/before-tasks.sh @@ -34,6 +34,6 @@ bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/emoji-log ~/ bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/git-aliases ~/.gitconfig #log "try: git a or: git aliases for a list your git aliases.\n" -if [ bash/helpers.sh is_inited == 1 ]; then +if [ $(bash/helpers.sh is_inited) == "1" ]; then sudo bash bash/helpers.sh restore_persistant_files fi \ No newline at end of file From b7b6e3393226070bf309bb3a07c54d056797daf1 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 21:37:18 -0800 Subject: [PATCH 38/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20file=20persistance?= =?UTF-8?q?=20for=20image-init.log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/before-tasks.sh | 2 +- bash/helpers.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bash/before-tasks.sh b/bash/before-tasks.sh index c414b7c5..91b5c9fe 100644 --- a/bash/before-tasks.sh +++ b/bash/before-tasks.sh @@ -34,6 +34,6 @@ bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/emoji-log ~/ bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/git-aliases ~/.gitconfig #log "try: git a or: git aliases for a list your git aliases.\n" -if [ $(bash/helpers.sh is_inited) == "1" ]; then +if [ $(bash/helpers.sh is_inited) == 1 ]; then sudo bash bash/helpers.sh restore_persistant_files fi \ No newline at end of file diff --git a/bash/helpers.sh b/bash/helpers.sh index ea342e1b..4331767f 100644 --- a/bash/helpers.sh +++ b/bash/helpers.sh @@ -118,7 +118,7 @@ restore_persistant_files() { # TODO make this dynamic local init_log_orig=/var/log/workspace-init.log local init_log="$(get_store_root)$init_log_orig" - [ -e $init_log ] && cp $init_log $init_log_orig || echo "$err $init_log NOT FOUND" + [ -e $init_log ] && sudo cp $init_log $init_log_orig || echo "$err $init_log NOT FOUND" } inited_file () { From ccbd68263eb2bb0bf8b86bd3e731c816aa71a588 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 21:41:33 -0800 Subject: [PATCH 39/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20file=20persistance?= =?UTF-8?q?=20for=20image-init.log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/init-gitpod.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash/init-gitpod.sh b/bash/init-gitpod.sh index 962c481c..d6878e7b 100644 --- a/bash/init-gitpod.sh +++ b/bash/init-gitpod.sh @@ -38,7 +38,7 @@ if [ ! -d "$GITPOD_REPO_ROOT/bootstrap" ]; then fi # BEGIN: Optional configurations # Super user account for phpmyadmin - installed_phpmyadmin=$(. /tmp/utils.sh parse_ini_value /tmp/starter.ini phpmyadmin install) + installed_phpmyadmin=$(. utils.sh parse_ini_value starter.ini phpmyadmin install) if [ "$installed_phpmyadmin" == 1 ]; then msg="Creating phpmyadmin superuser: pmasu" log_silent "$msg" && start_spinner "$msg" From f0dbb6705d1a3c33cbccd6652779381ed620e47b Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 21:43:04 -0800 Subject: [PATCH 40/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20file=20persistance?= =?UTF-8?q?=20for=20image-init.log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/before-tasks.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash/before-tasks.sh b/bash/before-tasks.sh index 91b5c9fe..1f2d3251 100644 --- a/bash/before-tasks.sh +++ b/bash/before-tasks.sh @@ -34,6 +34,6 @@ bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/emoji-log ~/ bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/git-aliases ~/.gitconfig #log "try: git a or: git aliases for a list your git aliases.\n" -if [ $(bash/helpers.sh is_inited) == 1 ]; then +if [ $(bash bash/helpers.sh is_inited) == 1 ]; then sudo bash bash/helpers.sh restore_persistant_files fi \ No newline at end of file From f370226c4aff98aa188409ef5dd682e5728b36a1 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 21:44:58 -0800 Subject: [PATCH 41/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20file=20persistance?= =?UTF-8?q?=20for=20image-init.log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/init-gitpod.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash/init-gitpod.sh b/bash/init-gitpod.sh index d6878e7b..aa2b93c5 100644 --- a/bash/init-gitpod.sh +++ b/bash/init-gitpod.sh @@ -38,7 +38,7 @@ if [ ! -d "$GITPOD_REPO_ROOT/bootstrap" ]; then fi # BEGIN: Optional configurations # Super user account for phpmyadmin - installed_phpmyadmin=$(. utils.sh parse_ini_value starter.ini phpmyadmin install) + installed_phpmyadmin=$(. bash/utils.sh parse_ini_value starter.ini phpmyadmin install) if [ "$installed_phpmyadmin" == 1 ]; then msg="Creating phpmyadmin superuser: pmasu" log_silent "$msg" && start_spinner "$msg" From 769765f6a934a501430dd7efe13434dc6d593056 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 21:50:50 -0800 Subject: [PATCH 42/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20file=20persistance?= =?UTF-8?q?=20for=20image-init.log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/helpers.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bash/helpers.sh b/bash/helpers.sh index 4331767f..838f553b 100644 --- a/bash/helpers.sh +++ b/bash/helpers.sh @@ -100,7 +100,9 @@ add_global_rake_task() { # Begin: persistance hacks get_store_root() { - echo "/workspace/$(basename $GITPOD_REPO_ROOT)--store" + # Hunch: looks like $GITPOD_REPO_ROOT is not available in the 'before' phase. + #echo "/workspace/$(basename $GITPOD_REPO_ROOT)--store" + echo "/workspace/gitpod-laravel8-starter--store" } persist_file() { From 8effd6410f733f8a4b2e37007952d9c96afc8987 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 21:57:41 -0800 Subject: [PATCH 43/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20are=20GITPOD=20env?= =?UTF-8?q?s=20ready=20in=20the=20before=20phase=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/before-tasks.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/bash/before-tasks.sh b/bash/before-tasks.sh index 1f2d3251..f61f41dd 100644 --- a/bash/before-tasks.sh +++ b/bash/before-tasks.sh @@ -4,6 +4,7 @@ # in everytime the workspace starts. We do this in the -before task in .gitpod.yml # Log to the console and a file +env | grep GITPOD_REPO_ROOT log () { if [ -z "$2" ]; then bash bash/utils.sh log "$1" /var/log/workspace-init.log From 1557b3e2322a6c15620b9e9b72f9e66eada96226 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 22:00:53 -0800 Subject: [PATCH 44/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20are=20GITPOD=20env?= =?UTF-8?q?s=20ready=20in=20the=20before=20phase=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitpod.yml | 2 +- bash/before-tasks.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index f5fd2259..42fbe303 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -28,7 +28,7 @@ tasks: command: | UP=$(pgrep mysql | wc -l); if [ "$UP" -ne 1 ]; then . bash/third-party/spinner.sh && start_spinner "Initializing MySql..." && gp await-port 3306 && stop_spinner $?; fi gp await-port 3306 && - sleep 5.5 && + sleep 1 && bash -i bash/helpers.sh start_server name: Web Server - openMode: split-left diff --git a/bash/before-tasks.sh b/bash/before-tasks.sh index f61f41dd..c027ade8 100644 --- a/bash/before-tasks.sh +++ b/bash/before-tasks.sh @@ -4,7 +4,7 @@ # in everytime the workspace starts. We do this in the -before task in .gitpod.yml # Log to the console and a file -env | grep GITPOD_REPO_ROOT +echo "before task: GITPOD_REPO_ROOT is $GITPOD_REPO_ROOT, GITPOD_WORKSPACE_ID is $GITPOD_WORKSPACE_ID" log () { if [ -z "$2" ]; then bash bash/utils.sh log "$1" /var/log/workspace-init.log From bca5734958eaf4168f071663bfdc71909742d3d9 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 22:05:08 -0800 Subject: [PATCH 45/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20are=20GITPOD=20env?= =?UTF-8?q?s=20ready=20in=20the=20before=20phase=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/helpers.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bash/helpers.sh b/bash/helpers.sh index 838f553b..bdd8baa3 100644 --- a/bash/helpers.sh +++ b/bash/helpers.sh @@ -101,8 +101,8 @@ add_global_rake_task() { # Begin: persistance hacks get_store_root() { # Hunch: looks like $GITPOD_REPO_ROOT is not available in the 'before' phase. - #echo "/workspace/$(basename $GITPOD_REPO_ROOT)--store" - echo "/workspace/gitpod-laravel8-starter--store" + echo "/workspace/$(basename $GITPOD_REPO_ROOT)--store" + #echo "/workspace/gitpod-laravel8-starter--store" } persist_file() { From 0b2b5d8ae012acd1bf688512202435706ebc33d9 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 22:13:42 -0800 Subject: [PATCH 46/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20file=20persistance?= =?UTF-8?q?=20for=20image-init.log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/helpers.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bash/helpers.sh b/bash/helpers.sh index bdd8baa3..e1cfacee 100644 --- a/bash/helpers.sh +++ b/bash/helpers.sh @@ -100,7 +100,7 @@ add_global_rake_task() { # Begin: persistance hacks get_store_root() { - # Hunch: looks like $GITPOD_REPO_ROOT is not available in the 'before' phase. + # Hunch: $GITPOD_REPO_ROOT iis an empty string when called from before phase for some reason echo "/workspace/$(basename $GITPOD_REPO_ROOT)--store" #echo "/workspace/gitpod-laravel8-starter--store" } @@ -108,7 +108,8 @@ get_store_root() { persist_file() { local err="helpers.sh: persist: error:" echo "persist_file called for $1" - local store=$(get_store_root) + #local store=$(get_store_root) + local store="/workspace/$(basename $GITPOD_REPO_ROOT)--store" local dest="$store/$(dirname ${1#/})" local file="$dest/$(basename "$1")" mkdir -p $store && mkdir -p $dest From 09358d773c5674b17897357731101c2446e2f896 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 22:18:30 -0800 Subject: [PATCH 47/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20file=20persistance?= =?UTF-8?q?=20for=20image-init.log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/helpers.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bash/helpers.sh b/bash/helpers.sh index e1cfacee..e920dad4 100644 --- a/bash/helpers.sh +++ b/bash/helpers.sh @@ -100,7 +100,7 @@ add_global_rake_task() { # Begin: persistance hacks get_store_root() { - # Hunch: $GITPOD_REPO_ROOT iis an empty string when called from before phase for some reason + # Hunch: $GITPOD_REPO_ROOT is an empty string when called from before phase via restore_persistant_files for some reason echo "/workspace/$(basename $GITPOD_REPO_ROOT)--store" #echo "/workspace/gitpod-laravel8-starter--store" } @@ -108,8 +108,7 @@ get_store_root() { persist_file() { local err="helpers.sh: persist: error:" echo "persist_file called for $1" - #local store=$(get_store_root) - local store="/workspace/$(basename $GITPOD_REPO_ROOT)--store" + local store=$(get_store_root) local dest="$store/$(dirname ${1#/})" local file="$dest/$(basename "$1")" mkdir -p $store && mkdir -p $dest @@ -120,7 +119,9 @@ restore_persistant_files() { local err="helpers.sh: restore_persistant_files: error:" # TODO make this dynamic local init_log_orig=/var/log/workspace-init.log - local init_log="$(get_store_root)$init_log_orig" + local store="/workspace/$(basename $GITPOD_REPO_ROOT)--store" + #local init_log="$(get_store_root)$init_log_orig" + local init_log="$store$init_log_orig" [ -e $init_log ] && sudo cp $init_log $init_log_orig || echo "$err $init_log NOT FOUND" } From 741b81f1d2d615c99db7a6677e46629a08901133 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 22:21:41 -0800 Subject: [PATCH 48/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20file=20persistance?= =?UTF-8?q?=20for=20image-init.log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/before-tasks.sh | 1 + bash/helpers.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/bash/before-tasks.sh b/bash/before-tasks.sh index c027ade8..db4c00ad 100644 --- a/bash/before-tasks.sh +++ b/bash/before-tasks.sh @@ -35,6 +35,7 @@ bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/emoji-log ~/ bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/git-aliases ~/.gitconfig #log "try: git a or: git aliases for a list your git aliases.\n" +# compare to zero for testing this on the first run, put it back to 1 once it works if [ $(bash bash/helpers.sh is_inited) == 1 ]; then sudo bash bash/helpers.sh restore_persistant_files fi \ No newline at end of file diff --git a/bash/helpers.sh b/bash/helpers.sh index e920dad4..82df0061 100644 --- a/bash/helpers.sh +++ b/bash/helpers.sh @@ -119,6 +119,7 @@ restore_persistant_files() { local err="helpers.sh: restore_persistant_files: error:" # TODO make this dynamic local init_log_orig=/var/log/workspace-init.log + echo "GITPOD_REPO_ROOT is $GITPOD_REPO_ROOT" local store="/workspace/$(basename $GITPOD_REPO_ROOT)--store" #local init_log="$(get_store_root)$init_log_orig" local init_log="$store$init_log_orig" From 18515e11ff6c0416c24094c6c0578332004a8d06 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 22:23:44 -0800 Subject: [PATCH 49/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20file=20persistance?= =?UTF-8?q?=20for=20image-init.log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/before-tasks.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash/before-tasks.sh b/bash/before-tasks.sh index db4c00ad..be088377 100644 --- a/bash/before-tasks.sh +++ b/bash/before-tasks.sh @@ -37,5 +37,5 @@ bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/git-aliases # compare to zero for testing this on the first run, put it back to 1 once it works if [ $(bash bash/helpers.sh is_inited) == 1 ]; then - sudo bash bash/helpers.sh restore_persistant_files + sudo bash bash/helpers.sh restore_persistant_files && sleep 5 fi \ No newline at end of file From c0b5641d3cde2e88cc77d9a724ecfaf9da2fcc58 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 22:24:02 -0800 Subject: [PATCH 50/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20file=20persistance?= =?UTF-8?q?=20for=20image-init.log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/before-tasks.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bash/before-tasks.sh b/bash/before-tasks.sh index be088377..8a582505 100644 --- a/bash/before-tasks.sh +++ b/bash/before-tasks.sh @@ -36,6 +36,6 @@ bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/git-aliases #log "try: git a or: git aliases for a list your git aliases.\n" # compare to zero for testing this on the first run, put it back to 1 once it works -if [ $(bash bash/helpers.sh is_inited) == 1 ]; then - sudo bash bash/helpers.sh restore_persistant_files && sleep 5 +if [ $(bash bash/helpers.sh is_inited) == 0 ]; then + sudo bash bash/helpers.sh restore_persistant_files fi \ No newline at end of file From 0b595635e41f93dc3a7d51fc4a0ed8ab10fc5441 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 22:28:52 -0800 Subject: [PATCH 51/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20file=20persistance?= =?UTF-8?q?=20for=20image-init.log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/before-tasks.sh | 2 +- bash/helpers.sh | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bash/before-tasks.sh b/bash/before-tasks.sh index 8a582505..04976a95 100644 --- a/bash/before-tasks.sh +++ b/bash/before-tasks.sh @@ -37,5 +37,5 @@ bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/git-aliases # compare to zero for testing this on the first run, put it back to 1 once it works if [ $(bash bash/helpers.sh is_inited) == 0 ]; then - sudo bash bash/helpers.sh restore_persistant_files + sudo bash bash/helpers.sh restore_persistant_files $GITPOD_REPO_ROOT fi \ No newline at end of file diff --git a/bash/helpers.sh b/bash/helpers.sh index 82df0061..eb8fec48 100644 --- a/bash/helpers.sh +++ b/bash/helpers.sh @@ -115,12 +115,13 @@ persist_file() { [ -f $1 ] && cp $1 $file || echo "$err $1 does not exist" } +# For some reason $GITPOD_REPO_ROOT is not avaialable when this is called (from before task) +# So just pass it in from there as $1 restore_persistant_files() { local err="helpers.sh: restore_persistant_files: error:" # TODO make this dynamic local init_log_orig=/var/log/workspace-init.log - echo "GITPOD_REPO_ROOT is $GITPOD_REPO_ROOT" - local store="/workspace/$(basename $GITPOD_REPO_ROOT)--store" + local store="/workspace/$(basename $1)--store" #local init_log="$(get_store_root)$init_log_orig" local init_log="$store$init_log_orig" [ -e $init_log ] && sudo cp $init_log $init_log_orig || echo "$err $init_log NOT FOUND" From d01029fc76a0b58e864400a14767b002797bc5e8 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 22:34:27 -0800 Subject: [PATCH 52/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20file=20persistance?= =?UTF-8?q?=20for=20image-init.log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/before-tasks.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bash/before-tasks.sh b/bash/before-tasks.sh index 04976a95..cb791f83 100644 --- a/bash/before-tasks.sh +++ b/bash/before-tasks.sh @@ -35,7 +35,6 @@ bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/emoji-log ~/ bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/git-aliases ~/.gitconfig #log "try: git a or: git aliases for a list your git aliases.\n" -# compare to zero for testing this on the first run, put it back to 1 once it works -if [ $(bash bash/helpers.sh is_inited) == 0 ]; then +if [ $(bash bash/helpers.sh is_inited) == 1 ]; then sudo bash bash/helpers.sh restore_persistant_files $GITPOD_REPO_ROOT fi \ No newline at end of file From 67b22882b93c62b5b8afca38f72ba6ea0b512073 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 22:39:16 -0800 Subject: [PATCH 53/71] =?UTF-8?q?=F0=9F=90=9B=20FIX:=20file=20persistance?= =?UTF-8?q?=20hack=20works!=20removing=20sudo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/before-tasks.sh | 2 +- bash/helpers.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bash/before-tasks.sh b/bash/before-tasks.sh index cb791f83..4d450533 100644 --- a/bash/before-tasks.sh +++ b/bash/before-tasks.sh @@ -36,5 +36,5 @@ bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/git-aliases #log "try: git a or: git aliases for a list your git aliases.\n" if [ $(bash bash/helpers.sh is_inited) == 1 ]; then - sudo bash bash/helpers.sh restore_persistant_files $GITPOD_REPO_ROOT + bash bash/helpers.sh restore_persistant_files $GITPOD_REPO_ROOT fi \ No newline at end of file diff --git a/bash/helpers.sh b/bash/helpers.sh index eb8fec48..928c3bf0 100644 --- a/bash/helpers.sh +++ b/bash/helpers.sh @@ -124,7 +124,7 @@ restore_persistant_files() { local store="/workspace/$(basename $1)--store" #local init_log="$(get_store_root)$init_log_orig" local init_log="$store$init_log_orig" - [ -e $init_log ] && sudo cp $init_log $init_log_orig || echo "$err $init_log NOT FOUND" + [ -e $init_log ] && cp $init_log $init_log_orig || echo "$err $init_log NOT FOUND" } inited_file () { From 36034ae524b43885855851f0f9be6232ef542dbf Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 22:44:40 -0800 Subject: [PATCH 54/71] =?UTF-8?q?=F0=9F=90=9B=20FIX:=20remove=20traces?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/before-tasks.sh | 1 - bash/helpers.sh | 4 ---- 2 files changed, 5 deletions(-) diff --git a/bash/before-tasks.sh b/bash/before-tasks.sh index 4d450533..e308add3 100644 --- a/bash/before-tasks.sh +++ b/bash/before-tasks.sh @@ -4,7 +4,6 @@ # in everytime the workspace starts. We do this in the -before task in .gitpod.yml # Log to the console and a file -echo "before task: GITPOD_REPO_ROOT is $GITPOD_REPO_ROOT, GITPOD_WORKSPACE_ID is $GITPOD_WORKSPACE_ID" log () { if [ -z "$2" ]; then bash bash/utils.sh log "$1" /var/log/workspace-init.log diff --git a/bash/helpers.sh b/bash/helpers.sh index 928c3bf0..3ddad2f0 100644 --- a/bash/helpers.sh +++ b/bash/helpers.sh @@ -100,14 +100,11 @@ add_global_rake_task() { # Begin: persistance hacks get_store_root() { - # Hunch: $GITPOD_REPO_ROOT is an empty string when called from before phase via restore_persistant_files for some reason echo "/workspace/$(basename $GITPOD_REPO_ROOT)--store" - #echo "/workspace/gitpod-laravel8-starter--store" } persist_file() { local err="helpers.sh: persist: error:" - echo "persist_file called for $1" local store=$(get_store_root) local dest="$store/$(dirname ${1#/})" local file="$dest/$(basename "$1")" @@ -122,7 +119,6 @@ restore_persistant_files() { # TODO make this dynamic local init_log_orig=/var/log/workspace-init.log local store="/workspace/$(basename $1)--store" - #local init_log="$(get_store_root)$init_log_orig" local init_log="$store$init_log_orig" [ -e $init_log ] && cp $init_log $init_log_orig || echo "$err $init_log NOT FOUND" } From 8077a4b3920a467744f7b994108c46beff257dfc Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 22:46:29 -0800 Subject: [PATCH 55/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20trying=20it=20all?= =?UTF-8?q?=20with=20loging=20to=20the=20now=20persistent=20init=20log=20f?= =?UTF-8?q?rom=20a=20command?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/before-tasks.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bash/before-tasks.sh b/bash/before-tasks.sh index e308add3..0e50bb19 100644 --- a/bash/before-tasks.sh +++ b/bash/before-tasks.sh @@ -29,10 +29,10 @@ bash bash/init-rake-tasks.sh # Aliases for git msg="Writing git aliases" -#log "$msg" && +log "$msg" && bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/emoji-log ~/.gitconfig && bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/git-aliases ~/.gitconfig -#log "try: git a or: git aliases for a list your git aliases.\n" +log "try: git a or: git aliases for a list your git aliases.\n" if [ $(bash bash/helpers.sh is_inited) == 1 ]; then bash bash/helpers.sh restore_persistant_files $GITPOD_REPO_ROOT From 9a019d19b1be26c5e7357fd18a137a33e26e4d55 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Sun, 7 Feb 2021 22:53:54 -0800 Subject: [PATCH 56/71] =?UTF-8?q?=F0=9F=91=8C=20IMPROVE:=20it=20all=20work?= =?UTF-8?q?s,=20commands=20that=20log=20to=20init=20log=20will=20write=20i?= =?UTF-8?q?n=20one-time?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/init-complete.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/bash/init-complete.sh b/bash/init-complete.sh index 2d20fe4f..b192b969 100644 --- a/bash/init-complete.sh +++ b/bash/init-complete.sh @@ -10,6 +10,7 @@ cat $workspace_log echo -en "\e[0m" echo '' echo -en "\e[38;5;194mResults of the gitpod initialization\e[0m \e[38;5;34m$init_log\e[0m ➥\e[38;5;39m" +echo '' cat $init_log echo -en "\e[0m" echo -en "\n\e[38;5;171mALL DONE 🚀\e[0m\n" From 1e88150d96a7b612d479142a3e2c5769746f5213 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Mon, 8 Feb 2021 01:01:36 -0800 Subject: [PATCH 57/71] =?UTF-8?q?=F0=9F=90=9B=20FIX:=20persistant=20to=20p?= =?UTF-8?q?ersistent?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/before-tasks.sh | 2 +- bash/helpers.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bash/before-tasks.sh b/bash/before-tasks.sh index 0e50bb19..52e5b4ee 100644 --- a/bash/before-tasks.sh +++ b/bash/before-tasks.sh @@ -35,5 +35,5 @@ bash bash/utils.sh add_file_to_file_after \\[alias\\] bash/snippets/git-aliases log "try: git a or: git aliases for a list your git aliases.\n" if [ $(bash bash/helpers.sh is_inited) == 1 ]; then - bash bash/helpers.sh restore_persistant_files $GITPOD_REPO_ROOT + bash bash/helpers.sh restore_persistent_files $GITPOD_REPO_ROOT fi \ No newline at end of file diff --git a/bash/helpers.sh b/bash/helpers.sh index 3ddad2f0..ea5dd195 100644 --- a/bash/helpers.sh +++ b/bash/helpers.sh @@ -114,8 +114,8 @@ persist_file() { # For some reason $GITPOD_REPO_ROOT is not avaialable when this is called (from before task) # So just pass it in from there as $1 -restore_persistant_files() { - local err="helpers.sh: restore_persistant_files: error:" +restore_persistent_files() { + local err="helpers.sh: restore_persistent_files: error:" # TODO make this dynamic local init_log_orig=/var/log/workspace-init.log local store="/workspace/$(basename $1)--store" From 3d1caeb9024c81e648359f614a3635a7ba9d9b17 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Mon, 8 Feb 2021 01:03:19 -0800 Subject: [PATCH 58/71] =?UTF-8?q?=F0=9F=90=9B=20FIX:=20linebreak?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/init-complete.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/bash/init-complete.sh b/bash/init-complete.sh index b192b969..143b2321 100644 --- a/bash/init-complete.sh +++ b/bash/init-complete.sh @@ -19,5 +19,6 @@ echo -e "\e[38;5;194mIf everything looks good in the above results then push the # Hack: Persist the workspace-init.log since the .gitpod.Dockerfile will wipe it out and it wont come back after the first run bash bash/helpers.sh persist_file /var/log/workspace-init.log + # Set initialized flag - Keep this at the bottom of the file bash bash/helpers.sh mark_as_inited \ No newline at end of file From 6025b55f350b7eecc81b8c95730cfb17f5797dcc Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Mon, 8 Feb 2021 01:18:17 -0800 Subject: [PATCH 59/71] =?UTF-8?q?=F0=9F=90=9B=20FIX:=20refactor=20gitpod?= =?UTF-8?q?=20init=20sequence?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitpod.yml | 8 +------- bash/init-gitpod.sh | 9 ++++++++- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index 42fbe303..d5b24a3c 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -14,14 +14,8 @@ ports: tasks: - before: bash bash/before-tasks.sh init: | - . bash/third-party/spinner.sh && - start_spinner "Initializing MySql..." && - gp await-port 3306 && - stop_spinner $? && bash bash/init-gitpod.sh && - source ~/.bash_profile && - url=$(gp url 8000); sed -i'' "s#^APP_URL=http://localhost*#APP_URL=$url\nASSET_URL=$url#g" .env && - bash bash/init-optional-scaffolding.sh && + bash /bash/init-optional-scaffolding && bash bash/init-complete.sh name: Init - openMode: split-left diff --git a/bash/init-gitpod.sh b/bash/init-gitpod.sh index aa2b93c5..5ec993d1 100644 --- a/bash/init-gitpod.sh +++ b/bash/init-gitpod.sh @@ -21,10 +21,15 @@ log_silent () { # Load spinner . bash/third-party/spinner.sh +# Let the user know there will a wait, then begin once MySql is initialized. +start_spinner "Initializing MySql..." && +gp await-port 3306 && +stop_spinner $? + # Bootstrap scaffolding if [ ! -d "$GITPOD_REPO_ROOT/bootstrap" ]; then - # Todo replacespinner with a real progress bar for coreutils msg="\nMoving Laravel project from ~/temp-app to $GITPOD_REPO_ROOT" + # TODO: replace spinner with a real progress bar for coreutils log_silent "$msg" && start_spinner "$msg" shopt -s dotglob mv --no-clobber ~/test-app/* $GITPOD_REPO_ROOT @@ -36,6 +41,8 @@ if [ ! -d "$GITPOD_REPO_ROOT/bootstrap" ]; then stop_spinner $err_code log "SUCCESS: moved Laravel project from ~/temp-app to $GITPOD_REPO_ROOT" fi + # configure Laravel to use gitpod urls + [ -e .env ] && url=$(gp url 8000); sed -i'' "s#^APP_URL=http://localhost*#APP_URL=$url\nASSET_URL=$url#g" .env # BEGIN: Optional configurations # Super user account for phpmyadmin installed_phpmyadmin=$(. bash/utils.sh parse_ini_value starter.ini phpmyadmin install) From f3f78166441d89fd9d9c1b61adc6945498e9c8a5 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Mon, 8 Feb 2021 01:21:03 -0800 Subject: [PATCH 60/71] =?UTF-8?q?=F0=9F=93=96=20DOC:=20comments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/init-complete.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bash/init-complete.sh b/bash/init-complete.sh index 143b2321..d5d57781 100644 --- a/bash/init-complete.sh +++ b/bash/init-complete.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Note: allways call thi file last in the initialization sequence +# Note: allways call this file last in the initialization sequence workspace_log='/var/log/workspace-image.log' init_log='/var/log/workspace-init.log' @@ -17,7 +17,7 @@ echo -en "\n\e[38;5;171mALL DONE 🚀\e[0m\n" echo -e "\e[38;5;194mIf everything looks good in the above results then push the newly created\n project files to your git repo and get started coding your project\e[0m" -# Hack: Persist the workspace-init.log since the .gitpod.Dockerfile will wipe it out and it wont come back after the first run +# Persist the workspace-init.log since the .gitpod.Dockerfile will wipe it out and it wont come back after the first run bash bash/helpers.sh persist_file /var/log/workspace-init.log # Set initialized flag - Keep this at the bottom of the file From e680439bb26b591b2193d5c98128d49b1878e8d1 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Mon, 8 Feb 2021 01:23:46 -0800 Subject: [PATCH 61/71] =?UTF-8?q?=F0=9F=90=9B=20FIX:=20typo=20in=20init=20?= =?UTF-8?q?command?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitpod.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitpod.yml b/.gitpod.yml index d5b24a3c..641b8c4f 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -15,7 +15,7 @@ tasks: - before: bash bash/before-tasks.sh init: | bash bash/init-gitpod.sh && - bash /bash/init-optional-scaffolding && + bash bash/init-optional-scaffolding && bash bash/init-complete.sh name: Init - openMode: split-left From 089f33ddecddc4cfa3c47e649c1dc908f120ef89 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Mon, 8 Feb 2021 01:25:04 -0800 Subject: [PATCH 62/71] =?UTF-8?q?=F0=9F=90=9B=20FIX:=20typo=20in=20init=20?= =?UTF-8?q?command?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitpod.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitpod.yml b/.gitpod.yml index 641b8c4f..63b6556d 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -15,7 +15,7 @@ tasks: - before: bash bash/before-tasks.sh init: | bash bash/init-gitpod.sh && - bash bash/init-optional-scaffolding && + bash bash/init-optional-scaffolding.sh && bash bash/init-complete.sh name: Init - openMode: split-left From 3403934b07b3ef01983b28128577e5f93244444f Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Mon, 8 Feb 2021 01:29:28 -0800 Subject: [PATCH 63/71] =?UTF-8?q?=F0=9F=90=9B=20FIX:=20fine=20tuning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitpod.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index 63b6556d..c5ea96b6 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -17,7 +17,7 @@ tasks: bash bash/init-gitpod.sh && bash bash/init-optional-scaffolding.sh && bash bash/init-complete.sh - name: Init + name: Startup - openMode: split-left command: | UP=$(pgrep mysql | wc -l); if [ "$UP" -ne 1 ]; then . bash/third-party/spinner.sh && start_spinner "Initializing MySql..." && gp await-port 3306 && stop_spinner $?; fi @@ -25,7 +25,7 @@ tasks: sleep 1 && bash -i bash/helpers.sh start_server name: Web Server - - openMode: split-left + - openMode: split-top command: | default_server=$(bash bash/utils.sh parse_ini_value starter.ini development default_server); open_preview $default_server name: Main Terminal From 903a861b4748e66a179f58de8a47c985f2ad7b81 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Mon, 8 Feb 2021 01:39:00 -0800 Subject: [PATCH 64/71] =?UTF-8?q?=F0=9F=90=9B=20FIX:=20mtail=5Fapache=20fu?= =?UTF-8?q?nction?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/snippets/server-functions | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bash/snippets/server-functions b/bash/snippets/server-functions index aeeb9279..5931dc21 100644 --- a/bash/snippets/server-functions +++ b/bash/snippets/server-functions @@ -1,7 +1,11 @@ +mtail_apache () { + multitail /var/log/apache2/access.log -I /var/log/apache2/error.log; +} + start_apache() { apachectl start (( $? == 0 )) || return - multitail /var/log/apache2/access.log -I /var/log/apache2/error.log; + mtail_apache } stop_apache() { From f61e6b6f6b6766fe39bbf24cb7753ac1cdf0ebe8 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Mon, 8 Feb 2021 01:41:38 -0800 Subject: [PATCH 65/71] =?UTF-8?q?=F0=9F=A4=96=20TEST:=20force=20workspace?= =?UTF-8?q?=20image=20build?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitpod.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index d67d30b9..9e9c2219 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -29,7 +29,7 @@ RUN sudo bash -c ". /tmp/update-composer.sh" && rm /tmp/update-composer.sh # gitpod trick to bypass the docker caching mechanism for all lines below this one # just increment the value each time you want to bypass the cache system -ENV INVALIDATE_CACHE=120 +ENV INVALIDATE_CACHE=121 COPY --chown=gitpod:gitpod bash/utils.sh /tmp COPY --chown=gitpod:gitpod starter.ini /tmp From ffd047515a607e9ee5a703399f0406a2f8b3b9e2 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Mon, 8 Feb 2021 01:53:19 -0800 Subject: [PATCH 66/71] =?UTF-8?q?=F0=9F=90=9B=20FIX:=20improve=20readabili?= =?UTF-8?q?ty?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitpod.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.gitpod.yml b/.gitpod.yml index c5ea96b6..e41d2b27 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -20,7 +20,13 @@ tasks: name: Startup - openMode: split-left command: | - UP=$(pgrep mysql | wc -l); if [ "$UP" -ne 1 ]; then . bash/third-party/spinner.sh && start_spinner "Initializing MySql..." && gp await-port 3306 && stop_spinner $?; fi + UP=$(pgrep mysql | wc -l); \ + if [ "$UP" -ne 1 ]; then \ + . bash/third-party/spinner.sh && + start_spinner "Initializing MySql..." && + gp await-port 3306 && + stop_spinner $?; \ + fi \ gp await-port 3306 && sleep 1 && bash -i bash/helpers.sh start_server From 48505f8f1eb07836c8bab98e161d60b6fce6c65b Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Mon, 8 Feb 2021 01:55:02 -0800 Subject: [PATCH 67/71] =?UTF-8?q?=F0=9F=90=9B=20FIX:=20improve=20readabili?= =?UTF-8?q?ty?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitpod.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitpod.yml b/.gitpod.yml index e41d2b27..eab365b8 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -26,7 +26,7 @@ tasks: start_spinner "Initializing MySql..." && gp await-port 3306 && stop_spinner $?; \ - fi \ + fi && gp await-port 3306 && sleep 1 && bash -i bash/helpers.sh start_server From 459da2d15dd969314c1933ae07d1cfba5f8bc280 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Mon, 8 Feb 2021 02:16:28 -0800 Subject: [PATCH 68/71] =?UTF-8?q?=F0=9F=91=8C=20IMPROVE:=20Pretty=20result?= =?UTF-8?q?s=20of=20initialization=20https://github.com/apolopena/gitpod-l?= =?UTF-8?q?aravel8-starter/issues/32?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/helpers.sh | 22 ++++++++++++++++++++++ bash/init-complete.sh | 17 +++-------------- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/bash/helpers.sh b/bash/helpers.sh index ea5dd195..70b111a0 100644 --- a/bash/helpers.sh +++ b/bash/helpers.sh @@ -98,6 +98,28 @@ add_global_rake_task() { echo -e "$1" > "$root/$file" } +# show_first_run_logs +# Description: +# Outputs a summarized and colorized dump of /var/log/workspace-image.log +# and /var/log/workspace-init.log +# +# Usage: +# show_first_run_summary +show_first_run_summary() { + workspace_log='/var/log/workspace-image.log' + init_log='/var/log/workspace-init.log' + echo -e "\n\e[38;5;171mSUMMARY 📃\e[0m\n" + echo -en "\e[38;5;194mResults of building the workspace image\e[0m \e[38;5;34m$workspace_log\e[0m ➥\n\e[38;5;183m" + cat $workspace_log + echo -en "\e[0m" + echo '' + echo -en "\e[38;5;194mResults of the gitpod initialization\e[0m \e[38;5;34m$init_log\e[0m ➥\e[38;5;39m" + echo '' + cat $init_log + echo -en "\e[0m" + echo -en "\n\e[38;5;171mALL DONE 🚀\e[0m\n" +} + # Begin: persistance hacks get_store_root() { echo "/workspace/$(basename $GITPOD_REPO_ROOT)--store" diff --git a/bash/init-complete.sh b/bash/init-complete.sh index d5d57781..0811670a 100644 --- a/bash/init-complete.sh +++ b/bash/init-complete.sh @@ -1,22 +1,11 @@ #!/bin/bash -# Note: allways call this file last in the initialization sequence +# Note: always call this file last from the init command in .gitpod.yml -workspace_log='/var/log/workspace-image.log' -init_log='/var/log/workspace-init.log' -echo -e "\n\e[38;5;171mSUMMARY 📃\e[0m\n" -echo -en "\e[38;5;194mResults of building the workspace image\e[0m \e[38;5;34m$workspace_log\e[0m ➥\n\e[38;5;183m" -cat $workspace_log -echo -en "\e[0m" -echo '' -echo -en "\e[38;5;194mResults of the gitpod initialization\e[0m \e[38;5;34m$init_log\e[0m ➥\e[38;5;39m" -echo '' -cat $init_log -echo -en "\e[0m" -echo -en "\n\e[38;5;171mALL DONE 🚀\e[0m\n" +# Summazrize the results of the first run. +show_first_run_summary echo -e "\e[38;5;194mIf everything looks good in the above results then push the newly created\n project files to your git repo and get started coding your project\e[0m" - # Persist the workspace-init.log since the .gitpod.Dockerfile will wipe it out and it wont come back after the first run bash bash/helpers.sh persist_file /var/log/workspace-init.log From 994237632d6cb85986f70a276f9c155a85f33e6a Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Mon, 8 Feb 2021 02:18:34 -0800 Subject: [PATCH 69/71] =?UTF-8?q?=F0=9F=91=8C=20IMPROVE:=20Pretty=20result?= =?UTF-8?q?s=20of=20initialization=20https://github.com/apolopena/gitpod-l?= =?UTF-8?q?aravel8-starter/issues/32?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/init-complete.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bash/init-complete.sh b/bash/init-complete.sh index 0811670a..2902a3ad 100644 --- a/bash/init-complete.sh +++ b/bash/init-complete.sh @@ -2,8 +2,8 @@ # Note: always call this file last from the init command in .gitpod.yml -# Summazrize the results of the first run. -show_first_run_summary +# Summazrize results +bash bash/helpers.sh show_first_run_summary echo -e "\e[38;5;194mIf everything looks good in the above results then push the newly created\n project files to your git repo and get started coding your project\e[0m" # Persist the workspace-init.log since the .gitpod.Dockerfile will wipe it out and it wont come back after the first run From d85d090101b9cb9bfd29971ae7331e5028b27791 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Mon, 8 Feb 2021 02:23:14 -0800 Subject: [PATCH 70/71] =?UTF-8?q?=F0=9F=93=96=20DOC:=20formatting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/helpers.sh | 2 +- bash/init-complete.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bash/helpers.sh b/bash/helpers.sh index 70b111a0..0b52b3c0 100644 --- a/bash/helpers.sh +++ b/bash/helpers.sh @@ -108,7 +108,7 @@ add_global_rake_task() { show_first_run_summary() { workspace_log='/var/log/workspace-image.log' init_log='/var/log/workspace-init.log' - echo -e "\n\e[38;5;171mSUMMARY 📃\e[0m\n" + echo -e "\n\e[38;5;171mSUMMARY 👀\e[0m\n" echo -en "\e[38;5;194mResults of building the workspace image\e[0m \e[38;5;34m$workspace_log\e[0m ➥\n\e[38;5;183m" cat $workspace_log echo -en "\e[0m" diff --git a/bash/init-complete.sh b/bash/init-complete.sh index 2902a3ad..27cdd59e 100644 --- a/bash/init-complete.sh +++ b/bash/init-complete.sh @@ -2,7 +2,7 @@ # Note: always call this file last from the init command in .gitpod.yml -# Summazrize results +# Summarize results bash bash/helpers.sh show_first_run_summary echo -e "\e[38;5;194mIf everything looks good in the above results then push the newly created\n project files to your git repo and get started coding your project\e[0m" From 54a970afb3e83785473b969c28f51b45d25af0d4 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Mon, 8 Feb 2021 02:32:09 -0800 Subject: [PATCH 71/71] =?UTF-8?q?=F0=9F=93=96=20DOC:=20log=20writing=20rak?= =?UTF-8?q?e=20tasks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/before-tasks.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash/before-tasks.sh b/bash/before-tasks.sh index 52e5b4ee..ea0d6876 100644 --- a/bash/before-tasks.sh +++ b/bash/before-tasks.sh @@ -24,7 +24,7 @@ log_silent () { # Rake tasks (will be written to ~/.rake). # Some rake tasks are dynamic and depend on the configuration in starter.ini msg="Writing rake tasks" -#log "$msg" && +log "$msg" && bash bash/init-rake-tasks.sh # Aliases for git