├── tests ├── helpers │ ├── .gitkeep │ └── resolver.js ├── unit │ └── .gitkeep ├── dummy │ ├── public │ │ ├── .gitkeep │ │ └── robots.txt │ ├── app │ │ ├── helpers │ │ │ └── .gitkeep │ │ ├── models │ │ │ └── .gitkeep │ │ ├── routes │ │ │ └── .gitkeep │ │ ├── views │ │ │ └── .gitkeep │ │ ├── components │ │ │ └── .gitkeep │ │ ├── controllers │ │ │ └── .gitkeep │ │ ├── templates │ │ │ ├── components │ │ │ │ └── .gitkeep │ │ │ └── application.hbs │ │ ├── styles │ │ │ └── app.css │ │ ├── resolver.js │ │ ├── router.js │ │ ├── app.js │ │ └── index.html │ └── config │ │ ├── optional-features.json │ │ ├── targets.js │ │ └── environment.js ├── integration │ └── .gitkeep ├── test-helper.js └── index.html ├── .watchmanconfig ├── .template-lintrc.js ├── config ├── environment.js └── ember-try.js ├── index.js ├── .ember-cli ├── .eslintignore ├── .editorconfig ├── .gitignore ├── .npmignore ├── ember-cli-build.js ├── testem.js ├── CONTRIBUTING.md ├── LICENSE.md ├── CHANGELOG.md ├── .eslintrc.js ├── .travis.yml ├── package.json ├── blueprints └── ember-cli-github-pages │ └── index.js ├── lib └── commands │ └── commit.js └── README.md /tests/helpers/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/unit/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/dummy/public/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/dummy/app/helpers/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/dummy/app/models/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/dummy/app/routes/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/dummy/app/views/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/dummy/app/components/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/dummy/app/controllers/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/dummy/app/templates/components/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.watchmanconfig: -------------------------------------------------------------------------------- 1 | { 2 | "ignore_dirs": ["tmp", "dist"] 3 | } 4 | -------------------------------------------------------------------------------- /tests/dummy/app/styles/app.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | margin: 20px; 3 | } 4 | -------------------------------------------------------------------------------- /tests/dummy/config/optional-features.json: -------------------------------------------------------------------------------- 1 | { 2 | "jquery-integration": false 3 | } 4 | -------------------------------------------------------------------------------- /tests/dummy/public/robots.txt: -------------------------------------------------------------------------------- 1 | # http://www.robotstxt.org 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /tests/dummy/app/templates/application.hbs: -------------------------------------------------------------------------------- 1 |

Welcome to Ember

