diff --git a/tests/apps/multi/.bowerrc b/tests/apps/multi/.bowerrc new file mode 100644 index 000000000..a12e6286d --- /dev/null +++ b/tests/apps/multi/.bowerrc @@ -0,0 +1,3 @@ +{ + "directory": "static/components" +} diff --git a/tests/apps/multi/.buildpacks b/tests/apps/multi/.buildpacks new file mode 100644 index 000000000..b314d14c0 --- /dev/null +++ b/tests/apps/multi/.buildpacks @@ -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 diff --git a/tests/apps/multi/.gitignore b/tests/apps/multi/.gitignore new file mode 100644 index 000000000..a337af834 --- /dev/null +++ b/tests/apps/multi/.gitignore @@ -0,0 +1,6 @@ +node_modules +static/components +static/.tmp +.sass-cache +.bundle +.DS_Store diff --git a/tests/apps/multi/.npmrc b/tests/apps/multi/.npmrc new file mode 100644 index 000000000..5af867361 --- /dev/null +++ b/tests/apps/multi/.npmrc @@ -0,0 +1 @@ +unsafe-perm = true diff --git a/tests/apps/multi/Gemfile b/tests/apps/multi/Gemfile new file mode 100644 index 000000000..6f58bf725 --- /dev/null +++ b/tests/apps/multi/Gemfile @@ -0,0 +1,6 @@ +source "https://rubygems.org" + +ruby '1.9.3' + +gem 'compass' +gem 'sass-globbing' diff --git a/tests/apps/multi/Gemfile.lock b/tests/apps/multi/Gemfile.lock new file mode 100644 index 000000000..9554241ac --- /dev/null +++ b/tests/apps/multi/Gemfile.lock @@ -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 diff --git a/tests/apps/multi/Gruntfile.js b/tests/apps/multi/Gruntfile.js new file mode 100644 index 000000000..5423761fb --- /dev/null +++ b/tests/apps/multi/Gruntfile.js @@ -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' + ]); + +}; diff --git a/tests/apps/multi/Procfile b/tests/apps/multi/Procfile new file mode 100644 index 000000000..2e35818f6 --- /dev/null +++ b/tests/apps/multi/Procfile @@ -0,0 +1 @@ +web: python app.py diff --git a/tests/apps/multi/README.md b/tests/apps/multi/README.md new file mode 100644 index 000000000..dfe69e6e0 --- /dev/null +++ b/tests/apps/multi/README.md @@ -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. diff --git a/tests/apps/multi/app.py b/tests/apps/multi/app.py new file mode 100644 index 000000000..cb8ca6052 --- /dev/null +++ b/tests/apps/multi/app.py @@ -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) diff --git a/tests/apps/multi/bower.json b/tests/apps/multi/bower.json new file mode 100644 index 000000000..773511264 --- /dev/null +++ b/tests/apps/multi/bower.json @@ -0,0 +1,20 @@ +{ + "name": "test-buildpack-multi", + "version": "0.0.0", + "authors": [ + "Al Johri " + ], + "license": "MIT", + "private": true, + "directory": "static/components", + "ignore": [ + "**/.*", + "node_modules", + "statc/components", + "test", + "tests" + ], + "dependencies": { + "bootstrap-sass": "twbs/bootstrap-sass#~3.1.1" + } +} diff --git a/tests/apps/multi/check_deploy b/tests/apps/multi/check_deploy new file mode 100755 index 000000000..2a595019c --- /dev/null +++ b/tests/apps/multi/check_deploy @@ -0,0 +1,2 @@ +#!/bin/bash +set -e; curl -s $1 | grep -q "Heroku Multi Buildpack on Dokku" diff --git a/tests/apps/multi/package.json b/tests/apps/multi/package.json new file mode 100644 index 000000000..085f8d930 --- /dev/null +++ b/tests/apps/multi/package.json @@ -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" + } +} diff --git a/tests/apps/multi/requirements.txt b/tests/apps/multi/requirements.txt new file mode 100644 index 000000000..632a1efab --- /dev/null +++ b/tests/apps/multi/requirements.txt @@ -0,0 +1 @@ +Flask==0.10.1 diff --git a/tests/apps/multi/static/styles/main.scss b/tests/apps/multi/static/styles/main.scss new file mode 100644 index 000000000..93efb53fa --- /dev/null +++ b/tests/apps/multi/static/styles/main.scss @@ -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"; diff --git a/tests/apps/multi/templates/index.html b/tests/apps/multi/templates/index.html new file mode 100644 index 000000000..4e7806e85 --- /dev/null +++ b/tests/apps/multi/templates/index.html @@ -0,0 +1,34 @@ + + + + + + Sample Webpage + + + + + + + + +
+
+
+
+

+ Hello, world! +

+

+ 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. +

+

+ Learn more +

+
+
+
+
+ + +