Applings

Applings is an Iterapp feature which makes it possible to have different apps within one github-repository, and thus let applings also share code.

Say you would like to have an app for frontend and a different app for backend. This can easily be created by using the applings-feature. All your code will live in one repository with one commit log.


FrontendBackend
Github-repogithub.com/iterate/yourappgithub.com/iterate/yourapp
Mappe~/dev/iterate/yourapp/frontend~/dev/iterate/yourapp/backend/
URL i testhttps://frontend.yourapp.test.iterate.no/https://backend.yourapp.test.iterate.no/
URL i prodhttps://frontend.yourapp.app.iterate.no/https://backend.yourapp.app.iterate.no/

Applings are independent applications. They can have their own database and their own specific properties. Every time the app is deployed, all applings will be deployed.

V2✨ V3 ✨

So for instance all changes in all applings within github.com/iterate/yourapp will be deployed when running: /iterapp deploy yourapp prod main

So for instance all changes in all applings within github.com/iterate/yourapp will be deployed when running: hops v3 deploy -a yourapp -e prod -r main

Examples of what an appling can be:

  1. An appling for hosting documentation
  2. An appling as admin-panel

How to create applings?

Create the respective subdirectories where each applings will live. Each appling will need to have their own iterapp.toml-file! Then create an iterapp.toml-file on the root level with content:

applings = ["appling-a", "appling-b"]

Remember to update your Docker file

The Docker-build is run from the root of the github directory. Remember to update any paths within the dockerfile. Paths will need to be absolute.

Tip

See this repo for an example: Dockerfile for testapp-applings/appling-a

FROM nginx:alpine
ADD appling-a/public /usr/share/nginx/html

EXPOSE 80

Note

You must remember to use ADD appling-a/public and not ADD public.

Testing the build locally

Run the command from the appling-folder you would like to build.

  • -f "$(pwd)/Dockerfile" will use the Dockerfile in the current folder.
  • ../ will set the build-context to a level up (root-level) to make all applings code available.
docker build -f "$(pwd)/Dockerfile" ../

And if the build is a success, then that should be it. Commit, push, deploy and enjoy!