2 | 3 | {{outlet}} -------------------------------------------------------------------------------- /.template-lintrc.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | extends: 'recommended' 5 | }; 6 | -------------------------------------------------------------------------------- /tests/dummy/app/resolver.js: -------------------------------------------------------------------------------- 1 | import Resolver from 'ember-resolver'; 2 | 3 | export default Resolver; 4 | -------------------------------------------------------------------------------- /config/environment.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = function(/* environment, appConfig */) { 4 | return { }; 5 | }; 6 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | name: require('./package').name, 5 | 6 | includedCommands: function() { 7 | return { 8 | 'github-pages:commit': require('./lib/commands/commit') 9 | }; 10 | } 11 | }; 12 | -------------------------------------------------------------------------------- /tests/test-helper.js: -------------------------------------------------------------------------------- 1 | import Application from '../app'; 2 | import config from '../config/environment'; 3 | import { setApplication } from '@ember/test-helpers'; 4 | import { start } from 'ember-qunit'; 5 | 6 | setApplication(Application.create(config.APP)); 7 | 8 | start(); 9 | -------------------------------------------------------------------------------- /tests/dummy/app/router.js: -------------------------------------------------------------------------------- 1 | import EmberRouter from '@ember/routing/router'; 2 | import config from './config/environment'; 3 | 4 | const Router = EmberRouter.extend({ 5 | location: config.locationType, 6 | rootURL: config.rootURL 7 | }); 8 | 9 | Router.map(function() { 10 | }); 11 | 12 | export default Router; 13 | -------------------------------------------------------------------------------- /.ember-cli: -------------------------------------------------------------------------------- 1 | { 2 | /** 3 | Ember CLI sends analytics information by default. The data is completely 4 | anonymous, but there are times when you might want to disable this behavior. 5 | 6 | Setting `disableAnalytics` to true will prevent any data from being sent. 7 | */ 8 | "disableAnalytics": false 9 | } 10 | -------------------------------------------------------------------------------- /tests/helpers/resolver.js: -------------------------------------------------------------------------------- 1 | import Resolver from 'ember-resolver'; 2 | import config from '../../config/environment'; 3 | 4 | var resolver = Resolver.create(); 5 | 6 | resolver.namespace = { 7 | modulePrefix: config.modulePrefix, 8 | podModulePrefix: config.podModulePrefix 9 | }; 10 | 11 | export default resolver; 12 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | # unconventional js 2 | /blueprints/*/files/ 3 | /vendor/ 4 | 5 | # compiled output 6 | /dist/ 7 | /tmp/ 8 | 9 | # dependencies 10 | /bower_components/ 11 | /node_modules/ 12 | 13 | # misc 14 | /coverage/ 15 | !.* 16 | 17 | # ember-try 18 | /.node_modules.ember-try/ 19 | /bower.json.ember-try 20 | /package.json.ember-try 21 | -------------------------------------------------------------------------------- /tests/dummy/config/targets.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const browsers = [ 4 | 'last 1 Chrome versions', 5 | 'last 1 Firefox versions', 6 | 'last 1 Safari versions' 7 | ]; 8 | 9 | const isCI = !!process.env.CI; 10 | const isProduction = process.env.EMBER_ENV === 'production'; 11 | 12 | if (isCI || isProduction) { 13 | browsers.push('ie 11'); 14 | } 15 | 16 | module.exports = { 17 | browsers 18 | }; 19 | -------------------------------------------------------------------------------- /tests/dummy/app/app.js: -------------------------------------------------------------------------------- 1 | import Application from '@ember/application'; 2 | import Resolver from './resolver'; 3 | import loadInitializers from 'ember-load-initializers'; 4 | import config from './config/environment'; 5 | 6 | const App = Application.extend({ 7 | modulePrefix: config.modulePrefix, 8 | podModulePrefix: config.podModulePrefix, 9 | Resolver 10 | }); 11 | 12 | loadInitializers(App, config.modulePrefix); 13 | 14 | export default App; 15 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | 5 | root = true 6 | 7 | 8 | [*] 9 | end_of_line = lf 10 | charset = utf-8 11 | trim_trailing_whitespace = true 12 | insert_final_newline = true 13 | indent_style = space 14 | indent_size = 2 15 | 16 | [*.hbs] 17 | insert_final_newline = false 18 | 19 | [*.{diff,md}] 20 | trim_trailing_whitespace = false 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist/ 5 | /tmp/ 6 | 7 | # dependencies 8 | /bower_components/ 9 | /node_modules/ 10 | 11 | # misc 12 | /.env* 13 | /.pnp* 14 | /.sass-cache 15 | /connect.lock 16 | /coverage/ 17 | /libpeerconnection.log 18 | /npm-debug.log* 19 | /testem.log 20 | /yarn-error.log 21 | 22 | # ember-try 23 | /.node_modules.ember-try/ 24 | /bower.json.ember-try 25 | /package.json.ember-try 26 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | # compiled output 2 | /dist/ 3 | /tmp/ 4 | 5 | # dependencies 6 | /bower_components/ 7 | 8 | # misc 9 | /.bowerrc 10 | /.editorconfig 11 | /.ember-cli 12 | /.env* 13 | /.eslintignore 14 | /.eslintrc.js 15 | /.gitignore 16 | /.template-lintrc.js 17 | /.travis.yml 18 | /.watchmanconfig 19 | /bower.json 20 | /config/ember-try.js 21 | /CONTRIBUTING.md 22 | /ember-cli-build.js 23 | /testem.js 24 | /tests/ 25 | /yarn.lock 26 | .gitkeep 27 | 28 | # ember-try 29 | /.node_modules.ember-try/ 30 | /bower.json.ember-try 31 | /package.json.ember-try 32 | -------------------------------------------------------------------------------- /ember-cli-build.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const EmberAddon = require('ember-cli/lib/broccoli/ember-addon'); 4 | 5 | module.exports = function(defaults) { 6 | let app = new EmberAddon(defaults, { 7 | // Add options here 8 | }); 9 | 10 | /* 11 | This build file specifies the options for the dummy test app of this 12 | addon, located in `/tests/dummy` 13 | This build file does *not* influence how the addon or the app using it 14 | behave. You most likely want to be modifying `./index.js` or app's build file 15 | */ 16 | 17 | return app.toTree(); 18 | }; 19 | -------------------------------------------------------------------------------- /testem.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | test_page: 'tests/index.html?hidepassed', 3 | disable_watching: true, 4 | launch_in_ci: [ 5 | 'Chrome' 6 | ], 7 | launch_in_dev: [ 8 | 'Chrome' 9 | ], 10 | browser_args: { 11 | Chrome: { 12 | ci: [ 13 | // --no-sandbox is needed when running Chrome inside a container 14 | process.env.CI ? '--no-sandbox' : null, 15 | '--headless', 16 | '--disable-gpu', 17 | '--disable-dev-shm-usage', 18 | '--disable-software-rasterizer', 19 | '--mute-audio', 20 | '--remote-debugging-port=0', 21 | '--window-size=1440,900' 22 | ].filter(Boolean) 23 | } 24 | } 25 | }; 26 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How To Contribute 2 | 3 | ## Installation 4 | 5 | * `git clone ` 6 | * `cd my-addon` 7 | * `npm install` 8 | 9 | ## Linting 10 | 11 | * `npm run lint:hbs` 12 | * `npm run lint:js` 13 | * `npm run lint:js -- --fix` 14 | 15 | ## Running tests 16 | 17 | * `ember test` – Runs the test suite on the current Ember version 18 | * `ember test --server` – Runs the test suite in "watch mode" 19 | * `ember try:each` – Runs the test suite against multiple Ember versions 20 | 21 | ## Running the dummy application 22 | 23 | * `ember serve` 24 | * Visit the dummy application at [http://localhost:4200](http://localhost:4200). 25 | 26 | For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/). -------------------------------------------------------------------------------- /tests/dummy/app/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Dummy 7 | 8 | 9 | 10 | {{content-for "head"}} 11 | 12 | 13 | 14 | 15 | {{content-for "head-footer"}} 16 | 17 | 18 | {{content-for "body"}} 19 | 20 | 21 | 22 | 23 | {{content-for "body-footer"}} 24 | 25 | 26 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2019 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. 4 | 5 | 6 | ## [0.2.2](https://github.com/poetic/ember-cli-github-pages/compare/v0.2.1...v0.2.2) (2019-06-13) 7 | 8 | 9 | ### Bug Fixes 10 | 11 | * Handle parent directory as destination ([#69](https://github.com/poetic/ember-cli-github-pages/issues/69)) ([6c7b365](https://github.com/poetic/ember-cli-github-pages/commit/6c7b365)) 12 | * update deps ([aa46772](https://github.com/poetic/ember-cli-github-pages/commit/aa46772)) 13 | 14 | 15 | 16 | 17 | ## [0.2.1](https://github.com/poetic/ember-cli-github-pages/compare/v0.2.0...v0.2.1) (2018-11-06) 18 | 19 | 20 | ### Bug Fixes 21 | 22 | * Split git commands to multiple calls to `runCommand` ([#67](https://github.com/poetic/ember-cli-github-pages/issues/67)) ([820b462](https://github.com/poetic/ember-cli-github-pages/commit/820b462)) 23 | * update all deps via ember-cli-update ([9a8aa68](https://github.com/poetic/ember-cli-github-pages/commit/9a8aa68)) 24 | -------------------------------------------------------------------------------- /tests/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Dummy Tests 7 | 8 | 9 | 10 | {{content-for "head"}} 11 | {{content-for "test-head"}} 12 | 13 | 14 | 15 | 16 | 17 | {{content-for "head-footer"}} 18 | {{content-for "test-head-footer"}} 19 | 20 | 21 | {{content-for "body"}} 22 | {{content-for "test-body"}} 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | {{content-for "body-footer"}} 31 | {{content-for "test-body-footer"}} 32 | 33 | 34 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | parserOptions: { 4 | ecmaVersion: 2018, 5 | sourceType: 'module' 6 | }, 7 | plugins: [ 8 | 'ember' 9 | ], 10 | extends: [ 11 | 'eslint:recommended', 12 | 'plugin:ember/recommended' 13 | ], 14 | env: { 15 | browser: true 16 | }, 17 | rules: { 18 | }, 19 | overrides: [ 20 | // node files 21 | { 22 | files: [ 23 | '.eslintrc.js', 24 | '.template-lintrc.js', 25 | 'ember-cli-build.js', 26 | 'index.js', 27 | 'testem.js', 28 | 'blueprints/*/index.js', 29 | 'config/**/*.js', 30 | 'tests/dummy/config/**/*.js' 31 | ], 32 | excludedFiles: [ 33 | 'addon/**', 34 | 'addon-test-support/**', 35 | 'app/**', 36 | 'tests/dummy/app/**' 37 | ], 38 | parserOptions: { 39 | sourceType: 'script', 40 | ecmaVersion: 2015 41 | }, 42 | env: { 43 | browser: false, 44 | node: true 45 | }, 46 | plugins: ['node'], 47 | rules: Object.assign({}, require('eslint-plugin-node').configs.recommended.rules, { 48 | // add your custom rules and overrides for node files here 49 | }) 50 | } 51 | ] 52 | }; 53 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | --- 2 | language: node_js 3 | node_js: 4 | # we recommend testing addons with the same minimum supported node version as Ember CLI 5 | # so that your addon works for all apps 6 | - "8" 7 | 8 | sudo: false 9 | dist: trusty 10 | 11 | addons: 12 | chrome: stable 13 | 14 | cache: 15 | directories: 16 | - $HOME/.npm 17 | 18 | env: 19 | global: 20 | # See https://git.io/vdao3 for details. 21 | - JOBS=1 22 | 23 | branches: 24 | only: 25 | - master 26 | # npm version tags 27 | - /^v\d+\.\d+\.\d+/ 28 | 29 | jobs: 30 | fail_fast: true 31 | allow_failures: 32 | - env: EMBER_TRY_SCENARIO=ember-canary 33 | 34 | include: 35 | # runs linting and tests with current locked deps 36 | 37 | - stage: "Tests" 38 | name: "Tests" 39 | script: 40 | - npm run lint:hbs 41 | - npm run lint:js 42 | - npm test 43 | 44 | # we recommend new addons test the current and previous LTS 45 | # as well as latest stable release (bonus points to beta/canary) 46 | - stage: "Additional Tests" 47 | env: EMBER_TRY_SCENARIO=ember-lts-2.18 48 | - env: EMBER_TRY_SCENARIO=ember-lts-3.4 49 | - env: EMBER_TRY_SCENARIO=ember-release 50 | - env: EMBER_TRY_SCENARIO=ember-beta 51 | - env: EMBER_TRY_SCENARIO=ember-canary 52 | - env: EMBER_TRY_SCENARIO=ember-default-with-jquery 53 | 54 | script: 55 | - node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO 56 | -------------------------------------------------------------------------------- /tests/dummy/config/environment.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = function(environment) { 4 | let ENV = { 5 | modulePrefix: 'dummy', 6 | environment, 7 | rootURL: '/', 8 | locationType: 'auto', 9 | EmberENV: { 10 | FEATURES: { 11 | // Here you can enable experimental features on an ember canary build 12 | // e.g. EMBER_NATIVE_DECORATOR_SUPPORT: true 13 | }, 14 | EXTEND_PROTOTYPES: { 15 | // Prevent Ember Data from overriding Date.parse. 16 | Date: false 17 | } 18 | }, 19 | 20 | APP: { 21 | // Here you can pass flags/options to your application instance 22 | // when it is created 23 | } 24 | }; 25 | 26 | if (environment === 'development') { 27 | // ENV.APP.LOG_RESOLVER = true; 28 | ENV.APP.LOG_ACTIVE_GENERATION = true; 29 | // ENV.APP.LOG_TRANSITIONS = true; 30 | // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; 31 | ENV.APP.LOG_VIEW_LOOKUPS = true; 32 | } 33 | 34 | if (environment === 'test') { 35 | // Testem prefers this... 36 | ENV.locationType = 'none'; 37 | 38 | // keep test console output quieter 39 | ENV.APP.LOG_ACTIVE_GENERATION = false; 40 | ENV.APP.LOG_VIEW_LOOKUPS = false; 41 | 42 | ENV.APP.rootElement = '#ember-testing'; 43 | ENV.APP.autoboot = false; 44 | } 45 | 46 | if (environment === 'production') { 47 | // here you can enable a production-specific feature 48 | } 49 | 50 | return ENV; 51 | }; 52 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ember-cli-github-pages", 3 | "version": "0.2.2", 4 | "description": "Easily manage gh-pages of your ember-cli addon", 5 | "keywords": [ 6 | "ember-addon", 7 | "github-pages", 8 | "github", 9 | "deployment", 10 | "static", 11 | "emberjs" 12 | ], 13 | "repository": "https://github.com/poetic/ember-cli-github-pages", 14 | "license": "MIT", 15 | "author": "Jake Craige ", 16 | "directories": { 17 | "doc": "doc", 18 | "test": "tests" 19 | }, 20 | "scripts": { 21 | "build": "ember build", 22 | "lint:hbs": "ember-template-lint .", 23 | "lint:js": "eslint .", 24 | "start": "ember serve", 25 | "test": "ember test", 26 | "test:all": "ember try:each", 27 | "release": "standard-version" 28 | }, 29 | "dependencies": { 30 | "ember-cli-version-checker": "^2.1.0", 31 | "rsvp": "^4.7.0" 32 | }, 33 | "devDependencies": { 34 | "@ember/optional-features": "^0.7.0", 35 | "broccoli-asset-rev": "^3.0.0", 36 | "ember-cli": "~3.28.6", 37 | "ember-cli-dependency-checker": "^3.1.0", 38 | "ember-cli-eslint": "^5.1.0", 39 | "ember-cli-htmlbars": "^3.0.1", 40 | "ember-cli-htmlbars-inline-precompile": "^2.1.0", 41 | "ember-cli-inject-live-reload": "^1.8.2", 42 | "ember-cli-sri": "^2.1.1", 43 | "ember-cli-template-lint": "^1.0.0-beta.1", 44 | "ember-cli-uglify": "^2.1.0", 45 | "ember-disable-prototype-extensions": "^1.1.3", 46 | "ember-export-application-global": "^2.0.0", 47 | "ember-load-initializers": "^2.0.0", 48 | "ember-maybe-import-regenerator": "^0.1.6", 49 | "ember-qunit": "^4.4.1", 50 | "ember-resolver": "^5.0.1", 51 | "ember-source": "~3.10.0", 52 | "ember-source-channel-url": "^1.1.0", 53 | "ember-try": "^1.0.0", 54 | "eslint-plugin-ember": "^6.2.0", 55 | "eslint-plugin-node": "^9.0.1", 56 | "loader.js": "^4.7.0", 57 | "qunit-dom": "^0.8.4", 58 | "standard-version": "^8.0.1" 59 | }, 60 | "engines": { 61 | "node": "8.* || >= 10.*" 62 | }, 63 | "ember-addon": { 64 | "configPath": "tests/dummy/config" 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /config/ember-try.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const getChannelURL = require('ember-source-channel-url'); 4 | 5 | module.exports = function() { 6 | return Promise.all([ 7 | getChannelURL('release'), 8 | getChannelURL('beta'), 9 | getChannelURL('canary') 10 | ]).then((urls) => { 11 | return { 12 | scenarios: [ 13 | { 14 | name: 'ember-lts-2.18', 15 | env: { 16 | EMBER_OPTIONAL_FEATURES: JSON.stringify({ 'jquery-integration': true }) 17 | }, 18 | npm: { 19 | devDependencies: { 20 | '@ember/jquery': '^0.5.1', 21 | 'ember-source': '~2.18.0' 22 | } 23 | } 24 | }, 25 | { 26 | name: 'ember-lts-3.4', 27 | npm: { 28 | devDependencies: { 29 | 'ember-source': '~3.4.0' 30 | } 31 | } 32 | }, 33 | { 34 | name: 'ember-release', 35 | npm: { 36 | devDependencies: { 37 | 'ember-source': urls[0] 38 | } 39 | } 40 | }, 41 | { 42 | name: 'ember-beta', 43 | npm: { 44 | devDependencies: { 45 | 'ember-source': urls[1] 46 | } 47 | } 48 | }, 49 | { 50 | name: 'ember-canary', 51 | npm: { 52 | devDependencies: { 53 | 'ember-source': urls[2] 54 | } 55 | } 56 | }, 57 | // The default `.travis.yml` runs this scenario via `npm test`, 58 | // not via `ember try`. It's still included here so that running 59 | // `ember try:each` manually or from a customized CI config will run it 60 | // along with all the other scenarios. 61 | { 62 | name: 'ember-default', 63 | npm: { 64 | devDependencies: {} 65 | } 66 | }, 67 | { 68 | name: 'ember-default-with-jquery', 69 | env: { 70 | EMBER_OPTIONAL_FEATURES: JSON.stringify({ 71 | 'jquery-integration': true 72 | }) 73 | }, 74 | npm: { 75 | devDependencies: { 76 | '@ember/jquery': '^0.5.1' 77 | } 78 | } 79 | } 80 | ] 81 | }; 82 | }); 83 | }; 84 | -------------------------------------------------------------------------------- /blueprints/ember-cli-github-pages/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var RSVP = require('rsvp'); 4 | var path = require('path'); 5 | var fs = require('fs'); 6 | var writeFile = RSVP.denodeify(fs.writeFile); 7 | var VersionChecker = require('ember-cli-version-checker'); 8 | 9 | module.exports = { 10 | description: 'Updates dummy config to work on gh-pages', 11 | normalizeEntityName: function() { }, 12 | 13 | afterInstall: function() { 14 | var checker = new VersionChecker(this); 15 | var dep = checker.for('ember-cli', 'npm'); 16 | var urlType = dep.satisfies('>= 2.7.0-beta.1') ? 'rootURL' : 'baseUrl'; 17 | 18 | this.urlType = urlType; 19 | 20 | return this.updateDummyConfig().then(function() { 21 | this.ui.writeLine('Updated config/environment.js ' + urlType + ' and locationType.'); 22 | }.bind(this)); 23 | }, 24 | 25 | updateDummyConfig: function() { 26 | var name = this.project.pkg.name; 27 | var search = " if (environment === 'production') {"; 28 | var replace = " if (environment === 'production') {\n ENV.locationType = 'hash';\n ENV." + this.urlType + " = '/" + name + "/';"; 29 | 30 | return this.replaceEnvironment(search, replace); 31 | }, 32 | 33 | replaceEnvironment: function(search, replace) { 34 | var addon = this.project.pkg['ember-addon']; 35 | var configPath = addon ? addon.configPath : 'config'; 36 | 37 | return this.replaceInFile(configPath + '/environment.js', search, replace); 38 | }, 39 | 40 | replaceInFile: function(pathRelativeToProjectRoot, searchTerm, contentsToInsert) { 41 | var fullPath = path.join(this.project.root, pathRelativeToProjectRoot); 42 | var originalContents = ''; 43 | 44 | if (fs.existsSync(fullPath)) { 45 | originalContents = fs.readFileSync(fullPath, { encoding: 'utf8' }); 46 | } 47 | 48 | var contentsToWrite = originalContents.replace(searchTerm, contentsToInsert); 49 | var returnValue = { 50 | path: fullPath, 51 | originalContents: originalContents, 52 | contents: contentsToWrite, 53 | inserted: false 54 | }; 55 | 56 | if (contentsToWrite !== originalContents) { 57 | returnValue.inserted = true; 58 | 59 | return writeFile(fullPath, contentsToWrite) 60 | .then(function() { 61 | return returnValue; 62 | }); 63 | } else { 64 | return RSVP.resolve(returnValue); 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /lib/commands/commit.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var exec = require('child_process').exec; 4 | var RSVP = require('rsvp'); 5 | var path = require('path'); 6 | 7 | module.exports = { 8 | name: 'github-pages:commit', 9 | aliases: ['gh-pages:commit'], 10 | description: 'Build the test app for production and commit it into a git branch', 11 | works: 'insideProject', 12 | 13 | availableOptions: [{ 14 | name: 'message', 15 | type: String, 16 | default: 'new gh-pages version', 17 | description: 'The commit message to include with the build, must be wrapped in quotes.' 18 | }, { 19 | name: 'environment', 20 | type: String, 21 | default: 'production', 22 | description: 'The ember environment to create a build for' 23 | }, { 24 | name: 'branch', 25 | type: String, 26 | default: 'gh-pages', 27 | description: 'The git branch to push your pages to' 28 | }, { 29 | name: 'destination', 30 | type: String, 31 | default: '.', 32 | description: 'The directory into which the built application should be copied' 33 | }], 34 | 35 | run: function(options, rawArgs) { 36 | var ui = this.ui; 37 | var root = this.project.root; 38 | var execOptions = { cwd: root, shell: process.env.SHELL }; 39 | 40 | function buildApp() { 41 | var env = options.environment; 42 | return runCommand('ember build --environment=' + env, execOptions); 43 | } 44 | 45 | function checkoutGhPages() { 46 | return runCommand('git checkout ' + options.branch, execOptions); 47 | } 48 | 49 | function copy() { 50 | var rel = path.relative(root, options.destination); 51 | if (options.destination === '.' || rel.match(/^\.\.(\/\.\.)*$/)) { 52 | return runCommand('cp -R dist/* ' + options.destination + '/', execOptions); 53 | } else { 54 | return runCommand('rm -r ' + options.destination, execOptions) 55 | .then(function() { 56 | return runCommand('mkdir ' + options.destination, execOptions); 57 | }) 58 | .then(function() { 59 | return runCommand('cp -R dist/* ' + options.destination + '/', execOptions); 60 | }); 61 | } 62 | } 63 | 64 | function addAndCommit() { 65 | return runCommand('git -c core.safecrlf=false add "' + options.destination + '"', execOptions) 66 | .then(function() { 67 | return runCommand('git commit -m "' + options.message + '"', execOptions); 68 | }) 69 | } 70 | 71 | function returnToPreviousCheckout() { 72 | return runCommand('git checkout -', execOptions); 73 | } 74 | 75 | return buildApp() 76 | .then(checkoutGhPages) 77 | .then(copy) 78 | .then(addAndCommit) 79 | .then(returnToPreviousCheckout) 80 | .then(function() { 81 | var branch = options.branch; 82 | ui.write('Done. All that\'s left is to git push the ' + branch + 83 | ' branch.\nEx: git push origin ' + branch + ':' + branch +'\n'); 84 | }); 85 | } 86 | }; 87 | 88 | function runCommand(/* child_process.exec args */) { 89 | var args = Array.prototype.slice.call(arguments); 90 | 91 | var lastIndex = args.length - 1; 92 | var lastArg = args[lastIndex]; 93 | var logOutput = false; 94 | if (typeof lastArg === 'boolean') { 95 | logOutput = lastArg; 96 | args.splice(lastIndex); 97 | } 98 | 99 | return new RSVP.Promise(function(resolve, reject) { 100 | var cb = function(err, stdout, stderr) { 101 | if (logOutput) { 102 | if (stderr) { 103 | console.log(stderr); 104 | } 105 | 106 | if (stdout) { 107 | console.log(stdout); 108 | } 109 | } 110 | 111 | if (err) { 112 | return reject(err); 113 | } 114 | 115 | return resolve(); 116 | }; 117 | 118 | args.push(cb); 119 | exec.apply(exec, args); 120 | }.bind(this)); 121 | } 122 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ember-cli-github-pages 2 | 3 | [![npm version](https://badge.fury.io/js/ember-cli-github-pages.svg)](http://badge.fury.io/js/ember-cli-github-pages) 4 | [![Ember Observer Score](http://emberobserver.com/badges/ember-cli-github-pages.svg)](http://emberobserver.com/addons/ember-cli-github-pages) 5 | [![Code Climate](https://codeclimate.com/github/poetic/ember-cli-github-pages/badges/gpa.svg)](https://codeclimate.com/github/poetic/ember-cli-github-pages) 6 | [![Dependency Status](https://david-dm.org/poetic/ember-cli-github-pages.svg)](https://david-dm.org/poetic/ember-cli-github-pages) 7 | [![devDependency Status](https://david-dm.org/poetic/ember-cli-github-pages/dev-status.svg)](https://david-dm.org/poetic/ember-cli-github-pages#info=devDependencies) 8 | 9 | If you need to throw up a quick example of your addon in action, this is the 10 | addon for you! 11 | 12 | This addon provides new command(s) to help manage a gh-pages branch for your 13 | addon. It's an addon for addons. 14 | 15 | ## Installation & Setup 16 | 17 | First you need to install ember-cli-github-pages: 18 | 19 | ```sh 20 | ember install ember-cli-github-pages 21 | ``` 22 | 23 | Upon install, this addon will modify your 'tests/dummy/config/environment.js'. 24 | Commit these changes with the following command: 25 | 26 | ```sh 27 | git add -A && git commit -m "Added ember-cli-github-pages addon" 28 | ``` 29 | 30 | Then you need to create the `gh-pages` branch and remove the unnecessary files: 31 | 32 | ```sh 33 | git checkout --orphan gh-pages && rm -rf `bash -c "ls -a | grep -vE '\.gitignore|\.git|node_modules|bower_components|(^[.]{1,2}/?$)'"` && touch .gitkeep && git add -A && git commit -m "initial gh-pages commit" 34 | ``` 35 | 36 | ## Usage 37 | 38 | Once that's done, you can checkout the branch you want to create the gh-page 39 | from (likely master) and run the command to build and commit it. 40 | 41 | Then run ember github-pages:commit --message "some commit message" in order to rebuild gh-pages branch. 42 | 43 | ```sh 44 | git checkout master 45 | ember github-pages:commit --message "Initial gh-pages release" 46 | ``` 47 | 48 | ### Ember Addons: Add a Demo URL 49 | 50 | Once you've created a gh-pages branch, tell the world! Add a `demoURL` key to the `ember-addon` object in your `package.json`. See the `ember-cli` [documention](http://ember-cli.com/extending/#configuring-your-ember-addon-properties) for details. 51 | 52 | ### A note about Org and User Pages 53 | 54 | While in general, github repo pages will serve the content in the `gh-pages` branch, [org and user pages](https://help.github.com/articles/user-organization-and-project-pages/#user--organization-pages) serve content in the `master` branch. When using this addon to develop a Org or User page, edit your Ember Application on an alternate branch such as `ember`. Once you are ready to build the application and send to GitHub you can either: 55 | 56 | * add the `--branch master` option to the `ember github-pages:commit` command 57 | * make the `gh-pages` branch on your local machine track the master branch on `origin` via the command: 58 | 59 | ```sh 60 | git branch --set-upstream gh-pages origin/master 61 | ``` 62 | 63 | ### A complete Org/User Pages example 64 | 65 | 1. Create a new Ember CLI project `ember new myBlog`. Replace `myBlog` with the name of your project. 66 | 2. Go to the newly created project and install this addon: `cd myBlog && ember install ember-cli-github-pages`. 67 | 3. Remove the changes made to `environment.js`, as they are not required for Org/User pages: `git checkout -- tests/dummy/config/environment.js` 68 | 4. Commit the changes: `git add -A && git commit -m "Added ember-cli-github-pages addon https://github.com/poetic/ember-cli-github-pages"` 69 | 5. Create a new branch named `ember` which will store all the ember related code: `git checkout -b ember` 70 | 6. Run the following command as mentioned [above](https://github.com/poetic/ember-cli-github-pages#installation--setup): ```git checkout master && rm -rf `ls -a | grep -vE '\.gitignore|\.git|node_modules|bower_components|(^[.]{1,2}/?$)'` && git add -A && git commit -m "initialises gh-pages(in case of organisation master) commit"``` 71 | 7. Switch back to ember branch: `git checkout ember`; 72 | 8. Build the site using ember-cli-github-pages: `ember github-pages:commit --branch master --message "adds base site"` 73 | 9. Create new Org/User repo on Github and add the origin: `git remote add origin https://github.com/knoxxs/knoxxs.github.io.git`. Here `knoxxs` is my username. 74 | 10. Push the master branch: `git push -u origin master`. 75 | 11. Open `http://knoxxs.github.io/`. 76 | 77 | ### Advanced Usage 78 | 79 | You may optionally specify an ember build environment and a branch name as parameters 80 | 81 | ```sh 82 | git checkout master 83 | ember github-pages:commit --message "Initial demo app release" \ 84 | --branch="my-demo-app" \ 85 | --environment=development 86 | ``` 87 | 88 | | Optional Argument | Default Value | Description | 89 | |-------------------|---------------|-------------| 90 | | environment | `production` | Ember build environment (i.e., `development`, `production`) | 91 | | branch | `gh-pages` | Branch to commit your app to | 92 | | destination | `.` | The directory into which the built application should be copied | 93 | | message | `new gh-pages version` | The commit message to include with the build, must be wrapped in quotes | 94 | 95 | You will still need to push the gh-pages branch up to github using git. Once you 96 | do that you can access the repo at `http://username.github.io/repo-name`. It may 97 | take a few minutes after pushing the code to show up. 98 | 99 | ## FAQ 100 | 101 | ### How can I create an automated deploy script? 102 | 103 | For ease of use you can add the following to your `package.json`: 104 | 105 | ```json 106 | "scripts": { 107 | "deploy": "ember build --environment production && ember github-pages:commit --message \"Deploy gh-pages from commit $(git rev-parse HEAD)\" && git push origin gh-pages:gh-pages" 108 | } 109 | ``` 110 | 111 | And then you can execute `npm run deploy` and it will deploy with a commit message that references the commit ID you deployed from, and push that branch to github. 112 | 113 | #### Some of my assets (images) aren't showing up, what do I do? 114 | 115 | This addon creates a production build, which fingerprints resources automatically. If you have dynamic resources in your templates, they will not be fingerprinted, so you need to ignore the fingerprinting for those resources in your ember-cli-build.js file. See the [fingerprinting docs](http://ember-cli.com/user-guide/#fingerprinting-and-cdn-urls). 116 | 117 | ## Authors 118 | 119 | * [Jake Craige](http://twitter.com/jakecraige) 120 | 121 | [We are very thankful for our many contributors](https://github.com/poetic/ember-cli-github-pages/graphs/contributors) 122 | 123 | ## Legal 124 | 125 | [Licensed under the MIT license](http://www.opensource.org/licenses/mit-license.php) 126 | --------------------------------------------------------------------------------