-
Notifications
You must be signed in to change notification settings - Fork 20
Terraform
For City team members.
You can push your local repository up to a test instance on our staging cluster on AWS. This will let you show off functionality using data from a staging snapshot of Boston.gov.
- You will need Docker installed on your local machine
- Install the AWS Command Line Interface
- Get a “CLI” IAM user with an access key and secret key
- Use
aws configure
to log your CLI user in locally. Useus-east-1
as the default region.
To create a place to upload your code, follow the instructions in the CityOfBoston/digital-terraform repo to make a “variant” of the Boston.gov staging deployment.
To push your local repository up to the cluster, run:
$ ./doit stage <variant>
Where “<variant>
” is the variant name you created in
CityOfBoston/digital-terraform
.
This will build a container image locally and upload it to ECR. It will then update your staging ECS service to use the new code.
By default, the container startup process will initialize its MySQL database with a snapshot of the staging environment from Acquia.
After the container starts up and is healthy, the doit
script will print
useful URLs and then quit.
Direct SSH access is not generally available on the ECS cluster. To run drush
commands on your test instance, you can visit the webconsole.php
page at its
domain. This will give you a shell prompt where you can run e.g. drush uli
to get a login link.
The webconsole.php
shell starts in docroot
.
Talk to another developer to get the username and password.
By default, each time you deploy code to your test instance it starts with a fresh copy of the Drupal database.
If you want to preserve state between test runs, log in to webconsole.php
and
run:
$ ../doit stash-db
(The ..
is because webconsole.php
starts in the docroot
.)
This will take a snapshot of your database and upload it to S3. The next time your test instance starts up, it will start its sync from this database rather than the Acquia staging one.
To clear the stash, so that your database starts fresh on the next test instance
push, use webconsole.php
to run:
$ ../doit stash-db reset
This project is in the worldwide public domain. As stated in LICENSE:
This project is in the public domain within the United States, and copyright and related rights in the work worldwide are waived through the CC0 1.0 Universal public domain dedication.
All contributions to this project will be released under the CC0 dedication. By submitting a pull request, you are agreeing to comply with this waiver of copyright interest.
DoIT homepage |
---|