Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
amitaibu committed Dec 25, 2014
0 parents commit 5b2911c
Show file tree
Hide file tree
Showing 115 changed files with 6,157 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
@@ -0,0 +1,12 @@
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions .gitattributes
@@ -0,0 +1 @@
* text=auto
6 changes: 6 additions & 0 deletions .gitignore
@@ -0,0 +1,6 @@
node_modules/


# Prevent from ignored files to be copied back.
app/templates/client/app/scripts/config.js
sync_hedley.sh
17 changes: 17 additions & 0 deletions .jshintrc
@@ -0,0 +1,17 @@
{
"node": true,
"esnext": true,
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"immed": true,
"indent": 2,
"latedef": true,
"newcap": true,
"noarg": true,
"quotmark": "single",
"undef": true,
"unused": true,
"strict": true
}
6 changes: 6 additions & 0 deletions .travis.yml
@@ -0,0 +1,6 @@
language: node_js
node_js:
- '0.10'
before_install:
- currentfolder=${PWD##*/}
- if [ "$currentfolder" != 'generator-hedley' ]; then cd .. && eval "mv $currentfolder generator-hedley" && cd generator-hedley; fi
1 change: 1 addition & 0 deletions .yo-rc.json
@@ -0,0 +1 @@
{}
47 changes: 47 additions & 0 deletions README.md
@@ -0,0 +1,47 @@
# generator-hedley [![Build Status](https://travis-ci.org/Gizra/generator-hedley.svg?branch=master)](https://travis-ci.org/Gizra/generator-hedley)

> [Yeoman](http://yeoman.io) generator

## Getting Started

### What is Yeoman?

Trick question. It's not a thing. It's this guy:

![](http://i.imgur.com/JHaAlBJ.png)

Basically, he wears a top hat, lives in your computer, and waits for you to tell him what kind of application you wish to create.

Not every new computer comes with a Yeoman pre-installed. He lives in the [npm](https://npmjs.org) package repository. You only have to ask for him once, then he packs up and moves into your hard drive. *Make sure you clean up, he likes new and shiny things.*

```bash
npm install -g yo
```

### Yeoman Generators

Yeoman travels light. He didn't pack any generators when he moved in. You can think of a generator like a plug-in. You get to choose what type of application you wish to create, such as a Backbone application or even a Chrome extension.

To install generator-hedley from npm, run:

```bash
npm install -g generator-hedley
```

Finally, initiate the generator:

```bash
yo hedley
```

### Getting To Know Yeoman

Yeoman has a heart of gold. He's a person with feelings and opinions, but he's very easy to work with. If you think he's too opinionated, he can be easily convinced.

If you'd like to get to know Yeoman better and meet some of his friends, [Grunt](http://gruntjs.com) and [Bower](http://bower.io), check out the complete [Getting Started Guide](https://github.com/yeoman/yeoman/wiki/Getting-Started).


## License

MIT
124 changes: 124 additions & 0 deletions app/index.js
@@ -0,0 +1,124 @@
'use strict';
var yeoman = require('yeoman-generator');
var changeCase = require('change-case');
var chalk = require('chalk');
var path = require('path');
var yosay = require('yosay');
var process = require('process');
var fs = require('fs-extra');
var glob = require('glob');
var replace = require('replace');

module.exports = yeoman.generators.Base.extend({
initializing: function () {
this.pkg = require('../package.json');
},
askForProjectName: function () {
var done = this.async();

// Have Yeoman greet the user.
this.log(yosay(
'Welcome to the ' + chalk.red('Hedley') + ' generator!'
));

var prompts = [{
name: 'projectName',
message: 'What is the project machine name?',
default: 'skeleton'
}];

this.prompt(prompts, function (props) {
this.projectName = props.projectName;

done();
}.bind(this));
},

askForGithubRepo: function () {
var done = this.async();

var prompts = [{
name: 'githubRepo',
message: 'What is the GitHub repo URL?',
default: ''
}];

this.prompt(prompts, function (props) {
this.githubRepo = props.githubRepo;

done();
}.bind(this));
},


writing: {
app: function() {
var self = this;
var files = glob.sync(self.templatePath() + '/**/*');

files.forEach(function(file) {
if (fs.lstatSync(file).isDirectory()) {
// Don't try to copy a directory.
return;
}

var fileName = file.replace(self.templatePath('/'), '');
var newFileName = fileName
.replace(/skeleton/g, self.projectName)
.replace(/Skeleton/g, changeCase.pascalCase(self.projectName));


var dir = path.dirname(newFileName);
var baseName = path.basename(newFileName);
var extension = path.extname(baseName);

if (extension !== '.scss') {
// If not a SCSS file, convert the prefix of the underscore to a dot.
baseName = baseName.replace(/^_/g, '.');
}

newFileName = dir ? dir + '/' + baseName : baseName;

if (extension !== '.png') {
// Not an image.
var contents = self.fs.read(self.templatePath(fileName));
var newContents = contents
.replace(/skeleton/g, self.projectName)
.replace(/Skeleton/g, changeCase.pascalCase(self.projectName));

self.fs.write(newFileName, newContents);
}
else {
self.fs.copy(self.templatePath(fileName), self.destinationPath(newFileName));
}

});
}
},

install: {

/**
* Install bower/ npm on the "client" directory.
*/
client: function() {
if (this.options['skip-install']) {
// @todo: Improve message.
this.log('Skip install');
return;
}

this.log('bower install');
this.bowerInstall(null, {cwd: 'client'});

this.log('npm install');
this.npmInstall(null, {cwd: 'client'});

this.log('Composer install');
this.spawnCommand('composer', ['install'], {cwd: './behat'});

this.log('Drupal install');
this.spawnCommand('bash', ['install', '-dly']);
}
}
});
101 changes: 101 additions & 0 deletions app/templates/README.md
@@ -0,0 +1,101 @@
[![Build Status](https://travis-ci.org/Gizra/skeleton.svg)](https://travis-ci.org/Gizra/skeleton)

# Drupal 7 - Install Profile GarmentBox

This is a starting base to create Drupal 7 websites using an install profile.


## Installation

**Warning:** you need to setup [Drush](https://github.com/drush-ops/drush)
first or the installation and update scripts will not work.

Clone the project from [GitHub](https://github.com/Gizra/skeleton).

#### Create config file

Copy the example configuration file to config.sh:

$ cp default.config.sh config.sh

Edit the configuration file, fill in the blanks.


#### Run the install script

Run the install script from within the root of the repository:

$ ./install

You can login automatically when the installation is done. Add the -l argument
when you run the install script.

$ ./install -l


#### Configure web server

Create a vhost for your webserver, point it to the `REPOSITORY/ROOT/www` folder.
(Restart/reload your webserver).

Add the local domain to your ```/etc/hosts``` file.

Open the URL in your favorite browser.



## Reinstall

You can Reinstall the platform any type by running the install script.

$ ./install


#### The install script will perform following steps:

1. Delete the /www folder.
2. Recreate the /www folder.
3. Download and extract all contrib modules, themes & libraries to the proper
subfolders of the profile.
4. Download and extract Drupal 7 core in the /www folder
5. Create an empty sites/default/files directory
6. Makes a symlink within the /www/profiles directory to the /skeleton
directory.
7. Run the Drupal installer (Drush) using the GarmentBox profile.

#### Warning!

* The install script will not preserve the data located in the
sites/default/files directory.
* The install script will clear the database during the installation.

**You need to take backups before you run the install script!**



## Upgrade

It is also possible to upgrade Drupal core and contributed modules and themes
without destroying the data in tha database and the sites/default directory.

Run the upgrade script:

$ ./upgrade

You can login automatically when the upgrade is finished. Add the -l argument
when you run the upgrade script.

$ ./upgrade -l


#### The upgrade script will perform following steps:

1. Create a backup of the sites/default folder.
2. Delete the /www folder.
3. Recreate the /www folder.
4. Download and extract all contrib modules, themes & libraries to the proper
subfolders of the profile.
5. Download and extract Drupal 7 core in the /www folder.
6. Makes a symlink within the /www/profiles directory to the
/skeleton 7. directory.
7. Restore the backup of the sites/default folder.
59 changes: 59 additions & 0 deletions app/templates/_gitignore
@@ -0,0 +1,59 @@
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so

# Packages #
############
# it's better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip

# Logs and databases #
######################
*.log
*.sql
*.sqlite

# OS generated files #
######################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
Icon?
ehthumbs.db
Thumbs.db

# IDE #
##########
.project
.settings/
.idea


# Drupal profile #
##################
skeleton/modules/contrib
skeleton/modules/development
skeleton/1
skeleton/themes/contrib
skeleton/libraries

# Temporary "build" files
www

# Local Configuration
config.sh

0 comments on commit 5b2911c

Please sign in to comment.