2
0
mirror of https://github.com/frappe/frappe_docker.git synced 2024-11-08 14:21:05 +00:00

Merge pull request #449 from revant/prepare-v13-build

chore: change ci script to build v13
This commit is contained in:
Revant Nandgaonkar 2021-04-02 07:51:08 +05:30 committed by GitHub
commit 253d1ca6ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 43 additions and 38 deletions

View File

@ -60,36 +60,36 @@ jobs:
- ./travis.py erpnext --nginx --tag latest
- ./travis.py erpnext --nginx --tag edge --tag-only
- ./travis.py erpnext --nginx --tag develop --tag-only
- stage: "Frappe (v13-beta)"
- stage: "Frappe (v13)"
if: branch = master AND type != pull_request
script:
- ./travis.py frappe --worker --git-version 13-beta
- ./travis.py frappe --worker --tag v13-beta --tag-only
- ./travis.py frappe --worker --tag version-13-beta --tag-only
- stage: "Frappe (v13-beta)"
- ./travis.py frappe --worker --git-version 13
- ./travis.py frappe --worker --tag v13 --tag-only
- ./travis.py frappe --worker --tag version-13 --tag-only
- stage: "Frappe (v13)"
if: branch = master AND type != pull_request
script:
- ./travis.py frappe --nginx --git-version 13-beta
- ./travis.py frappe --nginx --tag v13-beta --tag-only
- ./travis.py frappe --nginx --tag version-13-beta --tag-only
- stage: "Frappe (v13-beta)"
- ./travis.py frappe --nginx --git-version 13
- ./travis.py frappe --nginx --tag v13 --tag-only
- ./travis.py frappe --nginx --tag version-13 --tag-only
- stage: "Frappe (v13)"
if: branch = master AND type != pull_request
script:
- ./travis.py frappe --socketio --git-version 13-beta
- ./travis.py frappe --socketio --tag v13-beta --tag-only
- ./travis.py frappe --socketio --tag version-13-beta --tag-only
- stage: "ERPNext (v13-beta)"
- ./travis.py frappe --socketio --git-version 13
- ./travis.py frappe --socketio --tag v13 --tag-only
- ./travis.py frappe --socketio --tag version-13 --tag-only
- stage: "ERPNext (v13)"
if: branch = master AND type != pull_request
script:
- ./travis.py erpnext --worker --git-version 13-beta
- ./travis.py erpnext --worker --tag v13-beta --tag-only
- ./travis.py erpnext --worker --tag version-13-beta --tag-only
- stage: "ERPNext (v13-beta)"
- ./travis.py erpnext --worker --git-version 13
- ./travis.py erpnext --worker --tag v13 --tag-only
- ./travis.py erpnext --worker --tag version-13 --tag-only
- stage: "ERPNext (v13)"
if: branch = master AND type != pull_request
script:
- ./travis.py erpnext --nginx --git-version 13-beta
- ./travis.py erpnext --nginx --tag v13-beta --tag-only
- ./travis.py erpnext --nginx --tag version-13-beta --tag-only
- ./travis.py erpnext --nginx --git-version 13
- ./travis.py erpnext --nginx --tag v13 --tag-only
- ./travis.py erpnext --nginx --tag version-13 --tag-only
- stage: "Frappe (v12)"
if: branch = master AND type != pull_request
script:
@ -183,4 +183,4 @@ jobs:
script:
- git clone git@github.com:frappe/helm.git && cd helm
- pip install -r release_wizard/requirements.txt
- ./release_wizard/wizard 12 patch --remote origin --ci
- ./release_wizard/wizard 13 patch --remote origin --ci

View File

