2
0
mirror of https://github.com/frappe/frappe_docker.git synced 2025-01-03 06:10:23 +00:00

revert: quote percent as mentioned in bench help

This commit is contained in:
Revant Nandgaonkar 2024-12-10 15:48:00 +05:30
parent 1505d125f1
commit 85e164f34c
7 changed files with 18 additions and 20 deletions

View File

@ -209,7 +209,7 @@ def create_site_in_bench(args):
"new-site", "new-site",
f"--db-host=mariadb", # Should match the compose service name f"--db-host=mariadb", # Should match the compose service name
f"--db-type={args.db_type}", # Add the selected database type f"--db-type={args.db_type}", # Add the selected database type
f"--mariadb-user-host-login-scope='%'", f"--mariadb-user-host-login-scope=%",
f"--db-root-password=123", # Replace with your MariaDB password f"--db-root-password=123", # Replace with your MariaDB password
f"--admin-password={args.admin_password}", f"--admin-password={args.admin_password}",
] ]

View File

@ -144,7 +144,7 @@ sed -i '/redis/d' ./Procfile
You can create a new site with the following command: You can create a new site with the following command:
```shell ```shell
bench new-site --mariadb-user-host-login-scope='%' sitename bench new-site --mariadb-user-host-login-scope=% sitename
``` ```
sitename MUST end with .localhost for trying deployments locally. sitename MUST end with .localhost for trying deployments locally.
@ -152,18 +152,18 @@ sitename MUST end with .localhost for trying deployments locally.
for example: for example:
```shell ```shell
bench new-site --mariadb-user-host-login-scope='%' development.localhost bench new-site --mariadb-user-host-login-scope=% development.localhost
``` ```
The same command can be run non-interactively as well: The same command can be run non-interactively as well:
```shell ```shell
bench new-site --db-root-password 123 --admin-password admin --mariadb-user-host-login-scope='%' development.localhost bench new-site --db-root-password 123 --admin-password admin --mariadb-user-host-login-scope=% development.localhost
``` ```
The command will ask the MariaDB root password. The default root password is `123`. The command will ask the MariaDB root password. The default root password is `123`.
This will create a new site and a `development.localhost` directory under `frappe-bench/sites`. This will create a new site and a `development.localhost` directory under `frappe-bench/sites`.
The option `--mariadb-user-host-login-scope='%'` will configure site's database credentials to work with docker. The option `--mariadb-user-host-login-scope=%` will configure site's database credentials to work with docker.
You may need to configure your system /etc/hosts if you're on Linux, Mac, or its Windows equivalent. You may need to configure your system /etc/hosts if you're on Linux, Mac, or its Windows equivalent.
To setup site with PostgreSQL as database use option `--db-type postgres` and `--db-host postgresql`. (Available only v12 onwards, currently NOT available for ERPNext). To setup site with PostgreSQL as database use option `--db-type postgres` and `--db-host postgresql`. (Available only v12 onwards, currently NOT available for ERPNext).

View File

@ -74,7 +74,7 @@ configurator:
### Site Creation ### Site Creation
For `create-site` service to act as run once site creation job, you need to pass `["bash", "-c"]` as container `entrypoint` and bash script inline to yaml. Make sure to use `--mariadb-user-host-login-scope='%'` as upstream bench is installed in container. For `create-site` service to act as run once site creation job, you need to pass `["bash", "-c"]` as container `entrypoint` and bash script inline to yaml. Make sure to use `--mariadb-user-host-login-scope=%` as upstream bench is installed in container.
The `WORKDIR` has changed to `/home/frappe/frappe-bench` like `bench` setup we are used to. So the path to find `common_site_config.json` has changed to `sites/common_site_config.json`. The `WORKDIR` has changed to `/home/frappe/frappe-bench` like `bench` setup we are used to. So the path to find `common_site_config.json` has changed to `sites/common_site_config.json`.
@ -106,7 +106,7 @@ create-site:
fi fi
done; done;
echo "sites/common_site_config.json found"; echo "sites/common_site_config.json found";
bench new-site --mariadb-user-host-login-scope='%' --admin-password=admin --db-root-password=admin --install-app erpnext --set-default frontend; bench new-site --mariadb-user-host-login-scope=% --admin-password=admin --db-root-password=admin --install-app erpnext --set-default frontend;
# ... removed for brevity # ... removed for brevity
``` ```

View File

@ -83,7 +83,7 @@ services:
fi fi
done; done;
echo "sites/common_site_config.json found"; echo "sites/common_site_config.json found";
bench new-site --mariadb-user-host-login-scope='%' --admin-password=admin --db-root-password=admin --install-app erpnext --set-default frontend; bench new-site --mariadb-user-host-login-scope=% --admin-password=admin --db-root-password=admin --install-app erpnext --set-default frontend;
db: db:
image: mariadb:10.6 image: mariadb:10.6

