Merge pull request #318 from EverythingMe/docs_setup

Packer: make re:dash version configurable
This commit is contained in:
Arik Fraimovich 2014-10-22 12:01:32 +03:00
commit eb99fa5671
2 changed files with 15 additions and 7 deletions

View File

@ -98,8 +98,10 @@ if [ ! -f "/opt/redash/.env" ]; then
fi fi
# Install latest version # Install latest version
LATEST_URL="https://github.com/EverythingMe/redash/releases/download/v0.4.0%2Bb563/redash.0.4.0.b563.tar.gz" REDASH_VERSION=${REDASH_VERSION-0.4.0.b589}
VERSION_DIR=/opt/redash/redash.0.4.0.b563 LATEST_URL="https://github.com/EverythingMe/redash/releases/download/v${REDASH_VERSION/.b/%2Bb}/redash.$REDASH_VERSION.tar.gz"
VERSION_DIR="/opt/redash/redash.$REDASH_VERSION"
REDASH_TARBALL=/tmp/redash.tar.gz
REDASH_TARBALL=/tmp/redash.tar.gz REDASH_TARBALL=/tmp/redash.tar.gz
if [ ! -d "$VERSION_DIR" ]; then if [ ! -d "$VERSION_DIR" ]; then
@ -155,6 +157,9 @@ pip install google-api-python-client==1.2 pyOpenSSL==0.14 oauth2client==1.2
apt-get install -y libmysqlclient-dev apt-get install -y libmysqlclient-dev
pip install MySQL-python==1.2.5 pip install MySQL-python==1.2.5
# Mongo dependencies:
pip install pymongo==2.7.2
# Setup supervisord + sysv init startup script # Setup supervisord + sysv init startup script
sudo -u redash mkdir -p /opt/redash/supervisord sudo -u redash mkdir -p /opt/redash/supervisord
pip install supervisor==3.1.2 # TODO: move to requirements.txt pip install supervisor==3.1.2 # TODO: move to requirements.txt

View File

@ -1,7 +1,9 @@
{ {
"variables": { "variables": {
"aws_access_key": "", "aws_access_key": "",
"aws_secret_key": "" "aws_secret_key": "",
"redash_version": "0.4.0.b589",
"image_version": "040b589"
}, },
"builders": [ "builders": [
{ {
@ -13,7 +15,7 @@
"source_ami": "ami-fe7cc796", "source_ami": "ami-fe7cc796",
"instance_type": "t2.micro", "instance_type": "t2.micro",
"ssh_username": "ubuntu", "ssh_username": "ubuntu",
"ami_name": "redash-040b563-us-east-1" "ami_name": "redash-{{user `image_version`}}-us-east-1"
}, },
{ {
"name": "redash-eu-west-1", "name": "redash-eu-west-1",
@ -24,7 +26,7 @@
"source_ami": "ami-d2ff50a5", "source_ami": "ami-d2ff50a5",
"instance_type": "t2.micro", "instance_type": "t2.micro",
"ssh_username": "ubuntu", "ssh_username": "ubuntu",
"ami_name": "redash-040b563-eu-west-1" "ami_name": "redash-{{user `image_version`}}-eu-west-1"
}, },
{ {
"type": "googlecompute", "type": "googlecompute",
@ -34,13 +36,14 @@
"project_id": "redash-bird-123", "project_id": "redash-bird-123",
"source_image": "debian-7-wheezy-v20141017", "source_image": "debian-7-wheezy-v20141017",
"zone": "us-central1-a", "zone": "us-central1-a",
"image_name": "redash-040b563" "image_name": "redash-{{user `image_version`}}"
} }
], ],
"provisioners": [ "provisioners": [
{ {
"type": "shell", "type": "shell",
"script": "bootstrap.sh" "script": "bootstrap.sh",
"environment_vars": ["REDASH_VERSION={{user `redash_version`}}"]
} }
] ]
} }