-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #165 from localgovdrupal/3.x
3.0.2 release
- Loading branch information
Showing
30 changed files
with
245 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
## Description: Run programs in container, based on current host directory | ||
## Usage: exec_d [args] | ||
## Example: "ddev exec_d yarn" | ||
|
||
if [ -z "$1" ]; then | ||
echo "No argument supplied" | ||
exit 1 | ||
fi | ||
|
||
ddev exec -d /var/www/html/"$(echo "$PWD" | cut -d'/' -f4-)" "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ | |
## Usage: phix | ||
## Example: "ddev phix" | ||
|
||
/var/www/html/bin/phpcbf $* | ||
/var/www/html/vendor/bin/phpcbf $* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ | |
## Usage: phpcs | ||
## Example: "ddev phpcs" | ||
|
||
/var/www/html/bin/phpcs -p $* | ||
/var/www/html/vendor/bin/phpcs -p $* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ | |
## Usage: phpix | ||
## Example: "ddev phix" | ||
|
||
/var/www/html/bin/phpstan $* | ||
/var/www/html/vendor/bin/phpstan $* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ | |
## Usage: phpunit | ||
## Example: "ddev phpunit" | ||
|
||
/var/www/html/bin/phpunit $* | ||
/var/www/html/vendor/bin/phpunit $* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name: localgov | ||
type: drupal9 | ||
type: drupal10 | ||
docroot: web | ||
php_version: "8.1" | ||
webserver_type: nginx-fpm | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Setting up a new version for DrupalPod | ||
|
||
## Build custom Gitpod image | ||
|
||
1. Update `.gitpod/images/Dockerfile`: | ||
|
||
1. Update `ddev` latest version. | ||
1. Update `minio` latest version. | ||
1. Update `gitui` latest version. | ||
1. Update `lazygit` latest version. | ||
|
||
1. Generate new custom docker image: | ||
|
||
1. Run `docker login` to authenticate and push new images to docker hub. | ||
1. In `/.gitpod/images` run `./push.sh` command to build and push the new custom docker image. | ||
1. Confirm the process run without errors and that the new custom image gets uploaded to <https://hub.docker.com/r/drupalpod/drupalpod-gitpod-base/tags>. | ||
1. Update `/.gitpod.yml` with the new image file. | ||
|
||
1. Push code, and re-open Gitpod workspace, to use latest custom docker image. | ||
|
||
1. Run manual prebuild (to load ddev's images) | ||
|
||
1. Confirm latest setup | ||
1. Open new workspace. | ||
1. Check if there are any updates (ie. DDEV's default settings files). | ||
|
||
1. Test various scenarios with DrupalPod browser extension | ||
1. Confirm core issues work as expected. | ||
1. Confirm contrib issue work as expected. | ||
|
||
1. Merge PR into `main` branch | ||
|
||
1. Confirm `main` branch work as expected 🎉 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
if [ -n "$DEBUG_SCRIPT" ] || [ -n "$GITPOD_HEADLESS" ]; then | ||
set -x | ||
fi | ||
|
||
# Misc housekeeping before start | ||
ddev config global --instrumentation-opt-in=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env bash | ||
if [ -n "$DEBUG_SCRIPT" ]; then | ||
set -x | ||
fi | ||
|
||
cd "${GITPOD_REPO_ROOT}"/.gitpod/utils/script-templates || exit | ||
|
||
# Create a phpstorm command | ||
sudo cp phpstorm.template.sh /usr/local/bin/phpstorm | ||
|
||
# Create a preview command | ||
sudo cp preview.template.sh /usr/local/bin/preview | ||
|
||
# Create a protect-my-git command | ||
sudo cp protect-my-git.template.sh /usr/local/bin/protect-my-git | ||
|
||
# Create php command (run php inside ddev container) | ||
sudo cp ddev-php.template.sh /usr/local/bin/php | ||
|
||
# Create drush command (run drush inside ddev container) | ||
sudo cp ddev-drush.template.sh /usr/local/bin/drush | ||
|
||
# Create yarn command (run yarn inside ddev container) | ||
sudo cp ddev-yarn.template.sh /usr/local/bin/yarn | ||
|
||
# Create composer command (run composer inside ddev container) | ||
sudo cp ddev-composer.template.sh /usr/local/bin/composer | ||
|
||
# Create node command (run composer inside ddev container) | ||
sudo cp ddev-node.template.sh /usr/local/bin/node | ||
|
||
# Create nvm command (run composer inside ddev container) | ||
sudo cp ddev-nvm.template.sh /usr/local/bin/nvm | ||
|
||
# Create npx command (run composer inside ddev container) | ||
sudo cp ddev-npx.template.sh /usr/local/bin/npx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
echo "Notice: running 'composer $*' in ddev" | ||
ddev exec_d composer "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
echo "Notice: running 'drush $*' in ddev" | ||
ddev exec_d drush "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
echo "Notice: running 'node $*' in ddev" | ||
ddev exec_d node "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
echo "Notice: running 'npx $*' in ddev" | ||
ddev exec_d npx "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
echo "Notice: running 'nvm $*' in ddev" | ||
ddev exec_d nvm "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
echo "Notice: running 'php $*' in ddev" | ||
ddev exec_d php "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
echo "Notice: running 'yarn $*' in ddev" | ||
ddev exec_d yarn "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bash | ||
if [ -n "$DEBUG_SCRIPT" ]; then | ||
set -x | ||
fi | ||
|
||
if [ ! -x ~/.projector/configs/PhpStorm/run.sh ]; then | ||
echo "PhpStorm runner not found" && exit 1 | ||
fi | ||
|
||
# When port 9999 is ready - open that port in a new browser tab | ||
gp await-port 9999 && gp preview "$(gp url 9999)" --external & | ||
|
||
# Run PHPStorm | ||
~/.projector/configs/PhpStorm/run.sh "$GITPOD_REPO_ROOT" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
if [ -n "$DEBUG_SCRIPT" ]; then | ||
set -x | ||
fi | ||
|
||
# Preview port 8080 | ||
gp preview "$(gp url 8080)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
if [ -n "$DEBUG_SCRIPT" ]; then | ||
set -x | ||
fi | ||
|
||
# Remove access to user's Git credentials (restore by restart workspace) | ||
git config --global --unset credential.helper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Get current user and current branch | ||
branch_user="$GITPOD_GIT_USER_NAME, $(git branch --show-current)" | ||
|
||
# Load env vars during prebuild using `gp env` command | ||
if [ -z "$IFTTT_TOKEN" ]; then | ||
eval "$(gp env -e | grep IFTTT_TOKEN)" | ||
fi | ||
|
||
# Load env vars during prebuild using `gp env` command | ||
if [ -z "$DP_GOOGLE_ACCESS_KEY" ]; then | ||
eval "$(gp env -e | grep DP_GOOGLE_ACCESS_KEY)" | ||
fi | ||
|
||
# Load env vars during prebuild using `gp env` command | ||
if [ -z "$DP_GOOGLE_SECRET" ]; then | ||
eval "$(gp env -e | grep DP_GOOGLE_SECRET)" | ||
fi | ||
|
||
# Establish connection with Google Cloud through Minio client | ||
mc config host add gcs https://storage.googleapis.com "$DP_GOOGLE_ACCESS_KEY" "$DP_GOOGLE_SECRET" | ||
|
||
# If there's a problem send the error code | ||
if mc find gcs/drupalpod/ready-made-envs.tar.gz; then | ||
message="Success: Google Cloud is ready" | ||
else | ||
message="Error: Envs file wasn't found, it will be recreated" | ||
fi | ||
|
||
# Send a message through IFTTT | ||
curl -X POST -H "Content-Type: application/json" -d "{\"value1\":\"$branch_user\",\"value2\":\"$message\"}" https://maker.ifttt.com/trigger/drupalpod_prebuild_initiated/with/key/"$IFTTT_TOKEN" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Get current user and current branch | ||
branch_user="$GITPOD_GIT_USER_NAME, $(git branch --show-current)" | ||
|
||
# Load env vars during prebuild using `gp env` command | ||
if [ -z "$DP_READY_MADE_ENVS_URL" ]; then | ||
eval "$(gp env -e | grep DP_READY_MADE_ENVS_URL)" | ||
fi | ||
|
||
# Load env vars during prebuild using `gp env` command | ||
if [ -z "$IFTTT_TOKEN" ]; then | ||
eval "$(gp env -e | grep IFTTT_TOKEN)" | ||
fi | ||
|
||
# Check the status of ready-made envs file | ||
# https://stackoverflow.com/a/53358157/5754049 | ||
url_status=$(wget --server-response --spider --quiet "${DP_READY_MADE_ENVS_URL}" 2>&1 | awk 'NR==1{print $2}') | ||
|
||
# If there's a problem send the error code | ||
if [ "$url_status" = '200' ]; then | ||
message="100%" | ||
else | ||
message="Error: $url_status - $DP_READY_MADE_ENVS_URL" | ||
fi | ||
|
||
# Send a message through IFTTT | ||
curl -X POST -H "Content-Type: application/json" -d "{\"value1\":\"$branch_user\",\"value2\":\"$message\"}" https://maker.ifttt.com/trigger/drupalpod_prebuild_initiated/with/key/"$IFTTT_TOKEN" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env bash | ||
if [ -n "$DEBUG_SCRIPT" ]; then | ||
set -x | ||
fi | ||
|
||
# Load default envs | ||
# export "$(grep -v '^#' "$GITPOD_REPO_ROOT"/.env | xargs -d '\n')" | ||
|
||
# Clone Drupal core repo | ||
mkdir -p "${GITPOD_REPO_ROOT}"/repos | ||
cd "${GITPOD_REPO_ROOT}"/repos && time git clone https://git.drupalcode.org/project/drupal.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
vendor/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.