Add test for the multi buildpack, courtesy of https://github.com/AlJohri

This commit is contained in:
rhy-jot
2014-03-08 13:28:02 -08:00
parent f6b7b62b15
commit 2368f2d65d
16 changed files with 180 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
{
"directory": "static/components"
}

View File

@@ -0,0 +1,3 @@
https://github.com/heroku/heroku-buildpack-ruby
https://github.com/heroku/heroku-buildpack-nodejs
https://github.com/heroku/heroku-buildpack-python

6
tests/apps/multi/.gitignore vendored Normal file
View File

@@ -0,0 +1,6 @@
node_modules
static/components
static/.tmp
.sass-cache
.bundle
.DS_Store

1
tests/apps/multi/.npmrc Normal file
View File

@@ -0,0 +1 @@
unsafe-perm = true

6
tests/apps/multi/Gemfile Normal file
View File

@@ -0,0 +1,6 @@
source "https://rubygems.org"
ruby '1.9.3'
gem 'compass'
gem 'sass-globbing'

View File

@@ -0,0 +1,19 @@
GEM
remote: https://rubygems.org/
specs:
chunky_png (1.3.0)
compass (0.12.3)
chunky_png (~> 1.2)
fssm (>= 0.2.7)
sass (= 3.2.14)
fssm (0.2.10)
sass (3.2.14)
sass-globbing (1.1.0)
sass (>= 3.1)
PLATFORMS
ruby
DEPENDENCIES
compass
sass-globbing

View File

@@ -0,0 +1,43 @@
'use strict';
module.exports = function (grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
compass: {
options: {
sassDir: 'static/styles',
cssDir: 'static/.tmp/styles',
generatedImagesDir: 'static/.tmp/images/generated',
imagesDir: 'static/images',
javascriptsDir: 'static/scripts',
fontsDir: 'static/styles/fonts',
importPath: 'static/components',
httpImagesPath: '/images',
httpGeneratedImagesPath: '/images/generated',
httpFontsPath: '/styles/fonts',
relativeAssets: false,
assetCacheBuster: false,
bundleExec: true,
raw: 'Sass::Script::Number.precision = 10\n'
},
dist: {
options: {
// generatedImagesDir: '<%= yeoman.dist %>/static/images/generated'
}
},
server: {
options: {
debugInfo: false
}
}
}
});
grunt.registerTask('heroku', [
'compass:server'
]);
};

View File

@@ -0,0 +1 @@
web: python app.py

View File

@@ -0,0 +1,3 @@
This is a sample application to test heroku buildpack multi for integrating with buildstep: https://github.com/progrium/buildstep/pull/75
I am choosing to use the python, nodejs, and ruby buildpacks to create a very simple flask app that performs a bower install and a simple grunt task using compass.

15
tests/apps/multi/app.py Normal file
View File

@@ -0,0 +1,15 @@
import os
from flask import Flask, render_template
from werkzeug.wsgi import SharedDataMiddleware
app = Flask(__name__)
@app.route('/')
def hello_world():
return render_template('index.html')
app.wsgi_app = SharedDataMiddleware(app.wsgi_app, { '/': os.path.join(os.path.dirname(__file__), 'static') })
app.wsgi_app = SharedDataMiddleware(app.wsgi_app, { '/': os.path.join(os.path.dirname(__file__), 'static/.tmp') })
if __name__ == '__main__':
app.run(host='0.0.0.0', debug=True)

View File

@@ -0,0 +1,20 @@
{
"name": "test-buildpack-multi",
"version": "0.0.0",
"authors": [
"Al Johri <al.johri@gmail.com>"
],
"license": "MIT",
"private": true,
"directory": "static/components",
"ignore": [
"**/.*",
"node_modules",
"statc/components",
"test",
"tests"
],
"dependencies": {
"bootstrap-sass": "twbs/bootstrap-sass#~3.1.1"
}
}

2
tests/apps/multi/check_deploy Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/bash
set -e; curl -s $1 | grep -q "Heroku Multi Buildpack on Dokku"

View File

@@ -0,0 +1,17 @@
{
"name": "test-buildpack-multi",
"version": "0.0.0",
"description": "Test application for heroku multi buildpack.",
"author": "Al Johri",
"license": "ISC",
"dependencies": {
"bower": "~1.2.8",
"grunt": "~0.4.1",
"grunt-cli": "~0.1.13",
"load-grunt-tasks": "~0.2.0",
"grunt-contrib-compass": "~0.6.0"
},
"scripts": {
"postinstall": "./node_modules/bower/bin/bower --allow-root install && ./node_modules/grunt-cli/bin/grunt heroku"
}
}

View File

@@ -0,0 +1 @@
Flask==0.10.1

View File

@@ -0,0 +1,6 @@
// override scss variables within bootsrap by delaring them
// before importing bootstrap
$brand-primary: #428bca !default;
@import "bootstrap-sass/vendor/assets/stylesheets/bootstrap";

View File

@@ -0,0 +1,34 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Sample Webpage</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link rel="stylesheet" type="text/css" href="/styles/main.css">
<script type="text/javascript" src="/components/bootstap-sass/vendor/assets/javascripts/bootstrap/bootstrap.js"></script>
</head>
<body>
<div class="container">
<div class="row clearfix">
<div class="col-md-12 column">
<div class="jumbotron">
<h1>
Hello, world!
</h1>
<p>
This is a sample website using the Heroku Multi Buildpack on Dokku. It uses the python, ruby, and node buildpacks. The node buildpack is for using bower and grunt. The ruby buildpack is for running compass. And last but not last, the python buildpack is to run the flask application.
</p>
<p>
<a class="btn btn-primary btn-large" href="#">Learn more</a>
</p>
</div>
</div>
</div>
</div>
</body>
</html>