-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
01fdab1
commit ab50318
Showing
6 changed files
with
87 additions
and
23 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
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 |
---|---|---|
|
@@ -39,25 +39,57 @@ This will ensure that all linked assets will be found. Should also work without, | |
Note: You need to install the assets yourself somehow. You can also look into `build.sh` and how the deployment script handles it. | ||
In the end you just have to get them installed somehow for the AssetCompress plugin to pick them up. | ||
|
||
#### Use CakeBox as VM | ||
Hot tip: Using [CakeBox](https://github.com/alt3/cakebox) is the fast way to get it working on any OS. | ||
Just follow the docs there, log in and create a project: | ||
#### Use Devilbox as VM | ||
Hot tip: Using [Devilbox](https://github.com/cytopia/devilbox) is the fast way to get it working on any OS. | ||
|
||
Just follow the [docs](https://github.com/cytopia/devilbox?tab=readme-ov-file#-quickstart) there. | ||
You need to adjust the `.env` file a bit, though. | ||
|
||
Set HTTPD_DOCROOT_DIR for easier work with CakePHP: | ||
``` | ||
cakebox application add sandbox.local | ||
HTTPD_DOCROOT_DIR=webroot | ||
``` | ||
Then remove that `sandbox.local` folder in /Apps/ and instead clone the sandbox into it. | ||
|
||
In this case the hosts entry would more look like: | ||
Set up `/etc/hosts` entries for your domains, e.g. | ||
``` | ||
10.33.10.10 cakebox sandbox.local | ||
127.0.0.1 sandbox.local | ||
``` | ||
The `add` command from above should automatically do that. If not, adjust your hosts file manually. | ||
|
||
Then inside the vagrant machine navigate to `/Apps/sandbox.local/` and execute | ||
Inside the devilbox navigate into `data/www/` dir and clone the sandbox repo | ||
``` | ||
./setup | ||
git clone [email protected]:dereuromark/cakephp-sandbox.git sandbox | ||
``` | ||
You can also use https if you don't have ssh setup yet. | ||
|
||
Now you should be able to start up the containers: | ||
``` | ||
docker-composer up -d | ||
``` | ||
And log in using | ||
``` | ||
./shell.sh | ||
``` | ||
|
||
Then inside container navigate to `sandbox/` and execute | ||
``` | ||
./install.sh | ||
``` | ||
|
||
Tip: Customize your `bash/bashrc.sh` file. | ||
At the end, add your aliases as well as the cd command: | ||
``` | ||
alias c='composer' | ||
... | ||
cd sandbox | ||
```` | ||
This way you don't need to navigate inside anymore, it will auto-jump you to the repo root. | ||
#### Use Traefix and docker containers as VM | ||
See https://github.com/dereuromark/sandbox-docker?tab=readme-ov-file#installation | ||
Note: Requires HTTPS setup, but otherwise is quicker. | ||
### Creating Admin User | ||
In case you want to check out the admin area (`/admin`), you want to create an admin user. | ||
You can do that via command line: | ||
|
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,31 @@ | ||
#!/bin/bash | ||
# Warning: Only run this once for first install, afterwards run ./setup.sh | ||
|
||
set -o pipefail | ||
|
||
php composer.phar install | ||
|
||
[ ! -f config/app_local.php ] && cp config/app_local.default.php config/app_local.php && echo "ERROR: DB credentials missing, enter them now and run again!" && exit 1 | ||
|
||
mkdir -p ./tmp | ||
mkdir -p ./logs | ||
mkdir -p ./webroot/js/cjs/ | ||
mkdir -p ./webroot/css/ccss/ | ||
|
||
chmod +x bin/cake | ||
|
||
# Database for testing | ||
mysql --host=mariadb --password=geheim -u root -e "create database test"; | ||
|
||
php composer.phar migrate | ||
|
||
bin/cake migrations seed | ||
|
||
# Assets | ||
mkdir -p tmp | ||
mkdir -p logs | ||
mkdir -p webroot/js/cjs/ | ||
mkdir -p webroot/css/ccss/ | ||
|
||
bower install --allow-root | ||
php composer.phar assets |
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