Permalink
Browse files

Add nodejs and front end tools

  • Loading branch information...
ifdattic committed Oct 3, 2014
1 parent ec87b10 commit 1a651a94c134a80eb9895b4eb5aee99d37ad5823
Showing with 138 additions and 0 deletions.
  1. +3 −0 .bowerrc
  2. +8 −0 .ebextensions/03-main.config
  3. +47 −0 .ebextensions/bin/install-nodejs.sh
  4. +29 −0 Gruntfile.js
  5. +23 −0 bower.json
  6. +28 −0 package.json
@@ -0,0 +1,3 @@
{
"directory": "web/assets/vendor"
}
@@ -5,10 +5,18 @@ commands:
300-composer-update:
command: "export COMPOSER_HOME=/root && composer.phar self-update -n"
container_commands:
100-install-nodejs:
command: "source .ebextensions/bin/install-nodejs.sh"
200-copy-apache-config:
command: "cp .ebextensions/apache/zapplication.conf /etc/httpd/conf.d/zapplication.conf"
300-run-composer:
command: "composer.phar install --no-dev --optimize-autoloader --prefer-dist --no-interaction"
400-install-npm-packages:
command: "npm install"
425-install-bower-packages:
command: "bower install --allow-root"
450-run-grunt:
command: "grunt production"
550-dump-assets:
command: "php app/console assetic:dump"
600-update-cache:
@@ -0,0 +1,47 @@
#!/bin/bash

hash_file="/tmp/nodejshash"

check_if_npm_packages_has_to_be_installed () {
if [ -f $hash_file ]; then
check_if_same_hash
else
return 0
fi
}

check_if_same_hash () {
hash_new="$(md5sum .ebextensions/bin/install-nodejs.sh 2> /dev/null | cut -d ' ' -f 1)"
hash_current="$(cat "$hash_file" 2> /dev/null | cut -d ' ' -f 1)"

if [ $hash_new == $hash_current ]; then
return 1
else
return 0
fi
}

install_node () {
if hash nodejs 2> /dev/null; then
echo 'nodejs install, add more processing if needed' > /dev/null
else
curl -sL https://rpm.nodesource.com/setup | bash -
yum install -y nodejs-0.10.32
fi
}

install_npm_packages () {
npm install -g bower
npm install -g grunt-cli
}

update_current_hash () {
echo $hash_new > $hash_file
}

install_node

if check_if_npm_packages_has_to_be_installed; then
install_npm_packages
update_current_hash
fi
@@ -0,0 +1,29 @@
module.exports = function (grunt) {
var jsFilePaths = [
'js/*.js',
'js/app/*.js',
'js/app/modules/*.js'
];

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),

appDir: 'web/assets',

jshint: {
options: {
reporter: require('jshint-stylish')
},
all: [
'Gruntfile.js',
'<%= appDir %>/js/{,*/}*.js'
]
}
});

grunt.loadNpmTasks('grunt-contrib-jshint');

grunt.registerTask('default', ['jshint']);

grunt.registerTask('production', ['jshint']);
};
@@ -0,0 +1,23 @@
{
"name": "symfony-deploy-aws-eb-articlee",
"version": "0.0.0",
"homepage": "https://github.com/ifdattic/symfony-deploy-aws-eb-article.git",
"authors": [
{
"name": "Andrew (Andrius) Marcinkevicius",
"email": "andrew.web@ifdattic.com",
"homepage": "http://ifdattic.com"
}
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"bootstrap": "~3.2.0"
}
}
@@ -0,0 +1,28 @@
{
"name": "roosymfony-deploy-aws-eb-articlekfire",
"version": "0.0.0",
"description": "",
"main": "",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/ifdattic/symfony-deploy-aws-eb-article.git"
},
"author": {
"name": "Andrew (Andrius) Marcinkevicius",
"email": "andrew.web@ifdattic.com",
"homepage": "http://ifdattic.com"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/ifdattic/symfony-deploy-aws-eb-article/issues"
},
"homepage": "https://github.com/ifdattic/symfony-deploy-aws-eb-article",
"devDependencies": {
"grunt": "^0.4.5",
"grunt-contrib-jshint": "^0.10.0",
"jshint-stylish": "^1.0.0"
}
}

0 comments on commit 1a651a9

Please sign in to comment.