@ -103,7 +103,7 @@ networks:
### Deploy Frappe/ERPNext
Stacks > Add Stacks > `frappe-bench-v12`
Stacks > Add Stacks > `frappe-bench-v13`
```yaml
version: "3.7"
@ -272,10 +272,10 @@ SITES=`site1.example.com`,`site2.example.com`
### Create new site job
1. Containers > Add Container > `add-site1-example-com`
2. Select Image frappe/erpnext-worker:v12
2. Select Image frappe/erpnext-worker:v13
3. Set command as `new`
4. Select network `frappe-network`
5. Select Volume `frappe-bench-v12_sites_vol` and mount in container `/home/frappe/frappe-bench/sites`
5. Select Volume `frappe-bench-v13_sites_vol` and mount in container `/home/frappe/frappe-bench/sites`
6. Env variables:
- MYSQL_ROOT_PASSWORD=longsecretpassword
- SITE_NAME=site1.example.com
@ -284,10 +284,10 @@ SITES=`site1.example.com`,`site2.example.com`
### Migrate Sites job
1. Containers > Add Container > `migrate-sites`
2. Select Image frappe/erpnext-worker:v12
2. Select Image frappe/erpnext-worker:v13
3. Set command as `migrate`
4. Select network `frappe-network`
5. Select Volume `frappe-bench-v12_sites_vol` and mount in container `/home/frappe/frappe-bench/sites`
5. Select Volume `frappe-bench-v13_sites_vol` and mount in container `/home/frappe/frappe-bench/sites`
6. Env variables:
- MAINTENANCE_MODE=1
7. Start container

View File

@ -17,7 +17,7 @@ cp env-example .env
To get started, copy the existing `env-example` file to `.env`. By default, the file will contain the following variables:
- `VERSION=edge`
- In this case, `edge` corresponds to `develop`. To setup any other version, you may use the branch name or version specific tags. (eg. version-12, v11.1.15, v11)
- In this case, `edge` corresponds to `develop`. To setup any other version, you may use the branch name or version specific tags. (eg. v13.0.0, version-12, v11.1.15, v11)
- `MYSQL_ROOT_PASSWORD=admin`
- Bootstraps a MariaDB container with this value set as the root password. If a managed MariaDB instance is used, there is no need to set the password here.
- `MARIADB_HOST=mariadb`

View File

@ -26,9 +26,9 @@ cp env-production .env
To get started, copy the existing `env-local` or `env-production` file to `.env`. By default, the file will contain the following variables:
- `ERPNEXT_VERSION=edge`
- In this case, `edge` corresponds to `develop`. To setup any other version, you may use the branch name or version specific tags. (eg. version-12, v11.1.15, v11).
- In this case, `edge` corresponds to `develop`. To setup any other version, you may use the branch name or version specific tags. (eg. v13.0.0, version-12, v11.1.15, v11).
- `FRAPPE_VERSION=edge`
- In this case, `edge` corresponds to `develop`. To setup any other version, you may use the branch name or version specific tags. (eg. version-12, v11.1.15, v11).
- In this case, `edge` corresponds to `develop`. To setup any other version, you may use the branch name or version specific tags. (eg. v13.0.0, version-12, v11.1.15, v11).
- `MARIADB_HOST=mariadb`
- Sets the hostname to `mariadb`. This is required if the database is managed by the containerized MariaDB instance.
- `MYSQL_ROOT_PASSWORD=admin`

View File

@ -128,7 +128,7 @@ Environment Variables
Note:
- Above example will backup files in bucket called `backup` at location `frappe-bench-v12/site.name.com/DATE_TIME/DATE_TIME-site_name_com-{filetype}.{extension}`,
- Above example will backup files in bucket called `backup` at location `frappe-bench-v13/site.name.com/DATE_TIME/DATE_TIME-site_name_com-{filetype}.{extension}`,
- example DATE_TIME: 20200325_042020.
- example filetype: database, files or private-files
- example extension: sql.gz or tar
@ -266,7 +266,7 @@ Environment Variables needed:
- `DB_ROOT_USER`: MariaDB/PostgreSQL Root user.
- `MYSQL_ROOT_PASSWORD`: Root User password for MariaDB.
- `FORCE=1`: optional variable which force deletion of the same site.
- `NO_BACKUP=1`: option variable to skip the process of taking backup before deleting the site.
- `NO_BACKUP=1`: option variable to skip the process of taking backup before deleting the site.
Environment Variables for PostgreSQL only:

View File

@ -48,8 +48,8 @@ echo -e "\e[1m\e[4mCopy env-example file\e[0m"
cp env-example .env
echo -e "\n"
echo -e "\e[1m\e[4mSet version to v12\e[0m"
sed -i -e "s/edge/v12/g" .env
echo -e "\e[1m\e[4mSet version to v13\e[0m"
sed -i -e "s/edge/v13/g" .env
echo -e "\n"
echo -e "\e[1m\e[4mStart Services\e[0m"
@ -76,13 +76,13 @@ docker run --name postgresql -d \
loopHealthCheck
echo -e "\n"
echo -e "\e[1m\e[4mCreate new site (v12)\e[0m"
echo -e "\e[1m\e[4mCreate new site (v13)\e[0m"
docker run -it \
-e "SITE_NAME=test.localhost" \
-e "INSTALL_APPS=erpnext" \
-v frappebench00_sites-vol:/home/frappe/frappe-bench/sites \
--network frappebench00_default \
frappe/erpnext-worker:v12 new
frappe/erpnext-worker:v13 new
echo -e "\n"
echo -e "\e[1m\e[4mPing created site\e[0m"
@ -94,7 +94,7 @@ curl -s http://test.localhost | w3m -T text/html -dump
echo -e "\n"
echo -e "\e[1m\e[4mSet version to edge\e[0m"
sed -i -e "s/v12/edge/g" .env
sed -i -e "s/v13/edge/g" .env
echo -e "\n"
echo -e "\e[1m\e[4mRestart containers with edge image\e[0m"

View File

@ -9,6 +9,7 @@ def parse_args():
parser.add_argument('service', action='store', type=str, help='Name of the service to build: "erpnext" or "frappe"')
parser.add_argument('-o', '--tag-only', required=False, action='store_true', dest='tag_only', help='Only tag an image and push it.')
parser.add_argument('-b', '--is-beta', required=False, default=False, action='store_true', dest='is_beta', help='Specify if tag is beta')
image_type = parser.add_mutually_exclusive_group(required=True)
image_type.add_argument('-a', '--nginx', action='store_const', dest='image_type', const='nginx', help='Build the nginx + static assets image')
@ -23,7 +24,7 @@ def parse_args():
return args
def git_version(service, version, branch):
def git_version(service, version, branch, is_beta=False):
print(f'Pulling {service} v{version}')
subprocess.run(f'git clone https://github.com/frappe/{service} --branch {branch}', shell=True)
cd = os.getcwd()
@ -34,6 +35,10 @@ def git_version(service, version, branch):
version = version.split('-')[0]
version_tag = subprocess.check_output(f'git tag --list --sort=-version:refname "v{version}*" | sed -n 1p | sed -e \'s#.*@\(\)#\\1#\'', shell=True).strip().decode('ascii')
if not is_beta:
version_tag = version_tag.split("-")[0]
os.chdir(cd)
return version_tag
@ -61,7 +66,7 @@ def main():
if args.version:
branch = 'version-' + args.version
tag = git_version(args.service, args.version, branch)
tag = git_version(args.service, args.version, branch, args.is_beta)
if args.tag_only:
tag_and_push(f'{args.service}-{args.image_type}', tag)