Setting up this project is easy! To do it, follow these steps in this order:
npm install
Among other things, this will force the Use All Five coding style guides for JavaScript and SCSS.
To ensure the latter, install the following packages for Sublime Text (or similiar IDE):
pre-commit install
This should install the following pre-commit linters:
bower install
Create a secret.yml
and update with sample info:
secret:
staging:
path: '/path/to/site/'
host: ua5.land
username:
password:
prod:
path: '/'
host:
username:
port: 8082
Feel free to change the port to your liking, and also obtain push access from a fellow Fiver. Feel free to leave staging information blank.
Our grunt watch task does a handful of things, such as livereload, serve the site, etc. You’ll need to run it while you work on the site.
grunt
brew install selenium-server-standalone
npm install -g protractor
webdriver-manager update
Run the Selenium server: webdriver-manager start
Run the grunt test task: grunt test
You’ll want to do a build to make sure all the dependencies load correctly. This will essentially be what gets deployed.
grunt build
To push to staging, run:
grunt stage
This assumes you have python installed already.
[sudo] pip install virtualenv
Name a new virtualenv directory ('verygd' in this example).
virtualenv ~/verygd
Activate it.
source ~/verygd/bin/activate
Keep this virtualenv active for subsequent steps, and in general before running any project-related commands.
Change to the project directory and run
pip install -r requirements.txt
May need to install django
sudo pip install django --upgrade
export DEV_ENV=True
export DJANGO_SECRET_KEY='YOUR KEY'
Run source ~/.bash_profile
Create a database, perhaps use MAMP
Edit /etc/mysql.cnf
with your verygd db info:
[client]
database = verygd
host = localhost
user = root
password = root
default-character-set = utf8
socket = /Applications/MAMP/tmp/mysql/mysql.sock
Run the server
source ~/verygd/bin/activate
python manage.py runserver
Obtain the very.gd pem file and securely copy the file to your ~/.ssh
directory.
Assuming your ssh-agent
is active, ssh-add
the very.gd pem file to your ssh-agent
.
To deploy the latest from the deployment
branch, you'll need to run the deployment fabric command.
fab -R staging deploy -u ubuntu