dog-years

dog-years

I created this simple web app because I recently got a puppy and constantly get asked how old he is… but never actually know the right answer. Using the playbooks in this repo, you can easily spin up a progressive web app that can be pinned to the home screen on your phone!

Hosting Support

Currently, hosting options are limited, but I hope to add more in the future. Feel free to fork or merge additional support for new platforms.

Supported:

  • Apache2 (tested on Raspbian)
  • Firebase
  • AWS (S3)

Roadmap:

  • Azure (Blob)

Simple Setup

  1. Clone this repository
  2. Populate dog_info.yml with your dog’s information
  3. Install Ansible on your control machine
  4. Install other python reqs pip install -r requirements.txt
  5. Install role reqs ansible-galaxy install -r roles/requirements.yml
  6. Choose hosting platform

Apache2

  • Copy inventory.example to inventory and populate the placeholder variables to tell Ansible where to deploy the site
  • Complete SSH setup so that Ansible can use privilege escalation for tasks when needed

Firebase

  • Create a Firebase account
  • Create a new project (remember the name for later!)
  • Install the Firebase CLI
  • Generate a token for your automated deployment
    • firebase login:ci
  • Export the token
    • export FIREBASE_TOKEN=<token>

AWS

  • Create an AWS account
  • Generate an access key ID and secret key
  • Configure the CLI aws configure
  • Confirm configuration succeeded aws configure list

Deploying the Site

Included in the repo are a few Ansible playbooks used to deploy the site to a specified host service. To take advantage of Ansible Automation, run one of the following commands:

  • Apache2: ansible-playbook site.yml -e host_service=apache
  • Firebase ansible-playbook site.yml -e host_service=firebase -e project_name=<project-name> [-e firebase_token=<token>]
  • AWS: ansible-playbook site.yml -e host_service=aws -e project_name=<project-name>

Testing the Site

A simple smoke test playbook is included in the repo as well. To run, use the following command:

  • ansible-playbook smoke-test.yml -e host_service=<chosen-service> [-e project_name=<project-name]

Visit original content creator repository
https://github.com/zjleblanc/dog-years

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *