forked from open-eats/OpenEats
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/script documentation (open-eats#28)
* cleaning up the quick start script * updating docs for new quick-start script version * updating the release script to pull commits from github since the last release * adding new release * removing the example and updating the script
- Loading branch information
Showing
6 changed files
with
166 additions
and
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/usr/bin/env python | ||
# encoding: utf-8 | ||
|
||
import requests | ||
from datetime import datetime, timedelta | ||
|
||
|
||
def get_commits(repo): | ||
""" | ||
Give a repo, this function will return a list of commits since the last release. | ||
:param repo: a github repo. | ||
:return: array of commit messages. | ||
""" | ||
|
||
# Get the last commit from the last release | ||
res = requests.get('https://api.github.com/repos/open-eats/%s/tags' % repo) | ||
commit = res.json()[0].get('commit').get('sha') | ||
|
||
# Get the date of the last commit from the last release | ||
res = requests.get('https://api.github.com/repos/open-eats/%s/commits/%s' % (repo, commit)) | ||
date = res.json().get('commit').get('author').get('date') | ||
|
||
# Convert the date to a datetime and add 1 second to it, | ||
# So we don't get the last commit of the previous release. | ||
date = datetime.strptime(date, "%Y-%m-%dT%H:%M:%SZ") + timedelta(seconds=1) | ||
|
||
# Get all the commits messages since the last release | ||
res = requests.get('https://api.github.com/repos/open-eats/%s/commits?since=%s' % (repo, date)) | ||
return [re.get('commit').get('message') for re in res.json()] | ||
|
||
|
||
if __name__ == '__main__': | ||
messages = [] | ||
repos = ['openeats-nginx', 'openeats-api', 'openeats-web', 'OpenEats'] | ||
for r in repos: | ||
messages += get_commits(r) | ||
print('\n'.join([m.split('\r', 1)[0] for m in messages])) |
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
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,8 @@ | ||
{ | ||
"tag": "1.2.0", | ||
"name": "Build process improvement", | ||
"body": "Adding JWT support\nAdding support for using slug values in the recipe\nFixing issue with tests always passing\nAdding docs and settings for remote DB config\nNew ui build process\nAdding coverage reports\nUse nginx to serve static\nNginx config to also pass port info to django", | ||
"target": "master", | ||
"draft": false, | ||
"prerelease": false | ||
} |