Skip to content

babybuddy/babybuddy-sandstorm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Baby Buddy Sandstorm App

This is the source for the Baby Buddy app for Sandstorm.

App Version History

Caveats

  • Baby Buddy currently only supports setting the application time zone from an environment variable. This cannot be achieved with the regular Sandstorm grain workflow, so the timezone is locked to Etc/UTC. (Resolved as of v2)

  • Sandstorm user ID's are used for the username in Baby Buddy. This name is used for display throughout the app and is not terribly useful. (Resolved as of v2)

  • Baby Buddy's API has not been fully implemented with Sandbox's API integration.

Development

Primary development for the Baby Buddy application occurs at Baby Buddy on GitHub. This repository is specifically for the Sandstorm app build process.

Sandstorm configuration

The primary files for the Sandstorm app configuration are:

  • setup.sh: Installs nginx, uwsgi, pipenv, sqlite3 and git.

  • build.sh: Gets Baby Buddy application code from GitHub, creates an .env file for the application with settings location and a SECRET_KEY, checks out the version specified in sandstorm-pkgdef.capnp and establishes the virtual environment.

  • launcher.sh: Prepares system directories, runs application migrations, and starts uwsgi and nginx.

Updating Baby Buddy

Follow the steps below to update the version of Baby Buddy shipped with the Sandstorm app:

  1. Clone this repository.

    git clone git@github.com:babybuddy/babybuddy-sandstorm.git
  2. Move in to the repository.

    cd babybuddy-sandstorm
  3. Open the sandstorm-pkgdef.capnp file and set the "appMarketingVersion" directive to a new version of Baby Buddy and increment the "appVersion" directive by one.

    editor .sandstorm/sandstorm-pkgdef.capnp
  4. Start the VM via Vagrant SPK.

    vagrant-spk vm up
  5. Run the Vagrant SPK dev instance.

    vagrant-spk dev

    Note: Confirm that sandstorm.patch still applies during this command execution and update the patch if necessary.

  6. Test new/modified functionality in the Sandstorm dev environment.

    browse http://local.sandstorm.io:6080
  7. When ready, stop the development app (Ctrl-C) and clean the files list.

    ./clean-sandstorm-files.sh
  8. Pack the new SPK! 🎉

    vagrant-spk pack ~/babybuddy.spk

If Sandstorm specific changes need to updated or the patch no longer applies, a new patch will need to created:

  1. Follow the steps in the Development documentation above up to the vagrant-spk dev command.

  2. Stop the development app (Ctrl-C).

  3. Move in to the babybuddy folder.

    cd babybuddy
  4. Apply the patch using 3way merge so conflicts will be created.

    git apply --3way ../sandstorm.patch
  5. Resolve any conflicts and make additional changes as needed.

  6. Add all files to git.

    git add --all
  7. Create a diff of the changes and save it to sandstorm.patch.

    git diff HEAD > ../sandstorm.patch
  8. Return to the main repository folder and start the vagrant dev instance.

    cd ..
    vagrant-spk dev

If the patch update was successful, the new patch should apply cleanly during the build phase.