forked from getredash/redash
-
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.
More improvements to CircleCI configuration (getredash#2777)
* Moved configuration to `.circleci/config.yml` as the documentation for V2 suggests. * Created a dedicated Docker Compose configuration (in `.circleci/docker-compose.yml`) to remove volumes configuration as this is not supported with CircleCI's Docker executer. * Fix the Docker image build and tarball packing jobs to work and use correct version.
- Loading branch information
Showing
7 changed files
with
127 additions
and
82 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
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,22 @@ | ||
version: '2' | ||
services: | ||
redash: | ||
build: ../ | ||
command: manage version | ||
depends_on: | ||
- postgres | ||
- redis | ||
ports: | ||
- "5000:5000" | ||
environment: | ||
PYTHONUNBUFFERED: 0 | ||
REDASH_LOG_LEVEL: "INFO" | ||
REDASH_REDIS_URL: "redis://redis:6379/0" | ||
REDASH_DATABASE_URL: "postgresql://postgres@postgres/postgres" | ||
redis: | ||
image: redis:3.0-alpine | ||
restart: unless-stopped | ||
postgres: | ||
image: postgres:9.5.6-alpine | ||
command: "postgres -c fsync=off -c full_page_writes=off -c synchronous_commit=OFF" | ||
restart: unless-stopped |
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,5 @@ | ||
#!/bin/bash | ||
VERSION=$(jq -r .version package.json) | ||
FULL_VERSION=$VERSION.b$CIRCLE_BUILD_NUM | ||
|
||
echo $FULL_VERSION |
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,9 @@ | ||
#!/bin/bash | ||
NAME=redash | ||
VERSION=$(jq -r .version package.json) | ||
FULL_VERSION=$VERSION+b$CIRCLE_BUILD_NUM | ||
FILENAME=$NAME.$FULL_VERSION.tar.gz | ||
|
||
mkdir -p /tmp/artifacts/ | ||
|
||
tar -zcv -f /tmp/artifacts/$FILENAME --exclude="optipng*" --exclude=".git*" --exclude="*.pyc" --exclude="*.pyo" --exclude="venv" --exclude="node_modules" * |
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,5 @@ | ||
#!/bin/bash | ||
VERSION=$(jq -r .version package.json) | ||
FULL_VERSION=$VERSION+b$CIRCLE_BUILD_NUM | ||
|
||
sed -ri "s/^__version__ = '([A-Za-z0-9.-]*)'/__version__ = '$FULL_VERSION'/" redash/__init__.py |
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,5 @@ | ||
# https://github.com/behaviorbot/request-info?installation_id=189571 | ||
requestInfoLabelToAdd: needs-more-info | ||
requestInfoReplyComment: > | ||
We would appreciate it if you could provide us with more info about this issue/pr! | ||
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,35 @@ | ||
#!/bin/env python | ||
import sys | ||
import re | ||
import subprocess | ||
|
||
def get_change_log(previous_sha): | ||
args = ['git', '--no-pager', 'log', '--merges', '--grep', 'Merge pull request', '--pretty=format:"%h|%s|%b|%p"', 'master...{}'.format(previous_sha)] | ||
log = subprocess.check_output(args) | ||
changes = [] | ||
|
||
for line in log.split('\n'): | ||
try: | ||
sha, subject, body, parents = line[1:-1].split('|') | ||
except ValueError: | ||
continue | ||
|
||
try: | ||
pull_request = re.match("Merge pull request #(\d+)", subject).groups()[0] | ||
pull_request = " #{}".format(pull_request) | ||
except Exception as ex: | ||
pull_request = "" | ||
|
||
author = subprocess.check_output(['git', 'log', '-1', '--pretty=format:"%an"', parents.split(' ')[-1]])[1:-1] | ||
|
||
changes.append("{}{}: {} ({})".format(sha, pull_request, body.strip(), author)) | ||
|
||
return changes | ||
|
||
|
||
if __name__ == '__main__': | ||
previous_sha = sys.argv[1] | ||
changes = get_change_log(previous_sha) | ||
|
||
for change in changes: | ||
print change |