-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move from docker-based to standalone Jurassic Tube setup #9839
Conversation
bin/jurassic-tube-setup.sh
Outdated
# Download the installer only if it's not already present | ||
if [ ! -f "$JT_DIR/installer.sh" ]; then | ||
echo "Downloading the standalone installer..." | ||
curl "https://jurassic.tube/installer-standalone.sh" -o "$JT_DIR/installer.sh" && chmod +x "$JT_DIR/installer.sh" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We no longer need to provide the environment value, freeing us from coupling it to the product and avoiding the addition of new environments to JT with each new product.
Test the buildOption 1. Jetpack Beta
Option 2. Jurassic Ninja - available for logged-in A12s🚀 Launch a JN site with this branch 🚀 ℹ️ Install this Tampermonkey script to get more options. Build info:
Note: the build is updated when a new commit is pushed to this PR. |
Size Change: 0 B Total Size: 1.34 MB ℹ️ View Unchanged
|
package.json
Outdated
@@ -69,8 +69,8 @@ | |||
"format:css": "npm run format:provided '**/*.scss' '**/*.css'", | |||
"format:provided": "prettier --write", | |||
"tube:setup": "./bin/jurassic-tube-setup.sh", | |||
"tube:start": "./docker/bin/jt/tunnel.sh", | |||
"tube:stop": "./docker/bin/jt/tunnel.sh break", | |||
"tube:start": "source ./bin/jurassictube/config.env && jurassictube -u \"$username\" -s \"$subdomain\" -h localhost:8082", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hardcoded the port for now because getting it from docker-compose.yml
was not readable enough to include it in the setup script, but I'm happy to hear other thoughts.
if [ ! -f "${JT_DIR}/config.env" ]; then | ||
touch "${JT_DIR}/config.env" | ||
else | ||
> "${JT_DIR}/config.env" | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
creating the config.env
file first to store the props needed to start JT
bin/jurassic-tube-setup.sh
Outdated
# Find the WordPress container section and get its port | ||
CLIENT_WORDPRESS_CONTAINER_SECTION=$(grep -A 20 "container_name: woocommerce_payments_wordpress" ${PWD}/docker-compose.yml) | ||
PORTS_LINE=$(echo "${CLIENT_WORDPRESS_CONTAINER_SECTION}" | grep "ports:" -A 1 | grep "\-") | ||
PORT=$(echo "${PORTS_LINE}" | grep -o '"[0-9]\+:' | cut -d'"' -f2 | cut -d: -f1) | ||
|
||
# Use default if extraction failed | ||
if [ -z "$PORT" ]; then | ||
PORT=8082 # Default fallback | ||
echo "Could not extract WordPress container port, using default: ${PORT}" | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting the localhost port and falling back to 8082 if an attempt to retrieve it was unsuccessful
"tube:start": "source ./bin/jurassictube/config.env && jurassictube -u \"$username\" -s \"$subdomain\" -h \"$localhost\"", | ||
"tube:stop": "source ./bin/jurassictube/config.env && jurassictube -b -s \"$subdomain\"", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following the docs on how to use the tool PCYsg-GJ2-p2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@timur27 Reviewed the code & left a comment
bin/jurassic-tube-setup.sh
Outdated
CLIENT_WORDPRESS_CONTAINER_SECTION=$(grep -A 20 "container_name: woocommerce_payments_wordpress" ${PWD}/docker-compose.yml) | ||
PORTS_LINE=$(echo "${CLIENT_WORDPRESS_CONTAINER_SECTION}" | grep "ports:" -A 1 | grep "\-") | ||
PORT=$(echo "${PORTS_LINE}" | grep -o '"[0-9]\+:' | cut -d'"' -f2 | cut -d: -f1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@timur27 I believe you're trying to extract the wordpress
container port from docker-compose.yml
. Instead of fetching it from the file, we can use something like this - $(docker ps | grep transact_gateway_wordpress | sed -En "s/.*0:([0-9]+).*/\1/p")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@timur27 Tested the changes and works as expected. Thanks for working on this.
I have left a minor comment though and approved the PR :D
Related to https://github.com/Automattic/transact-gateway/pull/460
Changes proposed in this Pull Request
This PR switched from Docker-based JT setup to the standalone version of it. More details in paJDYF-fSK-p2
Testing instructions
npm run tube:setup
should run w/o errors, together with usingnpm run tube:start
andnpm run tube:stop
/jurassictube
directory should be created under/bin
directory, and should be ignored by gitconfig.env
file does not have duplicated keys but instead, contains only rows relevant to the most recent setupnpm run changelog
to add a changelog file, choosepatch
to leave it empty if the change is not significant. You can add multiple changelog files in one PR by running this command a few times.Post merge