This repository has been archived by the owner on Sep 28, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 40
Feature/js/setup dev environment #461
Merged
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
7798692
WIP
hectcastro d9834d8
Upgrade Celery and django-celery
hectcastro 138a8e4
Add psycopg2 to requirements
hectcastro 6f3da82
Simplify OS package install process
hectcastro 987ecd0
Get django to the point where it wants to talk to the database
jisantuc ad7a3f7
Fixup most staticfiles errors and remove more trailing spaces
jisantuc c8612bb
Use django-redis and django caching for cache interaction
jisantuc 4bd7bc2
Use azavea docker-django image
jisantuc e0b100a
Hide the secret key
jisantuc d28c4cd
Upgrade numpy and scipy because apparently we can
jisantuc 7d01d20
Fix postgres healthcheck and more loosely specify redis
jisantuc a794596
Include django-extensions for greater happiness
jisantuc 79ec1a0
Include some STRTA
jisantuc 94c89d1
Include provisioning scripts, VM, and ansible roles
jisantuc 1dee6b7
gitignore changes
jisantuc b94ec41
Update README
jisantuc 1d7a10f
Include test script and clean up lint
jisantuc 22fe021
Remove unused roles and update env variable names in STRTA
jisantuc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,40 @@ | ||
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
|
||
Vagrant.require_version ">= 1.8" | ||
|
||
Vagrant.configure(2) do |config| | ||
config.vm.box = "ubuntu/trusty64" | ||
|
||
config.vm.synced_folder "~/.aws", "/home/vagrant/.aws" | ||
|
||
# Need to use rsync in order to prevent a vboxfs/docker/gunicorn-related | ||
# file corruption issue. | ||
config.vm.synced_folder ".", "/vagrant", | ||
type: "rsync", | ||
rsync__exclude: ".git/", | ||
rsync__args: ["--verbose", "--archive", "--delete", "-z", "--links"] | ||
|
||
config.vm.provider :virtualbox do |vb| | ||
vb.memory = 2048 | ||
vb.cpus = 2 | ||
end | ||
|
||
# Gunicorn | ||
config.vm.network :forwarded_port, guest: 8080, host: 8080 | ||
|
||
# Django debug server | ||
config.vm.network :forwarded_port, guest: 8081, host: 8081 | ||
|
||
# Change working directory to /vagrant upon session start. | ||
config.vm.provision "shell", inline: <<SCRIPT | ||
if ! grep -q "cd /vagrant" "/home/vagrant/.bashrc"; then | ||
echo "cd /vagrant" >> "/home/vagrant/.bashrc" | ||
fi | ||
SCRIPT | ||
|
||
config.vm.provision "ansible" do |ansible| | ||
ansible.playbook = "deployment/ansible/district-builder.yml" | ||
ansible.galaxy_role_file = "deployment/ansible/roles.yml" | ||
end | ||
end |
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,14 @@ | ||
- hosts: all | ||
become: True | ||
|
||
pre_tasks: | ||
- name: Update APT cache | ||
apt: update_cache=yes cache_valid_time=3600 | ||
|
||
roles: | ||
- { role: "azavea.ntp" } | ||
- { role: "district-builder.environment" } | ||
- { role: "azavea.python-security" } | ||
- { role: "district-builder.docker" } | ||
- { role: "district-builder.aws-cli" } | ||
- { role: "district-builder.shellcheck" } |
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,7 @@ | ||
--- | ||
|
||
aws_cli_version: "1.11.*" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same with the removal of these two. |
||
aws_region: "us-east-1" | ||
aws_profile: "district-builder" | ||
shellcheck_version: "0.3.*" | ||
docker_compose_version: "1.16.*" |
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,14 @@ | ||
- src: azavea.pip | ||
version: 1.0.0 | ||
|
||
- src: azavea.docker | ||
version: 4.0.0 | ||
|
||
- src: azavea.unzip | ||
version: 0.1.2 | ||
|
||
- src: azavea.ntp | ||
version: 0.1.1 | ||
|
||
- src: azavea.python-security | ||
version: 0.1.0 |
3 changes: 3 additions & 0 deletions
3
deployment/ansible/roles/district-builder.aws-cli/meta/main.yml
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,3 @@ | ||
--- | ||
dependencies: | ||
- { role: azavea.pip } |
3 changes: 3 additions & 0 deletions
3
deployment/ansible/roles/district-builder.aws-cli/tasks/main.yml
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,3 @@ | ||
--- | ||
- name: Install AWS Command Line Interface | ||
pip: name=awscli version="{{ aws_cli_version }}" |
4 changes: 4 additions & 0 deletions
4
deployment/ansible/roles/district-builder.docker/meta/main.yml
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,4 @@ | ||
--- | ||
dependencies: | ||
- { role: azavea.pip } | ||
- { role: azavea.docker } |
8 changes: 8 additions & 0 deletions
8
deployment/ansible/roles/district-builder.docker/tasks/main.yml
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 @@ | ||
--- | ||
- name: Install docker-compose | ||
pip: name=docker-compose version={{ docker_compose_version }} | ||
|
||
- name: Add Ansible user to Docker group | ||
user: name="{{ ansible_user }}" | ||
groups=docker | ||
append=yes |
10 changes: 10 additions & 0 deletions
10
deployment/ansible/roles/district-builder.environment/tasks/main.yml
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,10 @@ | ||
--- | ||
- name: Set AWS_DEFAULT_REGION globally | ||
lineinfile: dest=/etc/environment | ||
regexp=^AWS_DEFAULT_REGION | ||
line="AWS_DEFAULT_REGION={{ aws_region }}" | ||
|
||
- name: Set AWS_PROFILE globally | ||
lineinfile: dest=/etc/environment | ||
regexp=^AWS_PROFILE | ||
line="AWS_PROFILE={{ aws_profile }}" |
4 changes: 4 additions & 0 deletions
4
deployment/ansible/roles/district-builder.shellcheck/tasks/main.yml
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,4 @@ | ||
--- | ||
- name: Install ShellCheck | ||
apt: pkg="shellcheck={{ shellcheck_version }}" | ||
state=present |
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 |
---|---|---|
@@ -1,2 +1,6 @@ | ||
settings.py | ||
static-media | ||
|
||
static/admin/ | ||
static/jqGrid/ | ||
static/openlayers/ |
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,43 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
if [[ -n "${RF_DEBUG}" ]]; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Stale variable name here. |
||
set -x | ||
fi | ||
|
||
DIR="$(dirname "$0")" | ||
|
||
|
||
function usage() { | ||
|
||
echo -n \ | ||
"Usage: $(basename "$0") | ||
Setup external project dependencies. | ||
" | ||
} | ||
|
||
|
||
function build_containers() { | ||
docker-compose build | ||
} | ||
|
||
|
||
function do_migrations() { | ||
./scripts/console django "./manage.py migrate" | ||
} | ||
|
||
|
||
if [ "${BASH_SOURCE[0]}" = "${0}" ] | ||
then | ||
if [ "${1:-}" = "--help" ] | ||
then | ||
usage | ||
else | ||
echo "Building containers" | ||
build_containers | ||
|
||
echo "Running migrations" | ||
do_migrations | ||
fi | ||
exit | ||
fi |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My assumption is that we're going to include AWS integration in the repo, but if that's not the case and we're just going to have containers and handle deployment of those containers separately, this can be removed. Currently the aws cli isn't being used for anything so it's a no-cost deletion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can keep it out for now.