View File

@ -177,7 +177,7 @@ Create sites `one.example.com` and `two.example.com`:
```shell ```shell
# one.example.com # one.example.com
docker compose --project-name erpnext-one exec backend \ docker compose --project-name erpnext-one exec backend \
bench new-site --mariadb-user-host-login-scope='%' --db-root-password changeit --install-app erpnext --admin-password changeit one.example.com bench new-site --mariadb-user-host-login-scope=% --db-root-password changeit --install-app erpnext --admin-password changeit one.example.com
``` ```
You can stop here and have a single bench single site setup complete. Continue to add one more site to the current bench. You can stop here and have a single bench single site setup complete. Continue to add one more site to the current bench.
@ -185,7 +185,7 @@ You can stop here and have a single bench single site setup complete. Continue t
```shell ```shell
# two.example.com # two.example.com
docker compose --project-name erpnext-one exec backend \ docker compose --project-name erpnext-one exec backend \
bench new-site --mariadb-user-host-login-scope='%' --db-root-password changeit --install-app erpnext --admin-password changeit two.example.com bench new-site --mariadb-user-host-login-scope=% --db-root-password changeit --install-app erpnext --admin-password changeit two.example.com
``` ```
#### Create second bench #### Create second bench
@ -236,10 +236,10 @@ Create sites `three.example.com` and `four.example.com`:
```shell ```shell
# three.example.com # three.example.com
docker compose --project-name erpnext-two exec backend \ docker compose --project-name erpnext-two exec backend \
bench new-site --mariadb-user-host-login-scope='%' --db-root-password changeit --install-app erpnext --admin-password changeit three.example.com bench new-site --mariadb-user-host-login-scope=% --db-root-password changeit --install-app erpnext --admin-password changeit three.example.com
# four.example.com # four.example.com
docker compose --project-name erpnext-two exec backend \ docker compose --project-name erpnext-two exec backend \
bench new-site --mariadb-user-host-login-scope='%' --db-root-password changeit --install-app erpnext --admin-password changeit four.example.com bench new-site --mariadb-user-host-login-scope=% --db-root-password changeit --install-app erpnext --admin-password changeit four.example.com
``` ```
#### Create custom domain to existing site #### Create custom domain to existing site

View File

@ -9,7 +9,7 @@ Note:
- Wait for the `db` service to start and `configurator` to exit before trying to create a new site. Usually this takes up to 10 seconds. - Wait for the `db` service to start and `configurator` to exit before trying to create a new site. Usually this takes up to 10 seconds.
```sh ```sh
docker-compose exec backend bench new-site --mariadb-user-host-login-scope='%' --db-root-password <db-password> --admin-password <admin-password> <site-name> docker-compose exec backend bench new-site --mariadb-user-host-login-scope=% --db-root-password <db-password> --admin-password <admin-password> <site-name>
``` ```
If you need to install some app, specify `--install-app`. To see all options, just run `bench new-site --help`. If you need to install some app, specify `--install-app`. To see all options, just run `bench new-site --help`.
@ -24,7 +24,7 @@ docker-compose exec backend bench set-config -g root_password <root-password>
Also command is slightly different: Also command is slightly different:
```sh ```sh
docker-compose exec backend bench new-site --mariadb-user-host-login-scope='%' --db-type postgres --admin-password <admin-password> <site-name> docker-compose exec backend bench new-site --mariadb-user-host-login-scope=% --db-type postgres --admin-password <admin-password> <site-name>
``` ```
## Push backup to S3 storage ## Push backup to S3 storage

View File

@ -71,11 +71,9 @@ def frappe_site(compose: Compose):
site_name = "tests.localhost" site_name = "tests.localhost"
compose.bench( compose.bench(
"new-site", "new-site",
"--mariadb-user-host-login-scope='%'", "--mariadb-user-host-login-scope=%",
"--db-root-password", "--db-root-password=123",
"123", "--admin-password=admin",
"--admin-password",
"admin",
site_name, site_name,
) )
compose("restart", "backend") compose("restart", "backend")
@ -96,7 +94,7 @@ def erpnext_site(compose: Compose):
site_name = "test-erpnext-site.localhost" site_name = "test-erpnext-site.localhost"
args = [ args = [
"new-site", "new-site",
"--mariadb-user-host-login-scope='%'", "--mariadb-user-host-login-scope=%",
"--db-root-password", "--db-root-password",
"123", "123",
"--admin-password", "--admin-password",