Skip to content

Commit

Permalink
Close ember-cli#10442 allow specifying no CI provider
Browse files Browse the repository at this point in the history
  • Loading branch information
deanylev committed Apr 15, 2024
1 parent a2c4c0d commit 8df05fe
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 21 deletions.
10 changes: 8 additions & 2 deletions blueprints/addon/index.js
Expand Up @@ -210,9 +210,15 @@ module.exports = {
.files(options)
.filter((file) => !['types/ember-data/types/registries/model.d.ts'].includes(file));
let addonFilesPath = this.filesPath(this.options);
let ignoredCITemplate = this.options.ciProvider !== 'travis' ? '.travis.yml' : '.github';
let ignore = [];
if (this.options.ciProvider !== 'travis') {
ignore.push('.travis.yml');
}
if (this.options.ciProvider !== 'github') {
ignore.push('.github');
}

let addonFiles = walkSync(addonFilesPath, { ignore: [ignoredCITemplate] });
let addonFiles = walkSync(addonFilesPath, { ignore });

if (options.packageManager !== 'pnpm') {
addonFiles = addonFiles.filter((file) => !file.endsWith('.npmrc'));
Expand Down
4 changes: 3 additions & 1 deletion blueprints/app/index.js
Expand Up @@ -90,7 +90,9 @@ module.exports = {
let files = this._super();
if (options.ciProvider !== 'travis') {
files = files.filter((file) => file !== '.travis.yml');
} else {
}

if (options.ciProvider !== 'github') {
files = files.filter((file) => file.indexOf('.github') < 0);
}

Expand Down
4 changes: 4 additions & 0 deletions lib/tasks/interactive-new.js
Expand Up @@ -115,6 +115,10 @@ class InteractiveNewTask extends Task {
name: 'Travis CI',
value: 'travis',
},
{
name: 'None',
value: 'none'
},
{
name: 'Ignore/Skip',
value: null,
Expand Down
12 changes: 6 additions & 6 deletions tests/fixtures/help/help.js
Expand Up @@ -74,9 +74,9 @@ module.exports = {
{
name: 'ci-provider',
key: 'ciProvider',
type: ['travis', 'github'],
type: ['travis', 'github', 'none'],
default: 'github',
description: 'Installs the default CI blueprint. Either Travis or Github Actions is supported.',
description: 'Installs the optional default CI blueprint. Either Travis or Github Actions is supported.',
required: false
},
{
Expand Down Expand Up @@ -462,9 +462,9 @@ module.exports = {
{
name: 'ci-provider',
key: 'ciProvider',
type: ['travis', 'github'],
type: ['travis', 'github', 'none'],
default: 'github',
description: 'Installs the default CI blueprint. Either Travis or Github Actions is supported.',
description: 'Installs the optional default CI blueprint. Either Travis or Github Actions is supported.',
required: false,
},
{
Expand Down Expand Up @@ -593,8 +593,8 @@ module.exports = {
{
name: 'ci-provider',
key: 'ciProvider',
type: ['travis', 'github'],
description: 'Installs the default CI blueprint. Either Travis or Github Actions is supported.',
type: ['travis', 'github', 'none'],
description: 'Installs the optional default CI blueprint. Either Travis or Github Actions is supported.',
required: false,
},
{
Expand Down
12 changes: 6 additions & 6 deletions tests/fixtures/help/with-addon-blueprints.js
Expand Up @@ -74,9 +74,9 @@ module.exports = {
{
name: 'ci-provider',
key: 'ciProvider',
type: ['travis', 'github'],
type: ['travis', 'github', 'none'],
default: 'github',
description: 'Installs the default CI blueprint. Either Travis or Github Actions is supported.',
description: 'Installs the optional default CI blueprint. Either Travis or Github Actions is supported.',
required: false
},
{
Expand Down Expand Up @@ -494,9 +494,9 @@ module.exports = {
{
name: 'ci-provider',
key: 'ciProvider',
type: ['travis', 'github'],
type: ['travis', 'github', 'none'],
default: 'github',
description: 'Installs the default CI blueprint. Either Travis or Github Actions is supported.',
description: 'Installs the optional default CI blueprint. Either Travis or Github Actions is supported.',
required: false,
},
{
Expand Down Expand Up @@ -625,8 +625,8 @@ module.exports = {
{
name: 'ci-provider',
key: 'ciProvider',
type: ['travis', 'github'],
description: 'Installs the default CI blueprint. Either Travis or Github Actions is supported.',
type: ['travis', 'github', 'none'],
description: 'Installs the optional default CI blueprint. Either Travis or Github Actions is supported.',
required: false,
},
{
Expand Down
12 changes: 6 additions & 6 deletions tests/fixtures/help/with-addon-commands.js
Expand Up @@ -74,9 +74,9 @@ module.exports = {
{
name: 'ci-provider',
key: 'ciProvider',
type: ['travis', 'github'],
type: ['travis', 'github', 'none'],
default: 'github',
description: 'Installs the default CI blueprint. Either Travis or Github Actions is supported.',
description: 'Installs the optional default CI blueprint. Either Travis or Github Actions is supported.',
required: false
},
{
Expand Down Expand Up @@ -462,9 +462,9 @@ module.exports = {
{
name: 'ci-provider',
key: 'ciProvider',
type: ['travis', 'github'],
type: ['travis', 'github', 'none'],
default: 'github',
description: 'Installs the default CI blueprint. Either Travis or Github Actions is supported.',
description: 'Installs the optional default CI blueprint. Either Travis or Github Actions is supported.',
required: false,
},
{
Expand Down Expand Up @@ -593,8 +593,8 @@ module.exports = {
{
name: 'ci-provider',
key: 'ciProvider',
type: ['travis', 'github'],
description: 'Installs the default CI blueprint. Either Travis or Github Actions is supported.',
type: ['travis', 'github', 'none'],
description: 'Installs the optional default CI blueprint. Either Travis or Github Actions is supported.',
required: false,
},
{
Expand Down

0 comments on commit 8df05fe

Please sign in to comment.