Skip to content

Commit

Permalink
💡 UPDATE COMMENTS: #82, Add MIT license, unify headers in code files
Browse files Browse the repository at this point in the history
  • Loading branch information
apolopena committed Mar 30, 2021
1 parent 733ca4d commit 2041896
Show file tree
Hide file tree
Showing 16 changed files with 118 additions and 83 deletions.
12 changes: 10 additions & 2 deletions bash/before-tasks.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
#!/bin/bash

#
# SPDX-License-Identifier: MIT
# Copyright © 2021 Apolo Pena
#
# before-tasks.sh
# Description:
# Tasks that should be run everytime the worspace is created or started.
#
# Notes:
# 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
# in everytime the workspace starts. We do this in the 'before' task in .gitpod.yml

# Load logger
. workspace-init-log.sh
Expand Down
15 changes: 9 additions & 6 deletions bash/change-passwords.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
#!/bin/bash
#
# change-passwords.sh
# SPDX-License-Identifier: MIT
# Copyright © 2021 Apolo Pena
#
# change-passwords.sh
# Description:
# changes passwords for phpmyadmin from the defaults in version control to the values set in .starter.env
# Author: Apolo Pena
# Changes passwords for phpmyadmin from the defaults in version control to the values set in .starter.env
#
# NOTE:
# Notes:
# This script should be always run at least once by the user as an mandatory additional layer of security
# This script requires the file .starter.env to exist along will all the key value pairs as set
# in example.starter.ini
# This script requires the file .starter.env to exist along will all the key value pairs set.
#
# See:
# example.starter.ini

# Load spinner
. bash/third-party/spinner.sh
Expand Down
20 changes: 12 additions & 8 deletions bash/helpers.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
#!/bin/bash

#
# SPDX-License-Identifier: MIT
# Copyright © 2021 Apolo Pena
#
# helpers.sh
# Author: Apolo Pena
# Description: A variety of useful functions with that depend on gitpod
# and other binaries, aliases and functions such as code in .bashrc
# other than coreutils.
# Note: Do not execute this script witout calling a function from it
# Description:
# A variety of useful functions that depend on Gitpod and other
# binaries, aliases and functions such as code in .bashrc
#
# Notes:
# Do not execute this script without calling a function from it
# Additional Note: some functions use functions from .bashrc so the -i flag
# is the safest way to invoke functions from this script.
# Do not execute this script without calling a function from it.
#
# Usage: bash -i <function name> arg1 arg2 arg3 ...
#

version () {
echo "helpers.sh version 0.0.6"
echo "helpers.sh version 0.0.7"
}

# start_server
Expand Down
12 changes: 10 additions & 2 deletions bash/init-complete.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
#!/bin/bash

# Note: always call this file last from the init command in .gitpod.yml
#
# SPDX-License-Identifier: MIT
# Copyright © 2021 Apolo Pena
#
# init-complete.sh
# Description:
# Tasks to be run everytime a gitpod workspace is created or started.
#
# Notes:
# Always call this file last from the 'init' command in .gitpod.yml

# Summarize results
bash bash/helpers.sh show_first_run_summary
Expand Down
7 changes: 7 additions & 0 deletions bash/init-gitpod.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!/bin/bash
#
# SPDX-License-Identifier: MIT
# Copyright © 2021 Apolo Pena
#
# init-gitpod.sh
# Description:
# Tasks to be run when a gitpod workspace is created for the first time.

# Load logger
. workspace-init-log.sh
Expand Down
9 changes: 6 additions & 3 deletions bash/init-optional-scaffolding.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#!/bin/bash

# init-optional-scaffoliding.sh
#
# SPDX-License-Identifier: MIT
# Copyright © 2021 Apolo Pena
#
# init-optional-scaffolding.sh
# Description:
# Installs various packages according to the configuration set in starter.ini
# Installs various packages and scaffolding according to the directive set in starter.ini

# Load logger
. workspace-init-log.sh
Expand Down
28 changes: 8 additions & 20 deletions bash/init-phpmyadmin.sh
Original file line number Diff line number Diff line change
@@ -1,26 +1,14 @@
#!/bin/bash

