github.com/inflatablewoman/deis@v1.0.1-0.20141111034523-a4511c46a6ce/docs/using_deis/using-buildpacks.rst (about)

     1  :title: Deploying with Heroku Buildpacks on Deis
     2  :description: How to deploy applications on Deis using Heroku Buildpacks
     3  
     4  .. _using-buildpacks:
     5  
     6  Using Buildpacks
     7  ================
     8  Deis supports deploying applications via `Heroku Buildpacks`_.
     9  Buildpacks are useful if you're interested in following Heroku's best practices for building applications or if you are deploying an application that already runs on Heroku.
    10  
    11  Prepare an Application
    12  ----------------------
    13  If you do not have an existing application, you can clone an example application that demonstrates the Heroku Buildpack workflow.
    14  
    15  .. code-block:: console
    16  
    17      $ git clone https://github.com/deis/example-ruby-sinatra.git
    18      $ cd example-ruby-sinatra
    19  
    20  Create an Application
    21  ---------------------
    22  Use ``deis create`` to create an application on the :ref:`controller`.
    23  
    24  .. code-block:: console
    25  
    26      $ deis create
    27      Creating application... done, created unisex-huntress
    28      Git remote deis added
    29  
    30  Push to Deploy
    31  --------------
    32  Use ``git push deis master`` to deploy your application.
    33  
    34  .. code-block:: console
    35  
    36      $ git push deis master
    37      Counting objects: 95, done.
    38      Delta compression using up to 8 threads.
    39      Compressing objects: 100% (52/52), done.
    40      Writing objects: 100% (95/95), 20.24 KiB | 0 bytes/s, done.
    41      Total 95 (delta 41), reused 85 (delta 37)
    42      -----> Ruby app detected
    43      -----> Compiling Ruby/Rack
    44      -----> Using Ruby version: ruby-1.9.3
    45      -----> Installing dependencies using 1.5.2
    46             Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
    47             Fetching gem metadata from http://rubygems.org/..........
    48             Fetching additional metadata from http://rubygems.org/..
    49             Using bundler (1.5.2)
    50             Installing tilt (1.3.6)
    51             Installing rack (1.5.2)
    52             Installing rack-protection (1.5.0)
    53             Installing sinatra (1.4.2)
    54             Your bundle is complete!
    55             Gems in the groups development and test were not installed.
    56             It was installed into ./vendor/bundle
    57             Bundle completed (8.81s)
    58             Cleaning up the bundler cache.
    59      -----> Discovering process types
    60             Procfile declares types -> web
    61             Default process types for Ruby -> rake, console, web
    62      -----> Compiled slug size is 12M
    63      -----> Building Docker image
    64      Uploading context 11.81 MB
    65      Uploading context
    66      Step 0 : FROM deis/slugrunner
    67       ---> 5567a808891d
    68      Step 1 : RUN mkdir -p /app
    69       ---> Running in a4f8e66a79c1
    70       ---> 5c07e1778b9e
    71      Removing intermediate container a4f8e66a79c1
    72      Step 2 : ADD slug.tgz /app
    73       ---> 52d48b1692e5
    74      Removing intermediate container e9dfce920e26
    75      Step 3 : ENTRYPOINT ["/runner/init"]
    76       ---> Running in 7a8416bce1f2
    77       ---> 4a18f93f1779
    78      Removing intermediate container 7a8416bce1f2
    79      Successfully built 4a18f93f1779
    80      -----> Pushing image to private registry
    81  
    82             Launching... done, v2
    83  
    84      -----> unisex-huntress deployed to Deis
    85             http://unisex-huntress.local.deisapp.com
    86  
    87             To learn more, use `deis help` or visit http://deis.io
    88  
    89      To ssh://git@local.deisapp.com:2222/unisex-huntress.git
    90       * [new branch]      master -> master
    91  
    92      $ curl -s http://unisex-huntress.local.deisapp.com
    93      Powered by Deis!
    94  
    95  Because a Heroku-style application is detected, the ``web`` process type is automatically scaled to 1 on first deploy.
    96  
    97  Included Buildpacks
    98  -------------------
    99  For convenience, a number of buildpacks come bundled with Deis:
   100  
   101   * `Ruby Buildpack`_
   102   * `Nodejs Buildpack`_
   103   * `Java Buildpack`_
   104   * `Gradle Buildpack`_
   105   * `Grails Buildpack`_
   106   * `Play Buildpack`_
   107   * `Python Buildpack`_
   108   * `PHP Buildpack`_
   109   * `Clojure Buildpack`_
   110   * `Scala Buildpack`_
   111   * `Go Buildpack`_
   112   * `Multi Buildpack`_
   113  
   114  Deis will cycle through the ``bin/detect`` script of each buildpack to match the code you
   115  are pushing.
   116  
   117  Using a Custom Buildpack
   118  ------------------------
   119  To use a custom buildpack, set the ``BUILDPACK_URL`` environment variable.
   120  
   121  .. code-block:: console
   122  
   123      $ deis config:set BUILDPACK_URL=https://github.com/dpiddy/heroku-buildpack-ruby-minimal
   124      Creating config... done, v2
   125  
   126      === humble-autoharp
   127      BUILDPACK_URL: https://github.com/dpiddy/heroku-buildpack-ruby-minimal
   128  
   129  On your next ``git push``, the custom buildpack will be used.
   130  
   131  
   132  .. _`Ruby Buildpack`: https://github.com/heroku/heroku-buildpack-ruby
   133  .. _`Nodejs Buildpack`: https://github.com/heroku/heroku-buildpack-nodejs
   134  .. _`Java Buildpack`: https://github.com/heroku/heroku-buildpack-java
   135  .. _`Gradle Buildpack`: https://github.com/heroku/heroku-buildpack-gradle
   136  .. _`Grails Buildpack`: https://github.com/heroku/heroku-buildpack-grails
   137  .. _`Play Buildpack`: https://github.com/heroku/heroku-buildpack-play
   138  .. _`Python Buildpack`: https://github.com/heroku/heroku-buildpack-python
   139  .. _`PHP Buildpack`: https://github.com/deis/heroku-buildpack-php
   140  .. _`Clojure Buildpack`: https://github.com/heroku/heroku-buildpack-clojure
   141  .. _`Scala Buildpack`: https://github.com/heroku/heroku-buildpack-scala
   142  .. _`Go Buildpack`: https://github.com/kr/heroku-buildpack-go
   143  .. _`Multi Buildpack`: https://github.com/heroku/heroku-buildpack-multi
   144  .. _`Heroku Buildpacks`: https://devcenter.heroku.com/articles/buildpacks