Skip to content

Commit a5f6899

Browse files
rofetripodsan
authored andcommitted
feat(static): remove local static action
fixes #1048
1 parent b2244c3 commit a5f6899

File tree

24 files changed

+22
-2638
lines changed

24 files changed

+22
-2638
lines changed

src/deploy.cmd.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const ProgressBar = require('progress');
2323
const { HelixConfig, GitUrl } = require('@adobe/helix-shared');
2424
const GitUtils = require('./git-utils');
2525
const useragent = require('./user-agent-util');
26-
const StaticCommand = require('./static.cmd.js');
26+
const AbstractCommand = require('./abstract.cmd.js');
2727
const PackageCommand = require('./package.cmd.js');
2828
const ConfigUtils = require('./config/config-utils.js');
2929

@@ -33,7 +33,7 @@ function humanFileSize(size) {
3333
return `${(size / p2).toFixed(2)} ${['B', 'KiB', 'MiB', 'GiB', 'TiB'][i]}`;
3434
}
3535

36-
class DeployCommand extends StaticCommand {
36+
class DeployCommand extends AbstractCommand {
3737
constructor(logger) {
3838
super(logger);
3939
this._enableAuto = true;
@@ -356,15 +356,12 @@ Alternatively you can auto-add one using the {grey --add <name>} option.`);
356356
// eslint-disable-next-line no-param-reassign
357357
script.actionName = this.actionName(script);
358358
return script;
359-
})
360-
// exclude `hlx--static` when deploying static is disabled
361-
.filter(script => this._buildStatic || script.actionName !== 'hlx--static');
359+
});
362360

363361
const bar = new ProgressBar('[:bar] :action :etas', {
364362
total: (scripts.length * 2) // two ticks for each script
365363
+ 1 // one tick for creating the package
366-
+ 1 // one tick for creating a sequence from the static action
367-
+ (this._bindStatic ? 2 : 0), // optionally two ticks when binding static
364+
+ 2, // two ticks for binding static
368365
width: 50,
369366
renderThrottle: 1,
370367
stream: process.stdout,
@@ -473,7 +470,7 @@ Alternatively you can auto-add one using the {grey --add <name>} option.`);
473470

474471
let numErrors = 0;
475472
let staticactionname = '/hlx--static';
476-
if (this._bindStatic && !this._dryRun) {
473+
if (!this._dryRun) {
477474
// probe Helix Static action for version number
478475
await request.get('https://adobeioruntime.net/api/v1/web/helix/helix-services/static@latest', {
479476
resolveWithFullResponse: true,
@@ -521,7 +518,7 @@ Alternatively you can auto-add one using the {grey --add <name>} option.`);
521518

522519

523520
bar.terminate();
524-
this.log.info(`✅ deployment of ${scripts.length} actions completed:`);
521+
this.log.info(`✅ deployment of ${scripts.length} action${scripts.length !== 1 ? 's' : ''} completed:`);
525522
scripts.forEach((script) => {
526523
let status = '';
527524
if (script.error) {

src/deploy.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
const yargsOpenwhisk = require('./yargs-openwhisk.js');
1616
const yargsFastly = require('./yargs-fastly.js');
17-
const yargsStatic = require('./yargs-static.js');
1817
const { makeLogger } = require('./log-common.js');
1918

2019
module.exports = function deploy() {
@@ -29,7 +28,6 @@ module.exports = function deploy() {
2928
builder: (yargs) => {
3029
yargsOpenwhisk(yargs);
3130
yargsFastly(yargs);
32-
yargsStatic(yargs);
3331
yargs
3432
.option('auto', {
3533
describe: 'Enable auto-deployment',
@@ -164,7 +162,6 @@ module.exports = function deploy() {
164162
.withFastlyNamespace(argv.fastlyNamespace)
165163
.withCreatePackages(argv.package)
166164
.withAddStrain(argv.add)
167-
.withStatic(argv.static)
168165
.withMinify(argv.minify)
169166
.withResolveGitRefService(argv.svcResolveGitRef)
170167
.run();

0 commit comments

Comments
 (0)