Skip to content

Commit

Permalink
Merge pull request #1220 from frappe/staging
Browse files Browse the repository at this point in the history
chore: Merge staging into v5.x
  • Loading branch information
gavindsouza authored Dec 1, 2021
2 parents ff2f01f + e2858cb commit 5dc691a
Show file tree
Hide file tree
Showing 47 changed files with 3,167 additions and 1,889 deletions.
16 changes: 9 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,20 @@ matrix:
script: sudo python $TRAVIS_BUILD_DIR/install.py --user travis --run-travis --production --verbose

install:
- pip install urllib3 pyOpenSSL ndg-httpsclient pyasn1
- pip3 install urllib3 pyOpenSSL ndg-httpsclient pyasn1

- if [ $TEST == "bench" ];then
wget -q -O /tmp/wkhtmltox.tar.xz https://github.com/frappe/wkhtmltopdf/raw/master/wkhtmltox-0.12.3_linux-generic-amd64.tar.xz;
tar -xf /tmp/wkhtmltox.tar.xz -C /tmp;
sudo mv /tmp/wkhtmltox/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf;
sudo chmod o+x /usr/local/bin/wkhtmltopdf;
wget -q -O /tmp/wkhtmltox.tar.xz https://github.com/frappe/wkhtmltopdf/raw/master/wkhtmltox-0.12.3_linux-generic-amd64.tar.xz;
tar -xf /tmp/wkhtmltox.tar.xz -C /tmp;
sudo mv /tmp/wkhtmltox/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf;
sudo chmod o+x /usr/local/bin/wkhtmltopdf;

nvm install 14;
nvm use 14;

mkdir -p ~/.bench;
cp -r $TRAVIS_BUILD_DIR/* ~/.bench;
pip install -q -U -e ~/.bench;
sudo pip install -q -U -e ~/.bench;
pip3 install -q -U -e ~/.bench;

mysql -u root -e "SET GLOBAL character_set_server = 'utf8mb4'";
mysql -u root -e "SET GLOBAL collation_server = 'utf8mb4_unicode_ci'";
Expand Down
42 changes: 41 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@

Bench is a command-line utility that helps you to install, update, and manage multiple sites for Frappe/ERPNext applications on [*nix systems](https://en.wikipedia.org/wiki/Unix-like) for development and production.

<div align="center">
<a target="_blank" href="https://www.python.org/downloads/" title="Python version">
<img src="https://img.shields.io/badge/python-%3E=_3.6-green.svg">
</a>
<a target="_blank" href="https://app.travis-ci.com/github/frappe/bench" title="CI Status">
<img src="https://app.travis-ci.com/frappe/bench.svg?branch=develop">
</a>
<a target="_blank">
<img src="https://img.shields.io/badge/platform-linux%20%7C%20osx-blue">
</a>
<a target="_blank" href="https://app.fossa.com/projects/git%2Bgithub.com%2Ffrappe%2Fbench?ref=badge_shield" title="FOSSA Status">
<img src="https://app.fossa.com/api/projects/git%2Bgithub.com%2Ffrappe%2Fbench.svg?type=shield">
</a>
<a target="_blank" href="#LICENSE" title="License: GPLv3">
<img src="https://img.shields.io/badge/License-GPLv3-blue.svg">
</a>
</div>

## Table of Contents

- [Installation](#installation)
Expand All @@ -17,6 +35,7 @@ Bench is a command-line utility that helps you to install, update, and manage mu
- [Guides](#guides)
- [Resources](#resources)
- [Development](#development)
- [Releases](#releases)
- [License](#license)


Expand Down Expand Up @@ -236,6 +255,27 @@ $ pip3 install -U frappe-bench

To confirm the switch, check the output of `bench src`. It should change from something like `$HOME/bench-repo` to `/usr/local/lib/python3.6/dist-packages` and stop the editable install warnings from getting triggered at every command.


## Releases

Bench's version information can be accessed via `bench.VERSION` in the package's __init__.py file. Eversince the v5.0 release, we've started publishing releases on GitHub, and PyPI.

GitHub: https://github.com/frappe/bench/releases

PyPI: https://pypi.org/project/frappe-bench


From v5.3.0, we partially automated the release process using [@semantic-release](.github/workflows/release.yml). Under this new pipeline, we do the following steps to make a release:

1. Merge `develop` into the `staging` branch
1. Merge `staging` into the latest stable branch, which is `v5.x` at this point.

This triggers a GitHub Action job that generates a bump commit, drafts and generates a GitHub release, builds a Python package and publishes it to PyPI.

The intermediate `staging` branch exists to mediate the `bench.VERSION` conflict that would arise while merging `develop` and stable. On develop, the version has to be manually updated (for major release changes). The version tag plays a role in deciding when checks have to be made for new Bench releases.

> Note: We may want to kill the convention of separate branches for different version releases of Bench. We don't need to maintain this the way we do for Frappe & ERPNext. A single branch named `stable` would sustain.
## License

This repository has been released under the [GNU GPLv3 License](LICENSE).
This repository has been released under the [GNU GPLv3 License](LICENSE).
10 changes: 7 additions & 3 deletions bench/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
VERSION = "5.6.0"
PROJECT_NAME = "frappe-bench"
FRAPPE_VERSION = None
current_path = None
updated_path = None
LOG_BUFFER = []


def set_frappe_version(bench_path='.'):
from .app import get_current_frappe_version
def set_frappe_version(bench_path="."):
from .utils.app import get_current_frappe_version

global FRAPPE_VERSION
if not FRAPPE_VERSION:
FRAPPE_VERSION = get_current_frappe_version(bench_path=bench_path)
FRAPPE_VERSION = get_current_frappe_version(bench_path=bench_path)
Loading

0 comments on commit 5dc691a

Please sign in to comment.