diff --git a/CHANGELOG.md b/CHANGELOG.md index 52fc1a3..6b6fad5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## v3.1.0 (June 2017) + +* Changed name to generator-outrigger-drupal +* Relocated to Github: https://github.com/phase2/generator-outrigger-drupal + ## v3.0.1 (June 2017) * Missed a couple minor bugfixes. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f272b8c..52701e3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,17 +17,17 @@ docker-compose run --rm cli npm test ## Testing Branches without Docker -If you would like to test out changes to generator-p2 or one of the above +If you would like to test out changes to generator-outrigger-drupal or one of the above projects, please take the following steps: -1. `git clone git@bitbucket.org:phase2tech/generator-p2.git` -2. Check out the alternate branch of generator-p2. If testing alternate +1. `git clone git@github.com:phase2/generator-outrigger-drupal.git` +2. Check out the alternate branch of generator-outrigger-drupal. If testing alternate branches of one of the other generators, edit the package.json dependency entry according to the [package.json dependency documenation](https://docs.npmjs.com/files/package.json#git-urls-as-dependencies). 3. Run `npm link` to use this copy as the global version. (May require `sudo`) If you would like to take it a step further and develop in the other generators -while testing with `yo p2`, clone those repositories as well and replace the -version installed in `generator-2/node_modules` with a symlink. **Note this may +while testing with `yo outrigger-drupal`, clone those repositories as well and replace the +version installed in `generator-outrigger-drupal/node_modules` with a symlink. **Note this may not work in npm v3.x.** diff --git a/README.md b/README.md index 17d90d3..0afa55e 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,10 @@ -# Yo P2! � the Phase2 Site Generator +# Outrigger Drupal -> Yeoman generator that weaves together multiple generators, tools, and Phase2 -best practices to kick off Drupal projects in style. +> Yeoman generator that weaves together Outrigger with other best-in-class tools for your Drupal project. This is an umbrella [Yeoman](http://yeoman.io/) generator that asks questions, then passes the answers to multiple "child" generators that handle their own -aspect of the scaffolding. As the name implies, this generator focuses on Phase2 -practices, where some of the other generators in use are focused on broader industry -best practices. +aspect of project scaffolding. As the name implies, this generator focuses on Outrigger practices, where some of the other generators in use are focused on broader industry best practices. ## Installation & Usage @@ -17,21 +14,21 @@ Docker-based usage is available as of v3.0.0. It is the recommended approach as updates tend to be less prone to complication. ```bash -git clone git@bitbucket.org:phase2tech/generator-p2.git -cd generator-p2 +git clone git@github.com:phase2/generator-outrigger-drupal.git +cd generator-outrigger-drupal git checkout v3.0.0 docker-compose run --rm cli npm install mkdir ~/path/to/empty/directory -YO_PROJECT_DIRECTORY=~/path/to/empty/directory docker-compose run --rm yo p2 +YO_PROJECT_DIRECTORY=~/path/to/empty/directory docker-compose run --rm yo outrigger-drupal ``` ### Using npm ```bash -npm install --global git+ssh://bitbucket.org/phase2tech/generator-p2.git#v3.0.0 +npm install --global git+ssh://github.com:phase2/generator-outrigger-drupal.git#v3.0.1 mkdir ~/path/to/empty/directory cd ~/path/to/empty/directory -yo p2 +yo outrigger-drupal ``` ### Command-line Options @@ -62,15 +59,15 @@ When you use this to generate a project, all your answers are recorded by Yeoman in a .yo-rc.json file at the root of your repository. As long as you commit this to the codebase, from then if you run the generator targeting that directory it will use the previous answers as the defaults to every prompt. For even faster -usage, you can run `yo p2 --replay` and it will automatically run the generator -without stopping to ask old questions. +usage, you can run `yo outrigger-drupal --replay` and it will automatically run +the generator without stopping to ask old questions. If you run the generator, it will overwrite files. That's the idea in this case, as your goal is to cherrypick good new stuff the generator provides into your project. Run `git add -p .` to view each change one chunk at a time, and decide if it makes sense to discard or keep. Feel free to ask for help. -The extensive changelog notes are intended to help guide this process. +The extensive [CHANGELOG](./CHANGELOG.md) notes are intended to help guide this process. ### Retrofitting an Existing Project @@ -104,9 +101,9 @@ and your site will be built and a new site installed. development, continuous integration, and overall project tooling for the Drupal application. -A best practice setup of GDT with a few extra goodies are provided by Yo P2's -use of [Generator Gadget](https://github.com/phase2/generator-gadget) to produce -the top-level Drupal application scaffolding. +A best practice setup of GDT with a few extra goodies are provided by +Yo Outrigger Drupal's use of [Generator Gadget](https://github.com/phase2/generator-gadget) +to produce the top-level Drupal application scaffolding. ### Component-driven Frontend @@ -126,8 +123,7 @@ consistent, container-based, local development environment that can also be used on Phase2's centralized Outrigger hosting to provide integration, testing, and other environments. -This uses a sub-generator of generator-p2 which can be separately executed as -`yo p2:environment`. +This uses a sub-generator of generator-outrigger-drupal which can be separately executed as `yo outrigger-drupal:environment`. #### Feature Breakdown @@ -157,8 +153,7 @@ If you liked the Docker-based environments, you can also use our Docker-based Jenkins instance to manage your central test environments, complete with default jobs so you can start continuous integration with zero further configuration. -This uses a sub-generator of generator-p2 which can be separately executed as -`yo p2:jenkins`. +This uses a sub-generator of generator-outrigger-drupal which can be separately executed as `yo outrigger-drupal:jenkins`. ### Feature Breakdown diff --git a/bin/debug b/bin/debug index e1009ba..3dbbcc5 100755 --- a/bin/debug +++ b/bin/debug @@ -5,7 +5,7 @@ # Open your browser to http://debug.yo.vm:8080/debug?port=5858 # # This script is currently triggered as part of -# * `docker-compose run --rm p2-debug` +# * `docker-compose run --rm debug` ## node-inspector --no-preload --web-host="0.0.0.0" & diff --git a/docker-compose.yml b/docker-compose.yml index 8eba1ac..dc1c8dc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,16 +7,16 @@ services: cli: extends: service: yo - working_dir: /usr/local/lib/node_modules/generator-p2 + working_dir: /usr/local/lib/node_modules/generator-outrigger-drupal entrypoint: ["/usr/bin/env"] command: "bash" # Runs the primary yo generator with node-inspector debugging activated. - # Usage: docker-compose run --rm debug + # Usage: docker-compose run --rm debug debug: extends: service: yo - entrypoint: "/usr/local/lib/node_modules/generator-p2/bin/debug 'p2 --no-insight --skip-install'" + entrypoint: "/usr/local/lib/node_modules/generator-outrigger-drupal/bin/debug 'outrigger-drupal --no-insight --skip-install'" ports: - "8080" labels: @@ -25,12 +25,12 @@ services: # Run 'yo' inside the container. # Usage: docker-compose run --rm yo - # docker-compose run --rm yo p2 - # docker-compose run --rm yo p2:environment - # docker-compose run --rm yo p2:jenkins + # docker-compose run --rm yo outrigger-drupal + # docker-compose run --rm yo outrigger-drupal:environment + # docker-compose run --rm yo outrigger-drupal:jenkins yo: image: outrigger/yeoman network_mode: "bridge" volumes: - ${YO_PROJECT_DIRECTORY:-~/Projects/newproject}:/generated - - .:/usr/local/lib/node_modules/generator-p2 + - .:/usr/local/lib/node_modules/generator-outrigger-drupal diff --git a/generators/app/index.js b/generators/app/index.js index 8f08398..d2d09d9 100644 --- a/generators/app/index.js +++ b/generators/app/index.js @@ -179,15 +179,15 @@ module.exports = Generator.extend({ end: function() { var version = { gadget: require('generator-gadget/package.json').version, - env: require('generator-p2/package.json').version, + env: require('generator-outrigger-drupal/package.json').version, pls: require('generator-pattern-lab-starter/package.json').version, } - this.log(yosay('Yo P2 has completed generation of your Drupal project.')); + this.log(yosay('Outrigger Drupal has completed generation of your Drupal project.')); this.log('Primary scaffolding created by ' + chalk.red('generator-gadget v' + version.gadget) + '.'); this.log('Check out your new READMEs to get oriented.'); if (options['useENV']) { - this.log('You have chosen a ' + chalk.bold('Docker-based development environment') + ' created by ' + chalk.red('generator-p2:environment v' + version.env) + '.'); + this.log('You have chosen a ' + chalk.bold('Docker-based development environment') + ' created by ' + chalk.red('generator-outrigger-drupal:environment v' + version.env) + '.'); this.log(chalk.yellow('All tools and application code should be run via the Docker containers.')); this.log(chalk.green('A handy TODOS.md checklist has been created for your next steps.')); this.log('Want to see a running Drupal site without opening a text editor? Run ' + chalk.bold('bash bin/start.sh') + ' now.'); diff --git a/generators/app/templates/README.md b/generators/app/templates/README.md index 5ef1d8b..6068e8d 100644 --- a/generators/app/templates/README.md +++ b/generators/app/templates/README.md @@ -35,11 +35,11 @@ and operational management of the application code. A build process downloads an ## Scaffolded with Generators -Initial generation of this project's code structure was built with [Yo P2](https://bitbucket.org/phase2tech/generator-p2) +Initial generation of this project's code structure was built with [Yo Outrigger Drupal](https://github.com/phase2/generator-outrigger-drupal) and related code-generation projects. To refresh your project with our latest practices, update your local copy of this -tool, and run `yo p2 --replay --force`. Do not forgot to carefully inspect each +tool, and run `yo outrigger-drupal --replay --force`. Do not forgot to carefully inspect each change for compatibility with your ongoing project before committing. The `--replay` option pulls configuration values for the generator from *.yo-rc.json*, diff --git a/generators/environment/index.js b/generators/environment/index.js index 65cf7e4..af39544 100644 --- a/generators/environment/index.js +++ b/generators/environment/index.js @@ -173,10 +173,10 @@ module.exports = Generator.extend({ npmConfig: function() { var pkg = this.fs.readJSON('package.json'); if (!pkg) { - this.log(chalk.red('You must have a valid Grunt-Drupal-Tasks compatible codebase before running p2-env.')); - this.log(chalk.yellow('Try running `yo p2` or `yo gadget` first!')); + this.log(chalk.red('You must have a valid Grunt-Drupal-Tasks compatible codebase before running outrigger-drupal:environment.')); + this.log(chalk.yellow('Try running `yo outrigger-drupal` or `yo gadget` first!')); if (!options['force']) { - this.env.error('Project not ready for p2-env processing.'); + this.env.error('Project not ready for outrigger-drupal:environment processing.'); } } pkg = pkg || {}; @@ -203,10 +203,10 @@ module.exports = Generator.extend({ gruntConfig: function() { var gcfg = this.fs.readJSON('Gruntconfig.json'); if (!gcfg) { - this.log(chalk.red('You must have a valid Grunt-Drupal-Tasks compatible codebase before running p2-env.')); - this.log(chalk.yellow('Try running `yo p2` or `yo gadget` first!')); + this.log(chalk.red('You must have a valid Grunt-Drupal-Tasks compatible codebase before running outrigger-drupal:environment.')); + this.log(chalk.yellow('Try running `yo outrigger-drupal` or `yo gadget` first!')); if (!options['force']) { - this.env.error('Project not ready for p2-env processing.'); + this.env.error('Project not ready for outrigger-drupal:environment processing.'); } } gcfg = gcfg || {} @@ -219,7 +219,7 @@ module.exports = Generator.extend({ } gcfg.project.db = '/opt/backups/latest.sql.gz'; - // Backups configuration is introduced by p2-env. + // Backups configuration is introduced by outrigger-drupal:environment gcfg.project.backups = { url: 'http://' + env.virtualHost(false, 'backups') + '/' + options.projectName, env: 'int' diff --git a/generators/environment/templates/bin/doctor.sh b/generators/environment/templates/bin/doctor.sh index f6c77f2..b8a2bdc 100755 --- a/generators/environment/templates/bin/doctor.sh +++ b/generators/environment/templates/bin/doctor.sh @@ -104,7 +104,7 @@ if [ -z "$1" ] || [ "$1" == 'devtools' ]; then fi if [ -z "$1" ] || [ "$1" == 'generator' ]; then - heading 'Code Generated with Yo P2' + heading 'Code Generated with Yo Outrigger Drupal' assertDir 'src' $ERROR assertFile 'package.json' $ERROR assertFile 'composer.json' $ERROR diff --git a/generators/environment/templates/bin/start.sh b/generators/environment/templates/bin/start.sh index 5decc76..2ccff53 100755 --- a/generators/environment/templates/bin/start.sh +++ b/generators/environment/templates/bin/start.sh @@ -17,9 +17,9 @@ NAME=`basename "$0"` NO_VALIDATE='' NOOP=0 # This version is used to facilitate troubleshooting, by indicating which -# version of the generator-p2-env project produced this script. If you re-run -# the generator please include the update. If you make significant changes -# consider creating a compount version "number" indicating that. +# version of the generator-outrigger-drupal project produced this script. +# If you re-run the generator please include the update. If you make significant +# changes consider creating a compound version "number" indicating that. START_VERSION=<%= pkg.version %> # By default we install a new Drupal site rather than update an existing Drupal site. UPDATE=0 diff --git a/generators/lib/tokens.js b/generators/lib/tokens.js index 95a54b5..89da9cb 100644 --- a/generators/lib/tokens.js +++ b/generators/lib/tokens.js @@ -7,8 +7,9 @@ var gadgetTokens = require('generator-gadget/generators/lib/util').tokens; var dockerComposeLink = require('./util').dockerComposeLink; /** - * Produces tokens based on flagged options and prompt answers for p2:app or - * other sub-generators. These tokens are used by the templating process. + * Produces tokens based on flagged options and prompt answers for + * outrigger-drupal:app or other sub-generators. These tokens are used by + * the templating process. * * @todo move more of these pieces to the hosting platform sub-system. */ @@ -17,9 +18,10 @@ module.exports = function(options) { var tokens = options; - // This library is used by p2:environment and p2:jenkins directly, but those - // do not use or depend on prompts from generator-gadget which are needed to - // produce the gadget tokens. + // This library is used by outrigger-drupal:environment and + // outrigger-drupal:jenkins directly, but those do not use or depend + // on prompts from generator-gadget which are needed to produce + // the gadget tokens. // // These tokens are not needed either. // diff --git a/package.json b/package.json index 8c16be7..1fe65dd 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,13 @@ { - "name": "generator-p2", - "version": "3.0.1", - "description": "Phase2 Yeoman generator", + "name": "generator-outrigger-drupal", + "version": "3.1.0-pre", + "description": "Yeoman Generator for Outrigger-based Drupal projects.", "license": "MIT", "main": "app/index.js", "repository": { "type": "git", - "url": "https://bitbucket.org/phase2tech/generator-p2" + "url": "https://github.com/phase2/generator-outrigger-drupal" }, - "private": true, "engines": { "node": ">=4" }, @@ -23,7 +22,8 @@ "yeoman-generator", "drupal", "docker", - "jenkins" + "jenkins", + "outrigger" ], "dependencies": { "chalk": "^1.0.0", diff --git a/test/app.test.js b/test/app.test.js index 9969945..00735f8 100644 --- a/test/app.test.js +++ b/test/app.test.js @@ -49,7 +49,7 @@ var gdtFiles = [ 'test/features/example.feature' ]; -describe('p2:app w/ Gadget', function () { +describe('outrigger-drupal:app w/ Gadget', function () { before(function () { return test.run(path.join(__dirname, '../generators/app')) .inDir(appDir) @@ -91,7 +91,7 @@ describe('p2:app w/ Gadget', function () { }); -describe('p2:app --replay', function () { +describe('outrigger-drupal:app --replay', function () { var originalTestDirectory = test.testDirectory; before(function (done) { @@ -131,17 +131,17 @@ describe('p2:app --replay', function () { it ('uses projectName based on previously stored option', function() { var pkg = require(path.resolve(appDir, 'package.json')); var yoRC = require(path.resolve(appDir, '.yo-rc.json')); - assert.equal(pkg.name, yoRC['generator-p2']['projectName']); + assert.equal(pkg.name, yoRC['generator-outrigger-drupal']['projectName']); }); }); -describe('p2:app w/ Gadget + p2:environment', function () { +describe('outrigger-drupal:app w/ Gadget + outrigger-drupal:environment', function () { before(function (done) { test.run(path.join(__dirname, '../generators/app')) .inDir(appDir) .withOptions({ 'skip-install': true, - projectName: 'drupal8-p2env', + projectName: 'drupal8-outrigger-env', projectDescription: 'test drupal8 project', drupalDistro: 'drupal', drupalDistroVersion: '8.x', @@ -154,7 +154,7 @@ describe('p2:app w/ Gadget + p2:environment', function () { mail: 'none', environments: [], offline: true, - domain: 'drupal8-p2env', + domain: 'drupal8-outrigger-env', force: true }) .on('end', done); diff --git a/test/environment.test.js b/test/environment.test.js index ff39dfa..bf71f6c 100644 --- a/test/environment.test.js +++ b/test/environment.test.js @@ -36,7 +36,7 @@ var describeJson = function(appDir) { }; -describe('p2:environment', function() { +describe('outrigger-drupal:environment', function() { var appDir = path.join(os.tmpdir(), './temp-test-environment'); console.log('Environment tests will be generated in "' + appDir + '"'); diff --git a/test/jenkins.test.js b/test/jenkins.test.js index 58f35f1..6f90b59 100644 --- a/test/jenkins.test.js +++ b/test/jenkins.test.js @@ -36,7 +36,7 @@ var describeXml = function(extended) { }; } -describe('p2:jenkins', function() { +describe('outrigger-drupal:jenkins', function() { var appDir = path.join(os.tmpdir(), './temp-test-jenkins'); console.log('Jenkins tests will be generated in "' + appDir + '"');