# init-phpmyadmin.sh
#
# SPDX-License-Identifier: MIT
# Copyright © 2021 Apolo Pena
#
# init-gitpod.sh
# Description:
# Initial configuration for an existing phpmyadmin installation

# 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
}
# Configures an existing phpmyadmin installation.

# 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
}
# Load logger
. workspace-init-log.sh

# regexp pattern for checking an array of exit codes
all_zeros_reg='^0$|^0*0$'
Expand Down
10 changes: 9 additions & 1 deletion bash/init-project.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
#!/bin/bash
#
# SPDX-License-Identifier: MIT
# Copyright © 2021 Apolo Pena
#
# init-gitpod.sh
# Description:
# Initial configuration for an existing phpmyadmin installation.


# Load logger
. workspace-init-log.sh
. workspace-init-logger.sh

# BEGIN example code block - migrate database
# COMMENT: Load spinner
Expand Down
7 changes: 7 additions & 0 deletions bash/init-rake-tasks.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!/bin/bash
#
# SPDX-License-Identifier: MIT
# Copyright © 2021 Apolo Pena
#
# init-rake-tasks.sh
# Description:
# Creates rake tasks dynamically.

parse="bash bash/utils.sh parse_ini_value starter.ini"

Expand Down
7 changes: 7 additions & 0 deletions bash/init-react-example.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!/bin/bash
#
# SPDX-License-Identifier: MIT
# Copyright © 2021 Apolo Pena
#
# init-react-example.sh
# Description:
# Initial setup for the gitpod-laravel8-starter react example.

# Load logger
. workspace-init-log.sh
Expand Down
13 changes: 8 additions & 5 deletions bash/scaffold-project.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
#!/bin/bash
#
# scaffold-project.sh
# SPDX-License-Identifier: MIT
# Copyright © 2021 Apolo Pena
#
# Description:Creates all project files in /tmp
# Author: Apolo Pena
# scaffold-project.sh
# Description:
# Creates the main Laravel 8 project scaffolding.
#
# NOTE: This script assumes it is being run from .gitpod.Dockerfile
# and all of this scripts dependencies have already been copied to /tmp
# Notes:
# This script assumes it is being run from .gitpod.Dockerfile and
# that all of this scripts dependencies have already been copied to /tmp

LOG='/var/log/workspace-image.log'
SCAFF_NAME='laravel8-starter'
Expand Down
4 changes: 4 additions & 0 deletions bash/snippets/license/MIT-header
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#
# SPDX-License-Identifier: MIT
# Copyright © 2021 Apolo Pena
#
7 changes: 7 additions & 0 deletions bash/update-composer.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!/bin/bash
#
# SPDX-License-Identifier: MIT
# Copyright © 2021 Apolo Pena
#
# update-composer.sh
# Description:
# Programatically updates composer to the latest version.

LOG='/var/log/workspace-image.log'
# BEGIN: update composer to the latest version
Expand Down
17 changes: 10 additions & 7 deletions bash/utils.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
#!/bin/bash

#
# SPDX-License-Identifier: MIT
# Copyright © 2021 Apolo Pena
#
# utils.sh
# Author: Apolo Pena
# Description: A variety of useful functions with no dependecies.
# Note: Do not execute this script witout calling a function from it
# Description:
# A variety of useful functions with no dependecies.
#
# Usage: bash <function name> arg1 arg2 arg3 ...
# Notes:
# Do not execute this script without calling a function from it.
#

# Usage: bash <function name> arg1 arg2 arg3 ...

version () {
echo "utils.sh version 0.0.8"
echo "utils.sh version 0.0.9"
}

# Use absolute paths or paths relative to this script
Expand Down
5 changes: 4 additions & 1 deletion bash/workspace-init-log.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

#
# SPDX-License-Identifier: MIT
# Copyright © 2021 Apolo Pena
#
# workspace-init-logger.sh
# Description:
# Log wrapper for logging to workspace-init.log
Expand Down
28 changes: 0 additions & 28 deletions bash/workspace-init-logger.sh

This file was deleted.

0 comments on commit 2041896

Please sign in to comment.