Getting started with drie push¶
Warning
drie push is currently in beta and the APIs are subject to change as we stabilise the product. If something that was working stops working, please come back to the documentation to see if new behaviour is documented. If there’s no explanation, then please let us know.
Deploying¶
drie push has only 3 requirements:
- a working git installation with key based ssh authentication set up
- an application that can be built with a buildpack
- a strong desire to develop your application fast
Clone the example drie push application to get started:
git clone https://github.com/drie/demo-starter-app.git
cd demo-starter-app
Each drie push repository needs to have a unique application name. If the name you choose is already taken your push will be rejected. You can choose any free name but the quickest way to try drie is to generate a random app name like so:
app_name=$(curl -s http://m.rang.app.push.drieapp.co)
Note
If you do choose your own app name only alphanums for now please. Anything else will be rejected.
Once you have an app name add drie push as a remote repository to any buildpack compatible app and simply push it to deploy:
git remote add drie ${app_name}.app@push.drieapp.co:code.git
git push drie master
Note
The drie push RSA key fingerprint is SHA256:GuSpLmrT6IZc7xPICSEITirfW5jD6a3YWc+jhR9+ZiA
Your app is now deployed to master.${app_name}.app.push.drieapp.co
, you can visit that page in your browser, it demonstrates the next step in the getting started tutorial.
Branching¶
The real magic is that drie push supports the branching model you already use in git. Branch, make changes and push and your app will be deployed to a URL unique to that branch:
git checkout -b featurex
git push drie featurex
That branch is now deployed to featurex.${app_name}.app.push.drieapp.co
, with master.${app_name}.app.push.drieapp.co
running exactly as before. You can create and deploy as many branches as you want. Create a branch for dev, QA and prod, for each team member, for each feature. Put a different app in a branch. Anything that works with git branches you can push to drie push.
Logging in to your app¶
Often the quickest way to troubleshoot a problem is to log into the server running your app and run it. You may also want to log in to run database migrations, check production settings, etc. drie push lets you log into an ephemeral instance of a branch on your app over SSH by specifying the branch name as part of the user name:
ssh ${branch_name}.${app_name}.app@push.drieapp.co
Logs¶
Warning
This API is in alpha and will change often. Check back here if things stop working.
Viewing logs is also done over SSH. A branch can be specified in the same way as logging into your app to view only logs for that branch. If no branch is specified then all branches logs are shown:
ssh ${branch_name}.${app_name}.app@push.drieapp.co logs
To view logs for all branches:
ssh ${app_name}.app@push.drieapp.co logs
Configuration¶
Warning
This API is in alpha and will change often. Check back here if things stop working.
Configuration is passed into applications via environment variables and is done in the same way as logging into your app. Configuration is currently application wide and so doesn’t require a branch name:
ssh ${app_name}.app@push.drieapp.co configure environment -s KEY=value
Scheduling¶
Warning
This API is in alpha and will change often. Check back here if things stop working.
To schedule a command you need to create a .drie.yml
file and define a command with a cron schedule attached in it:
commands:
my-task:
cron: "* * * * *"
command: ls /
Scheduled commands are limited to 30 minutes. Only one at a time can run which means that if a task is scheduled to run every minute but takes a minute and a half to run it will only run every two minutes.