Getting started with drie push ============================== .. include:: beta.rst 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 ---- .. include:: alpha-api.rst 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 ------------- .. include:: alpha-api.rst 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 ---------- .. include:: alpha-api.rst 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.