Skip to content

Commit

Permalink
Jetpack Docker: More flexible implementation (#20016)
Browse files Browse the repository at this point in the history
Co-authored-by: Brad Jorsch <[email protected]>
Co-authored-by: Brandon Kraft <[email protected]>
  • Loading branch information
3 people authored Jun 18, 2021
1 parent b1c8b8e commit 2f15492
Show file tree
Hide file tree
Showing 10 changed files with 663 additions and 288 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ phpcs.xml
.phpunit.result.cache

## Things for docker-composer
/tools/docker/data/mysql/*
!/tools/docker/data/mysql/.gitkeep
/tools/docker/data/*
!/tools/docker/data/.gitkeep
!/tools/docker/data/ssh.keys/
/tools/docker/logs/*
!/tools/docker/logs/.gitkeep
# Custom environment for docker containers
Expand Down
53 changes: 26 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,33 +34,32 @@
"cli-unlink": "jetpack cli unlink",
"distclean": "printf '\\e[30;43m`pnpm run distclean` is deprecated.\\e[0m\\n'; rm -rf node_modules vendor && cd projects/plugins/jetpack && pnpm run distclean",
"distclean-jetpack": "printf '\\e[30;43m`pnpm run distclean-jetpack` is deprecated.\\e[0m\\n'; cd projects/plugins/jetpack && pnpm run distclean",
"docker:build": "docker run -it --rm -v \"${PWD}:/usr/src/app\" -w /usr/src/app \"node:$(cat .nvmrc)\" bash -c 'pnpm install && jetpack build packages && jetpack build plugins/jetpack'",
"docker:build-image": "docker build -t automattic/jetpack-wordpress-dev tools/docker",
"docker:clean": "pnpm run docker:compose -- down --rmi all -v && rm -rf tools/docker/wordpress/* tools/docker/wordpress/.htaccess tools/docker/wordpress-develop/* tools/docker/logs/* tools/docker/data/mysql/*",
"docker:compose": "pnpm run docker:env && pnpm run docker:compose-volumes && pnpm run docker:compose-extras && docker-compose -f tools/docker/docker-compose.yml -f tools/docker/compose-volumes.built.yml -f tools/docker/compose-extras.yml",
"docker:compose-extras": "[ -f tools/docker/compose-extras.yml ] || cp tools/docker/compose-extras.yml.sample tools/docker/compose-extras.yml",
"docker:compose-volumes": "[ -f tools/docker/compose-volumes.yml ] || cp tools/docker/compose-volumes.yml.sample tools/docker/compose-volumes.yml; bash ./tools/compose-volumes.sh tools/docker/compose-volumes.yml > tools/docker/compose-volumes.built.yml",
"docker:db": "pnpm run docker:compose -- exec wordpress bash -c \"mysql --defaults-group-suffix=docker\"",
"docker:down": "pnpm run docker:compose -- down",
"docker:env": "node -e \"require('fs').createWriteStream( 'tools/docker/.env', { flags: 'a' } );\"",
"docker:install": "pnpm run docker:compose -- exec wordpress bash -c \"/var/scripts/install.sh\"",
"docker:jt-config": "[ -f ./tools/docker/bin/jt/config.sh ] || { echo 'Tunneling scripts are not installed. See the section \"Jurassic Tube Tunneling Service\" in tools/docker/README.md.'; exit; }; ./tools/docker/bin/jt/config.sh",
"docker:jt-down": "[ -f ./tools/docker/bin/jt/tunnel.sh ] || { echo 'Tunneling scripts are not installed. See the section \"Jurassic Tube Tunneling Service\" in tools/docker/README.md.'; exit; }; ./tools/docker/bin/jt/tunnel.sh break",
"docker:jt-up": "[ -f ./tools/docker/bin/jt/tunnel.sh ] || { echo 'Tunneling scripts are not installed. See the section \"Jurassic Tube Tunneling Service\" in tools/docker/README.md.'; exit; }; ./tools/docker/bin/jt/tunnel.sh",
"docker:multisite-convert": "pnpm run docker:compose -- exec wordpress bash -c \"/var/scripts/multisite-convert.sh\"",
"docker:ngrok": "pnpm run docker:compose -- -f tools/docker/docker-compose-ngrok.yml",
"docker:ngrok-down": "pnpm run docker:ngrok -- down",
"docker:ngrok-up": "pnpm run docker:ngrok -- up",
"docker:phpunit": "pnpm run docker:compose -- exec wordpress phpunit --configuration=/var/www/html/wp-content/plugins/jetpack/phpunit.xml.dist",
"docker:phpunit:multisite": "pnpm run docker:compose -- exec wordpress phpunit --configuration=/var/www/html/wp-content/plugins/jetpack/tests/php.multisite.xml",
"docker:run-extras": "pnpm run docker:compose -- exec wordpress bash -c \"chmod +x /var/scripts/run-extras.sh && . /var/scripts/run-extras.sh\"",
"docker:sh": "pnpm run docker:compose -- exec wordpress bash",
"docker:stop": "pnpm run docker:compose -- stop",
"docker:tail": "pnpm run docker:compose -- exec wordpress bash -c \"/var/scripts/tail.sh\"",
"docker:uninstall": "pnpm run docker:compose -- exec wordpress bash -c \"/var/scripts/uninstall.sh\"",
"docker:up": "pnpm run docker:compose -- up",
"docker:update-core-unit-tests": "pnpm run docker:compose -- exec wordpress svn up /tmp/wordpress-develop/tests/phpunit/data/ /tmp/wordpress-develop/tests/phpunit/includes",
"docker:wp": "pnpm run docker:compose -- exec wordpress wp --allow-root --path=/var/www/html/",
"docker:build": "printf '\\e[30;43m`pnpm run docker:build` is deprected. Use the Jetpack CLI instead.\\e[0m\\n'; jetpack docker build",
"docker:build-image": "printf '\\e[30;43m`pnpm run docker:build-image` is deprected. Use the Jetpack CLI instead.\\e[0m\\n'; jetpack docker build-image",
"docker:clean": "printf '\\e[30;43m`pnpm run docker:clean` is deprected. Use the Jetpack CLI instead.\\e[0m\\n'; jetpack docker clean",
"docker:compose": "printf '\\e[30;43m`pnpm run docker:compose` is deprected. Now it is integrated into relevant Jetpack CLI commands.\\e[0m\\n';",
"docker:compose-extras": "printf '\\e[30;43m`pnpm run docker:compose-extras` is deprected. Now it is integrated into relevant Jetpack CLI commands\\e[0m\\n';",
"docker:compose-volumes": "printf '\\e[30;43m`pnpm run docker:compose-volumes` is deprected. Now it is integrated into relevant Jetpack CLI commands\\e[0m\\n';",
"docker:db": "printf '\\e[30;43m`pnpm run docker:db` is deprected. Use the Jetpack CLI instead.\\e[0m\\n'; jetpack docker db",
"docker:down": "printf '\\e[30;43m`pnpm run docker:down` is deprected. Use the Jetpack CLI instead.\\e[0m\\n'; jetpack docker down",
"docker:env": "printf '\\e[30;43m`pnpm run docker:env` is deprected. Now it is integrated into relevant Jetpack CLI commands.\\e[0m\\n';",
"docker:install": "printf '\\e[30;43m`pnpm run docker:install` is deprected. Use the Jetpack CLI instead.\\e[0m\\n'; jetpack docker install",
"docker:jt-config": "printf '\\e[30;43m`pnpm run docker:jt-config` is deprected. Use the Jetpack CLI instead.\\e[0m\\n'; jetpack docker jt-config",
"docker:jt-down": "printf '\\e[30;43m`pnpm run docker:jt-down` is deprected. Use the Jetpack CLI instead.\\e[0m\\n'; jetpack docker jt-down",
"docker:jt-up": "printf '\\e[30;43m`pnpm run docker:jt-up` is deprected. Use the Jetpack CLI instead.\\e[0m\\n'; jetpack docker jt-up",
"docker:multisite-convert": "printf '\\e[30;43m`pnpm run docker:multisite-convert` is deprected. Use the Jetpack CLI instead.\\e[0m\\n'; jetpack docker multisite-convert",
"docker:ngrok-down": "printf '\\e[30;43m`pnpm run docker:ngrok-down` is deprected. Use the Jetpack CLI instead.\\e[0m\\n'; jetpack docker down --ngrok",
"docker:ngrok-up": "printf '\\e[30;43m`pnpm run docker:ngrok-up` is deprected. Use the Jetpack CLI instead.\\e[0m\\n'; jetpack docker up --ngrok",
"docker:phpunit": "printf '\\e[30;43m`pnpm run docker:phpunit` is deprected. Use the Jetpack CLI instead.\\e[0m\\n'; jetpack docker phpunit",
"docker:phpunit:multisite": "printf '\\e[30;43m`pnpm run docker:phpunit:multisite` is deprected. Use the Jetpack CLI instead.\\e[0m\\n'; jetpack docker phpunit-multisite",
"docker:run-extras": "printf '\\e[30;43m`pnpm run docker:run-extras` is deprected. Use the Jetpack CLI instead.\\e[0m\\n'; jetpack docker run-extras",
"docker:sh": "printf '\\e[30;43m`pnpm run docker:sh` is deprected. Use the Jetpack CLI instead.\\e[0m\\n'; jetpack docker sh",
"docker:stop": "printf '\\e[30;43m`pnpm run docker:stop` is deprected. Use the Jetpack CLI instead.\\e[0m\\n'; jetpack docker stop",
"docker:tail": "printf '\\e[30;43m`pnpm run docker:tail` is deprected. Use the Jetpack CLI instead.\\e[0m\\n'; jetpack docker tail",
"docker:uninstall": "printf '\\e[30;43m`pnpm run docker:uninstall` is deprected. Use the Jetpack CLI instead.\\e[0m\\n'; jetpack docker uninstall",
"docker:up": "printf '\\e[30;43m`pnpm run docker:up` is deprected. Use the Jetpack CLI instead.\\e[0m\\n'; jetpack docker up",
"docker:update-core-unit-tests": "printf '\\e[30;43m`pnpm run docker:update-core-unit-tests` is deprected. Use the Jetpack CLI instead.\\e[0m\\n'; jetpack docker update-core-unit-tests",
"docker:wp": "printf '\\e[30;43m`pnpm run docker:wp` is deprected. Use the Jetpack CLI instead.\\e[0m\\n'; jetpack docker wp",
"install-if-deps-outdated": "pnpm install --no-prod --frozen-lockfile",
"lint": "pnpm run lint-file -- .",
"lint-changed": "tools/eslint-changed.js --ext .js,.jsx --git",
Expand Down
100 changes: 56 additions & 44 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2f15492

Please sign in to comment.