Mercurial > piecrust2
comparison garcon/pypi.py @ 992:bd269692dbb4
cm: Make the release script commit changed FoodTruck assets if needed.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Fri, 12 May 2017 09:01:51 -0700 |
parents | 9231172e3d81 |
children | 112ff1ab110c |
comparison
equal
deleted
inserted
replaced
981:5e3e840b5574 | 992:bd269692dbb4 |
---|---|
1 import re | |
1 from invoke import task, run | 2 from invoke import task, run |
2 | 3 |
3 | 4 |
4 @task | 5 @task |
5 def makerelease(version, local_only=False): | 6 def makerelease(version, local_only=False): |
12 print("Install Bower components") | 13 print("Install Bower components") |
13 run("bower install") | 14 run("bower install") |
14 print("Generating FoodTruck assets") | 15 print("Generating FoodTruck assets") |
15 run("gulp") | 16 run("gulp") |
16 | 17 |
18 # See if any asset was modified and needs to be submitted. | |
19 r = run('hg status', hide=True) | |
20 if re.match(r'^[R\!] ', r.stdout): | |
21 raise Exception("FoodTruck assets are missing or were removed!") | |
22 | |
23 commit_assets = False | |
24 if re.match(r'^[MA] ', r.stdout): | |
25 commit_assets = True | |
26 | |
17 # CHANGELOG.rst and documentation changelog page. | 27 # CHANGELOG.rst and documentation changelog page. |
18 run("invoke changelog --last %s" % version) | 28 run("invoke changelog --last %s" % version) |
19 run("invoke changelog --last %s -o docs/pages/support/changelog.md" % | 29 run("invoke changelog --last %s -o docs/pages/support/changelog.md" % |
20 version) | 30 version) |
21 | 31 |
22 if not local_only: | 32 if not local_only: |
33 if commit_assets: | |
34 run('hg commit piecrust/admin/static ' | |
35 '-m "admin: Regenerate FoodTruck assets."') | |
36 | |
23 # Submit the CHANGELOG. | 37 # Submit the CHANGELOG. |
24 run('hg commit CHANGELOG.rst docs/pages/support/changelog.md ' | 38 run('hg commit CHANGELOG.rst docs/pages/support/changelog.md ' |
25 '-m "cm: Regenerate the CHANGELOG."') | 39 '-m "cm: Regenerate the CHANGELOG."') |
26 | 40 |
27 # Tag in Mercurial, which will then be used for PyPi version. | 41 # Tag in Mercurial, which will then be used for PyPi version. |
29 | 43 |
30 # PyPi upload. | 44 # PyPi upload. |
31 run("python setup.py version") | 45 run("python setup.py version") |
32 run("python setup.py sdist upload") | 46 run("python setup.py sdist upload") |
33 else: | 47 else: |
48 if commit_assets: | |
49 print("Would submit FoodTruck assets...") | |
34 print("Would submit changelog files...") | 50 print("Would submit changelog files...") |
35 print("Would tag repo with %s..." % version) | 51 print("Would tag repo with %s..." % version) |
36 print("Would upload to PyPi...") | 52 print("Would upload to PyPi...") |
37 | 53 |