Giter Club home page Giter Club logo

heroku-buildpack-vibe.d's Introduction

Heroku buildpack for vibe.d

Based mostly on https://bitbucket.org/mikehouston/heroku-buildpack-d/.

Note on heroku stacks

  • master and cedar-14 branches target classical cedar stack and newer cedar-14 stack, respectively.
    • See here for details about heroku stacks.
  • You can specify buildpack's branch name by the fragment part of your BUILDPACK_URL, e.g. https://github.com/skirino/heroku-buildpack-vibe.d.git#cedar-14.

Example usage

# Prepare local vibe.d project (See the next section for more detail)
$ cd heroku-buildpack-vibe.d
$ cp -r example ~/
$ cd ~/example
$ git init
Initialized empty Git repository in /home/skirino/example/.git/
$ git add .
$ git commit -m "Initial commit"
...

# Create a new heroku app
$ heroku apps:create -s cedar --buildpack 'https://github.com/skirino/heroku-buildpack-vibe.d.git#master'
Creating peaceful-shore-2762... done, region is us
BUILDPACK_URL=https://github.com/skirino/heroku-buildpack-vibe.d.git
http://peaceful-shore-2762.herokuapp.com/ | [email protected]:peaceful-shore-2762.git
Git remote heroku added

# Git push (this may take a little time for the first time)
$ git push heroku master:master
Counting objects: 9, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (9/9), 997 bytes, done.
Total 9 (delta 0), reused 0 (delta 0)

-----> Fetching custom git buildpack... done
-----> D (dub package manager) app detected

-----> Building libevent
...

-----> Building libev
...

-----> Downloading DMD
...

-----> Downloading dub package manager
...

-----> Setting PATH:
...

-----> Initializing toolchain

-----> Building app

       Running dub build
Checking dependencies in '/tmp/build_daa1a32d-c53a-47e0-8811-1a077358079b'
The following changes will be performed:
Install vibe-d >=0.7.17, userWide
Install libevent ~master, userWide
Install openssl ~master, userWide
Install libev ~master, userWide
Downloading vibe-d 0.7.18-beta.1...
Installing vibe-d 0.7.18-beta.1...
vibe-d has been installed with version 0.7.18-beta.1
Downloading libevent ~master...
Installing libevent ~master...
libevent has been installed with version ~master
Downloading openssl ~master...
Installing openssl ~master...
openssl has been installed with version ~master
Downloading libev ~master...
Installing libev ~master...
libev has been installed with version ~master
Building configuration "application", build type release
Running dmd (compile)...
Compiling diet template 'index.dt' (compat)...
Linking...

       Build was successful
-----> Discovering process types
       Procfile declares types -> web

-----> Compiled slug size: 3.5MB
-----> Launching... done, v4
       http://peaceful-shore-2762.herokuapp.com deployed to Heroku

To [email protected]:peaceful-shore-2762.git
 * [new branch]      master -> master

# Send request to the running app
$ curl http://peaceful-shore-2762.herokuapp.com/

<!DOCTYPE html>
<html>
	<head>
		<title>vibe.d heroku buildpack example</title>
	</head>
	<body>
		<h1>vibe.d running on Heroku!</h1>
	</body>
</html>

Required settings of vibe.d project

  • Add the following to dub.json in order to specify path to manually-installed libraries:
    • "lflags": ["-L/app/opt/lib"]
  • Create Procfile whose content looks something like the following:
    • web: LD_LIBRARY_PATH=/app/opt/lib ./vibed-heroku-example
  • Modify to listen to port given by Heroku as environment variable:
    • settings.port = environment.get("PORT", "8080").to!ushort;

Acknowledgment

  • @dkhasel fixed a problem due to outdated dub version. Thanks!

heroku-buildpack-vibe.d's People

Contributors

skirino avatar dkhasel avatar

Watchers

James Cloos avatar Irenej Marc avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.