@fishawack/lab-env 4.14.0 → 4.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/CHANGELOG.md +63 -0
  2. package/commands/artisan.js +1 -3
  3. package/commands/check.js +2 -4
  4. package/commands/clean.js +2 -4
  5. package/commands/composer.js +1 -3
  6. package/commands/connect.js +1 -16
  7. package/commands/content.js +1 -3
  8. package/commands/craft.js +1 -3
  9. package/commands/deploy.js +1 -1
  10. package/commands/docker/mocha.js +1 -1
  11. package/commands/drush.js +1 -3
  12. package/commands/execute.js +8 -3
  13. package/commands/install.js +1 -3
  14. package/commands/npm.js +1 -3
  15. package/commands/php.js +1 -3
  16. package/commands/production.js +1 -3
  17. package/commands/regenerate.js +2 -4
  18. package/commands/reinstall.js +2 -4
  19. package/commands/run.js +1 -3
  20. package/commands/setup.js +1 -1
  21. package/commands/start.js +4 -14
  22. package/commands/test.js +2 -12
  23. package/commands/uninstall.js +1 -3
  24. package/commands/watch.js +9 -3
  25. package/commands/wp.js +1 -1
  26. package/core/0/docker-compose.yml +2 -0
  27. package/core/1/CHANGELOG.md +4 -0
  28. package/core/1/Dockerfile +6 -0
  29. package/core/1/docker-compose.yml +3 -0
  30. package/core/1/package.json +1 -1
  31. package/craftcms/3/apache/CHANGELOG.md +4 -0
  32. package/craftcms/3/apache/Dockerfile +11 -0
  33. package/craftcms/3/apache/httpd.conf +554 -0
  34. package/craftcms/3/apache/package.json +11 -0
  35. package/craftcms/3/docker-compose.yml +16 -12
  36. package/craftcms/3/php/CHANGELOG.md +4 -0
  37. package/craftcms/3/php/Dockerfile +32 -6
  38. package/craftcms/3/php/custom.ini +5 -0
  39. package/craftcms/3/php/entrypoint.sh +24 -0
  40. package/craftcms/3/php/package.json +11 -0
  41. package/drupal/9/apache/CHANGELOG.md +4 -0
  42. package/drupal/9/apache/package.json +1 -1
  43. package/drupal/9/docker-compose.yml +13 -7
  44. package/drupal/9/php/CHANGELOG.md +5 -0
  45. package/drupal/9/php/Dockerfile +9 -0
  46. package/drupal/9/php/entrypoint.sh +27 -0
  47. package/drupal/9/php/package.json +2 -2
  48. package/globals.js +52 -64
  49. package/intercept.sh +5 -0
  50. package/laravel/8/docker-compose.yml +10 -3
  51. package/laravel/8/nginx/package.json +1 -1
  52. package/laravel/8/php/CHANGELOG.md +6 -0
  53. package/laravel/8/php/Dockerfile +9 -3
  54. package/laravel/8/php/entrypoint.sh +24 -0
  55. package/laravel/8/php/package.json +2 -2
  56. package/package.json +2 -2
  57. package/wordpress/0/CHANGELOG.md +4 -0
  58. package/wordpress/{5.7.2/wordpress → 0}/Dockerfile +4 -1
  59. package/wordpress/{5.7.2 → 0}/docker-compose.yml +4 -8
  60. package/wordpress/0/package.json +11 -0
  61. package/core/0/docker-compose-dev.yml +0 -5
  62. package/core/1/docker-compose-dev.yml +0 -6
  63. package/craftcms/3/nginx/nginx.conf +0 -37
  64. package/craftcms/3/php/custom.conf +0 -9
  65. package/drupal/9/docker-compose-dev.yml +0 -11
  66. package/laravel/8/docker-compose-dev.yml +0 -11
  67. package/laravel/8/php/custom.conf +0 -9
  68. package/wordpress/5.7.2/apache/.htaccess +0 -25
  69. /package/wordpress/{5.7.2/apache/uploads.ini → 0/custom.ini} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,68 @@
1
1
  ## Changelog
2
2
 
3
+ ### 4.15.0 (2023-03-23)
4
+ * [Feature] moved wordpress to new version folder and build into standalone image
5
+ * [Feature] drupal apache now a multi arch build with changelog
6
+ * [Feature] can now pass --container flag to exec command to pipe commands into different containers
7
+ * [Feature] intercept chgrp commands and pipe into node container
8
+ * [Feature] export user mapping of containers to uids
9
+ * [Feature] copy .env regardless of project if it exists in the project root
10
+ * [Feature] _.command can now handle no command which just starts a bash terminal
11
+ * [Feature] can now ignore errors in commands
12
+ * [Feature] commands now a global function that can accept container and command
13
+ * [Change] Bumped fishawack/lab-env-craftcms-3-apache to 1.0.0
14
+ * [Change] Bumped fishawack/lab-env-craftcms-3-php to 1.0.0
15
+ * [Change] Bumped fishawack/lab-env-wordpress-0 to 1.0.0
16
+ * [Change] Bumped fishawack/lab-env-drupal-9-php to 0.6.0
17
+ * [Change] Bumped fishawack/lab-env-laravel-8-php to 0.4.1
18
+ * [Change] Bumped fishawack/lab-env-laravel-8-php to 0.4.0
19
+ * [Change] Bumped fishawack/lab-env-core-1 to 1.3.0
20
+ * [Bug] added craft versions to global.js
21
+ * [Bug] craft now publishes to standalone images and uses apache
22
+ * [Bug] switch to mysql 8.0.32 for drupal for arm64 arch
23
+ * [Bug] added versions to drupal images in compose files
24
+ * [Bug] remove dev Dockerfiles as default docker compose can handle them now
25
+ * [Bug] remove platform from wordpress image to allow it to be chosen by platform
26
+ * [Bug] map user id and group to wordpress container to Bug permission issues
27
+ * [Bug] remove redundant htaccess file
28
+ * [Bug] removed duplicate keys in wordpress
29
+ * [Bug] drupal php now maps env variables correctly
30
+ * [Bug] dont map platforms to drupal containers
31
+ * [Bug] drupal php now a multi arch build with changelog
32
+ * [Bug] dont log ports after first launch
33
+ * [Bug] dont re-set ports on running containers as it can cause error if core is stopped and redundant anyway
34
+ * [Bug] wp now correctly maps container user
35
+ * [Bug] connect now correctly maps container user
36
+ * [Bug] mocha now correctly maps container user
37
+ * [Bug] watch command now ups containers on full stack projects
38
+ * [Bug] watch now correctly maps container user
39
+ * [Bug] uninstall now correctly maps container user
40
+ * [Bug] start now correctly maps container user
41
+ * [Bug] setup now correctly maps container user
42
+ * [Bug] run now correctly maps container user
43
+ * [Bug] npm now correctly maps container user
44
+ * [Bug] production now correctly maps container user
45
+ * [Bug] install now correctly maps container user
46
+ * [Bug] content now correctly maps container user
47
+ * [Bug] correctly check composer deps and list out missing when -v flag passed in
48
+ * [Bug] check now correctly maps container user
49
+ * [Bug] remap method in command func to take into account changing running variable
50
+ * [Bug] test now correctly maps container user
51
+ * [Bug] reinstall now correctly maps container user
52
+ * [Bug] regenerate now correctly maps container user
53
+ * [Bug] drush now correctly maps container user
54
+ * [Bug] deploy now correctly maps container user
55
+ * [Bug] craft now correctly maps container user
56
+ * [Bug] clean now correctly maps container user
57
+ * [Bug] dont join -g prep between commands as not needed and causes invalid task calls
58
+ * [Bug] correctly set and unset running during up node commands to ensure other functions work as expected
59
+ * [Bug] php now correctly maps container user
60
+ * [Bug] composer now correctly maps container user
61
+ * [Bug] artisan now correctly maps container user
62
+ * [Bug] updated lab-env-laravel-nginx build image script to be multi arch
63
+ * [Bug] updated lab-env-laravel-php build image script to be multi arch
64
+ * [Bug] no longer specify platform on laravel projects for nginx, php and redis images
65
+
3
66
  ### 4.14.0 (2023-03-02)
4
67
  * [Change] Bumped fishawack/lab-env-laravel-8-nginx to 0.1.2
5
68
  * [Change] Bumped fishawack/lab-env-laravel-8-php to 0.3.1
@@ -1,7 +1,5 @@
1
1
  const _ = require('../globals.js');
2
2
 
3
- const execSync = require('child_process').execSync;
4
-
5
3
  module.exports = [
6
4
  ['artisan [command...]', 'art'],
7
5
  'run artisan command',
@@ -11,5 +9,5 @@ module.exports = [
11
9
  default: ''
12
10
  });
13
11
  },
14
- argv => _.up(() => execSync(`${_.docker} ${_.exec} php bash -lc "php artisan ${argv.command.join(' ')}"`, _.opts))
12
+ argv => _.up(() => _.command("php", `php artisan ${argv.command.join(' ')}`))
15
13
  ];
package/commands/check.js CHANGED
@@ -1,7 +1,5 @@
1
1
  const _ = require('../globals.js');
2
2
 
3
- const execSync = require('child_process').execSync;
4
-
5
3
  module.exports = [
6
4
  'check',
7
5
  'check if node modules are missing or outdated',
@@ -13,10 +11,10 @@ module.exports = [
13
11
  });
14
12
  },
15
13
  argv => {
16
- execSync(`${_.docker} ${_.run} -c "check-dependencies ${argv.v ? '' : '&>/dev/null'} && echo -e '\\033[0;32mNpm deps OK\\033[0m' || { echo -e '\\033[0;31mNpm deps missing or outdated\\033[0m'; } && are-you-es5 check . && echo -e '\\033[0;32mNpm-ES5 compatibility OK\\033[0m' || { echo -e '\\033[0;31mNpm-ES5 incompatibilities detected\\033[0m'; }"`, _.opts);
14
+ _.command("core", `check-dependencies ${argv.v ? '' : '&>/dev/null'} && echo -e '\\033[0;32mNpm deps OK\\033[0m' || { echo -e '\\033[0;31mNpm deps missing or outdated\\033[0m'; } && are-you-es5 check . && echo -e '\\033[0;32mNpm-ES5 compatibility OK\\033[0m' || { echo -e '\\033[0;31mNpm-ES5 incompatibilities detected\\033[0m'; }`);
17
15
 
18
16
  if(_.platform === "laravel" || _.platform === "drupal" || _.platform === "craftcms"){
19
- execSync(`${_.docker} ${_.method} php bash -lc "composer install --dry-run ${argv.v ? '' : '2>&1'} | grep -q 'Nothing to install, update or remove' && echo -e '\\033[0;32mComposer deps OK\\033[0m' || echo -e '\\033[0;31mComposer deps missing or outdated\\033[0m'"`, _.opts);
17
+ _.command("php", `${argv.v ? `composer install --dry-run 2>&1 | grep '\\- Installing' | while read -r line; do echo \\$\{line/'Installing'\}; done && ` : ''}composer install --dry-run 2>&1 | grep -q 'Nothing to install, update or remove' && echo -e '\\033[0;32mComposer deps OK\\033[0m' || echo -e '\\033[0;31mComposer deps missing or outdated\\033[0m'`);
20
18
  }
21
19
  }
22
20
  ];
package/commands/clean.js CHANGED
@@ -1,16 +1,14 @@
1
1
  const _ = require('../globals.js');
2
2
 
3
- const execSync = require('child_process').execSync;
4
-
5
3
  module.exports = [
6
4
  'clean',
7
5
  'cleans out dependencies',
8
6
  yargs => {},
9
7
  argv => {
10
- execSync(`${_.docker} ${_.run} -c "git clean -xfd node_modules/ 2>/dev/null || true"`, _.opts);
8
+ _.command("core", `git clean -xfd node_modules/ 2>/dev/null || true`);
11
9
 
12
10
  if(_.platform === "laravel" || _.platform === "drupal" || _.platform === "craftcms"){
13
- execSync(`${_.docker} ${_.method} php bash -lc "git clean -xfd vendor/ 2>/dev/null || true"`, _.opts);
11
+ _.command("php", `git clean -xfd vendor/ 2>/dev/null || true`);
14
12
  }
15
13
  }
16
14
  ];
@@ -1,7 +1,5 @@
1
1
  const _ = require('../globals.js');
2
2
 
3
- const execSync = require('child_process').execSync;
4
-
5
3
  module.exports = [
6
4
  'composer [command...]',
7
5
  'run composer command',
@@ -11,5 +9,5 @@ module.exports = [
11
9
  default: ''
12
10
  });
13
11
  },
14
- argv => execSync(`${_.docker} ${_.method} php bash -lc "composer ${argv.command.join(' ')}"`, _.opts)
12
+ argv => _.command("php", `composer ${argv.command.join(' ')}`)
15
13
  ];
@@ -1,7 +1,5 @@
1
1
  const _ = require('../globals.js');
2
2
 
3
- const execSync = require('child_process').execSync;
4
-
5
3
  module.exports = [
6
4
  'connect [container]',
7
5
  'jump into container',
@@ -11,18 +9,5 @@ module.exports = [
11
9
  default: 'core'
12
10
  });
13
11
  },
14
- argv => {
15
- let run = ' -l';
16
- let user = '';
17
- // Don't login on core@1 so /etc/profile isn't loaded and $PATH reset (likely don't need to login on anything other than core@0 but need test suite to check)
18
- if(argv.container === "core" && process.env.VERSION === "1"){
19
- run = '';
20
-
21
- if(_.running){
22
- user = ' -u node';
23
- }
24
- }
25
-
26
- execSync(`${_.docker} ${_.method}${user} ${argv.container} bash${run}`, _.opts);
27
- }
12
+ argv => _.command(argv.container)
28
13
  ];
@@ -1,10 +1,8 @@
1
1
  const _ = require('../globals.js');
2
2
 
3
- const execSync = require('child_process').execSync;
4
-
5
3
  module.exports = [
6
4
  'content',
7
5
  'pulls any external content and assets into the repo',
8
6
  yargs => {},
9
- argv => execSync(`${_.docker} ${_.run} -c "npm run content"`, _.opts)
7
+ argv => _.command("core", `npm run content`)
10
8
  ];
package/commands/craft.js CHANGED
@@ -1,7 +1,5 @@
1
1
  const _ = require('../globals.js');
2
2
 
3
- const execSync = require('child_process').execSync;
4
-
5
3
  module.exports = [
6
4
  ['craft [command...]', 'craft'],
7
5
  'run craft command',
@@ -11,5 +9,5 @@ module.exports = [
11
9
  default: ''
12
10
  });
13
11
  },
14
- argv => _.up(() => execSync(`${_.docker} ${_.exec} php bash -lc "php craft ${argv.command.join(' ')}"`, _.opts))
12
+ argv => _.up(() => _.command("php", `php craft ${argv.command.join(' ')}`))
15
13
  ];
@@ -10,7 +10,7 @@ module.exports = [
10
10
  if(_.platform === "laravel" || _.platform === "wordpress" || _.platform === "drupal" || _.platform === "craftcms"){
11
11
  _.up(() => execSync(`source ${__dirname}/../intercept.sh && /bin/bash ./_Scripts/deploy.sh`, _.opts));
12
12
  } else {
13
- execSync(`${_.docker} ${_.run} -c "${(process.env.VERSION === "0") ? 'xvfb-run ' : ''}npm run deploy"`, _.opts);
13
+ _.command("core", `${(process.env.VERSION === "0") ? 'xvfb-run ' : ''}npm run deploy`);
14
14
  }
15
15
  }
16
16
  ];
@@ -6,5 +6,5 @@ module.exports = [
6
6
  'mocha',
7
7
  false,
8
8
  yargs => {},
9
- argv => execSync(`${_.docker} ${_.run} -c "${(process.env.VERSION === "0") ? 'xvfb-run ' : ''}npm run mocha"`, _.opts)
9
+ argv => _.command("core", `${(process.env.VERSION === "0") ? 'xvfb-run ' : ''}npm run mocha`, true)
10
10
  ];
package/commands/drush.js CHANGED
@@ -1,7 +1,5 @@
1
1
  const _ = require('../globals.js');
2
2
 
3
- const execSync = require('child_process').execSync;
4
-
5
3
  module.exports = [
6
4
  'drush [command...]',
7
5
  'run drush command',
@@ -11,5 +9,5 @@ module.exports = [
11
9
  default: ''
12
10
  });
13
11
  },
14
- argv => _.up(() => execSync(`${_.docker} ${_.exec} php bash -lc "vendor/bin/drush ${argv.command.join(' ')}"`, _.opts))
12
+ argv => _.up(() => _.command("php", `vendor/bin/drush ${argv.command.join(' ')}`))
15
13
  ];
@@ -1,7 +1,5 @@
1
1
  const _ = require('../globals.js');
2
2
 
3
- const execSync = require('child_process').execSync;
4
-
5
3
  module.exports = [
6
4
  ['execute [command...]', 'exec'],
7
5
  'run a custom command in the container',
@@ -24,9 +22,16 @@ module.exports = [
24
22
  describe: 'Execute a grunt command',
25
23
  type: 'boolean'
26
24
  });
25
+
26
+ yargs.option('container', {
27
+ alias: 'c',
28
+ describe: 'container to connect to',
29
+ default: 'core'
30
+ });
27
31
  },
28
32
  argv => {
29
33
  const prep = argv.g ? 'npx grunt --gruntfile node_modules/@fishawack/core/Gruntfile.js ' : ' ';
30
- execSync(`${_.docker} ${_.run} -c "${argv.d ? 'xvfb-run ' : ''}${prep}${argv.command.join(prep)}"`, _.opts)
34
+
35
+ _.command(argv.container, `${argv.d ? 'xvfb-run ' : ''}${prep}${argv.command.join(' ')}`);
31
36
  }
32
37
  ];
@@ -1,7 +1,5 @@
1
1
  const _ = require('../globals.js');
2
2
 
3
- const execSync = require('child_process').execSync;
4
-
5
3
  module.exports = [
6
4
  ['install [package...]', 'i'],
7
5
  'runs npm install or installs a package/packages',
@@ -11,5 +9,5 @@ module.exports = [
11
9
  default: ''
12
10
  });
13
11
  },
14
- argv => execSync(`${_.docker} ${_.run} -c "npm install ${argv.package.join(' ')}"`, _.opts)
12
+ argv => _.command("core", `npm install ${argv.package.join(' ')}`)
15
13
  ];
package/commands/npm.js CHANGED
@@ -1,7 +1,5 @@
1
1
  const _ = require('../globals.js');
2
2
 
3
- const execSync = require('child_process').execSync;
4
-
5
3
  module.exports = [
6
4
  'npm [command...]',
7
5
  'run npm command',
@@ -11,5 +9,5 @@ module.exports = [
11
9
  default: ''
12
10
  });
13
11
  },
14
- argv => execSync(`${_.docker} ${_.run} -c "npm ${argv.command.join(' ')}"`, _.opts)
12
+ argv => _.command("core", `npm ${argv.command.join(' ')}`)
15
13
  ];
package/commands/php.js CHANGED
@@ -1,7 +1,5 @@
1
1
  const _ = require('../globals.js');
2
2
 
3
- const execSync = require('child_process').execSync;
4
-
5
3
  module.exports = [
6
4
  'php [command...]',
7
5
  'run php command',
@@ -11,5 +9,5 @@ module.exports = [
11
9
  default: ''
12
10
  });
13
11
  },
14
- argv => execSync(`${_.docker} ${_.method} php bash -lc "php ${argv.command.join(' ')}"`, _.opts)
12
+ argv => _.command("php", `php ${argv.command.join(' ')}`)
15
13
  ];
@@ -1,10 +1,8 @@
1
1
  const _ = require('../globals.js');
2
2
 
3
- const execSync = require('child_process').execSync;
4
-
5
3
  module.exports = [
6
4
  ['production', 'prod'],
7
5
  'builds for production',
8
6
  yargs => {},
9
- argv => execSync(`${_.docker} ${_.run} -c "${(process.env.VERSION === "0") ? 'xvfb-run ' : ''}npm run production"`, _.opts)
7
+ argv => _.command("core", `${(process.env.VERSION === "0") ? 'xvfb-run ' : ''}npm run production`)
10
8
  ];
@@ -1,16 +1,14 @@
1
1
  const _ = require('../globals.js');
2
2
 
3
- const execSync = require('child_process').execSync;
4
-
5
3
  module.exports = [
6
4
  ['regenerate', 'regen'],
7
5
  'regenerates dependency lock files',
8
6
  yargs => {},
9
7
  argv => {
10
- execSync(`${_.docker} ${_.run} -c "rm package-lock.json; git clean -xfd node_modules/ 2>/dev/null || true; npm install"`, _.opts);
8
+ _.command("core", `rm package-lock.json; git clean -xfd node_modules/ 2>/dev/null || true; npm install`);
11
9
 
12
10
  if(_.platform === "laravel" || _.platform === "drupal" || _.platform === "craftcms"){
13
- execSync(`${_.docker} ${_.method} php bash -lc "rm composer.lock; git clean -xfd vendor/ 2>/dev/null || true; composer install"`, _.opts)
11
+ _.command("php", `rm composer.lock; git clean -xfd vendor/ 2>/dev/null || true; composer install`);
14
12
  }
15
13
  }
16
14
  ];
@@ -1,16 +1,14 @@
1
1
  const _ = require('../globals.js');
2
2
 
3
- const execSync = require('child_process').execSync;
4
-
5
3
  module.exports = [
6
4
  ['reinstall', 'ci'],
7
5
  'installs fresh dependencies',
8
6
  yargs => {},
9
7
  argv => {
10
- execSync(`${_.docker} ${_.run} -c "npm ci || npm i"`, _.opts);
8
+ _.command("core", `npm ci || npm i`);
11
9
 
12
10
  if(_.platform === "laravel" || _.platform === "drupal" || _.platform === "craftcms"){
13
- execSync(`${_.docker} ${_.method} php bash -lc "composer install"`, _.opts);
11
+ _.command("php", `composer install`);
14
12
  }
15
13
  }
16
14
  ];
package/commands/run.js CHANGED
@@ -1,7 +1,5 @@
1
1
  const _ = require('../globals.js');
2
2
 
3
- const execSync = require('child_process').execSync;
4
-
5
3
  module.exports = [
6
4
  'run [command] [flags...]',
7
5
  'run an npm script',
@@ -24,5 +22,5 @@ module.exports = [
24
22
  });
25
23
  }
26
24
  },
27
- argv => execSync(`${_.docker} ${_.run} -c "${argv.d ? 'xvfb-run ' : ''}npm run ${argv.command} -- -- ${argv.flags.join(' ')}"`, _.opts)
25
+ argv => _.command("core", `${argv.d ? 'xvfb-run ' : ''}npm run ${argv.command} -- -- ${argv.flags.join(' ')}`)
28
26
  ];
package/commands/setup.js CHANGED
@@ -10,7 +10,7 @@ module.exports = [
10
10
  if(_.platform === "laravel" || _.platform === "wordpress" || _.platform === "drupal" || _.platform === "craftcms"){
11
11
  _.up(() => execSync(`source ${__dirname}/../intercept.sh && /bin/bash ./_Scripts/setup.sh`, _.opts));
12
12
  } else {
13
- execSync(`${_.docker} ${_.run} -c "npm run setup"`, _.opts);
13
+ _.command("core", `npm run setup`);
14
14
  }
15
15
  }
16
16
  ];
package/commands/start.js CHANGED
@@ -1,7 +1,5 @@
1
1
  const _ = require('../globals.js');
2
2
 
3
- const execSync = require('child_process').execSync;
4
-
5
3
  module.exports = [
6
4
  'start [flags...]',
7
5
  'build -> watch',
@@ -13,21 +11,13 @@ module.exports = [
13
11
  },
14
12
  argv => {
15
13
  _.ports.get();
14
+
15
+ const command = () => _.command("core", `npm start -- -- ${argv.flags.join(' ')}`, true);
16
16
 
17
17
  if(_.platform === "laravel" || _.platform === "wordpress" || _.platform === "drupal" || _.platform === "craftcms"){
18
- _.up(() => {
19
- let run = ' -l';
20
- let user = '';
21
- // Don't login on core@1 so /etc/profile isn't loaded and $PATH reset (likely don't need to login on anything other than core@0 but need test suite to check)
22
- if(process.env.VERSION === "1"){
23
- run = '';
24
- user = ' -u node';
25
- }
26
-
27
- execSync(`${_.docker} ${_.exec}${user} core bash${run} -c "npm start -- -- ${argv.flags.join(' ')}" 2>/dev/null`, _.opts);
28
- });
18
+ _.up(command);
29
19
  } else {
30
- execSync(`${_.docker} ${_.run} -c "npm start -- -- ${argv.flags.join(' ')}" 2>/dev/null`, _.opts);
20
+ command();
31
21
  }
32
22
  }
33
23
  ];
package/commands/test.js CHANGED
@@ -1,25 +1,15 @@
1
1
  const _ = require('../globals.js');
2
2
 
3
- const execSync = require('child_process').execSync;
4
-
5
3
  module.exports = [
6
4
  'test',
7
5
  'run tests',
8
6
  yargs => {},
9
7
  argv => {
10
8
  _.up(() => {
11
- let run = ' -l';
12
- let user = '';
13
- // Don't login on core@1 so /etc/profile isn't loaded and $PATH reset (likely don't need to login on anything other than core@0 but need test suite to check)
14
- if(process.env.VERSION === "1"){
15
- run = '';
16
- user = ' -u node';
17
- }
18
-
19
- execSync(`${_.docker} ${_.exec}${user} core bash${run} -c "${(process.env.VERSION === "0") ? 'xvfb-run ' : ''}npm run test"`, _.opts);
9
+ _.command("core", `${(process.env.VERSION === "0") ? 'xvfb-run ' : ''}npm run test`);
20
10
 
21
11
  if(_.platform === "laravel"){
22
- execSync(`${_.docker} ${_.exec} php bash -lc "php artisan test"`, _.opts);
12
+ _.command("php", `php artisan test`);
23
13
  }
24
14
  });
25
15
  }
@@ -1,7 +1,5 @@
1
1
  const _ = require('../globals.js');
2
2
 
3
- const execSync = require('child_process').execSync;
4
-
5
3
  module.exports = [
6
4
  ['uninstall [package...]'],
7
5
  'runs npm uninstall on a package/packages',
@@ -11,5 +9,5 @@ module.exports = [
11
9
  default: ''
12
10
  });
13
11
  },
14
- argv => execSync(`${_.docker} ${_.run} -c "npm uninstall ${argv.package.join(' ')}"`, _.opts)
12
+ argv => _.command("core", `npm uninstall ${argv.package.join(' ')}`)
15
13
  ];
package/commands/watch.js CHANGED
@@ -1,7 +1,5 @@
1
1
  const _ = require('../globals.js');
2
2
 
3
- const execSync = require('child_process').execSync;
4
-
5
3
  module.exports = [
6
4
  'watch',
7
5
  'watch',
@@ -14,7 +12,15 @@ module.exports = [
14
12
  ){
15
13
  console.log("Watch command not supported in this project");
16
14
  } else {
17
- execSync(`${_.docker} ${_.run} -c "$grunt browserSync watch" 2>/dev/null`, _.opts)
15
+ const prep = 'npx grunt --gruntfile node_modules/@fishawack/core/Gruntfile.js ';
16
+
17
+ const command = () => _.command("core", `${prep}browserSync watch`, true);
18
+
19
+ if(_.platform === "laravel" || _.platform === "wordpress" || _.platform === "drupal" || _.platform === "craftcms"){
20
+ _.up(command);
21
+ } else {
22
+ command();
23
+ }
18
24
  }
19
25
  }
20
26
  ];
package/commands/wp.js CHANGED
@@ -11,5 +11,5 @@ module.exports = [
11
11
  default: ''
12
12
  });
13
13
  },
14
- argv => _.up(() => execSync(`${_.docker} ${_.exec} wordpress bash -lc "wp ${argv.command.join(' ')} --allow-root"`, _.opts))
14
+ argv => _.up(() => _.command("wordpress", `wp ${argv.command.join(' ')} --allow-root`))
15
15
  ];
@@ -2,6 +2,8 @@ version: "3.8"
2
2
  services:
3
3
  core:
4
4
  platform: linux/amd64
5
+ build:
6
+ context: $DIRNAME/core/0/
5
7
  image: fishawack/core:${FW_CORE_0_VERSION:-latest}
6
8
  init: true
7
9
  tty: true
@@ -1,5 +1,9 @@
1
1
  ## Changelog
2
2
 
3
+ ### 1.3.0 (2023-03-17)
4
+ * [feat] node user is now added to www-data group for easier file permission management
5
+ * [fix] disable npm message about update being available
6
+
3
7
  ### 1.2.2 (2023-02-25)
4
8
  * [fix] set BRANCH and CI_COMMIT_REF_NAME env variables in container
5
9
  * [fix] installed git-branch to fetch the current branch for deployment targets
package/core/1/Dockerfile CHANGED
@@ -28,6 +28,12 @@ RUN rm -rf /sass.tar.gz
28
28
  # Set safe directory to remove intel errors when running git rev-parse
29
29
  RUN su node -c "git config --global --add safe.directory /app"
30
30
 
31
+ # Disable npm message about updates being available
32
+ RUN su node -c "npm config set update-notifier false"
33
+
34
+ # Add node user to www-data group
35
+ RUN usermod -a -G www-data node
36
+
31
37
  # Install lftp
32
38
  RUN apt-get install -y lftp
33
39
 
@@ -1,6 +1,9 @@
1
1
  version: "3.8"
2
2
  services:
3
3
  core:
4
+ build:
5
+ context: $DIRNAME/core/1/
6
+ target: ${FW_CORE_1_TARGET:-alpine}
4
7
  image: ${FW_CORE_1_IMAGE:-fishawack/lab-env-core-1-alpine}:${FW_CORE_1_VERSION:-latest}
5
8
  init: true
6
9
  tty: true
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "core",
3
- "version": "1.2.2",
3
+ "version": "1.3.0",
4
4
  "description": "lab-env docker config for the @fishawack/core/1 npm module",
5
5
  "scripts": {
6
6
  "preversion": "docker login",
@@ -0,0 +1,4 @@
1
+ ## Changelog
2
+
3
+ ### 1.0.0 (2023-03-23)
4
+ * [Misc] initial commit
@@ -0,0 +1,11 @@
1
+ FROM httpd:2.4.54 AS development
2
+
3
+ MAINTAINER Mike Mellor
4
+
5
+ # Copy nginx conf
6
+ COPY ./httpd.conf /usr/local/apache2/conf/httpd.conf
7
+
8
+ FROM fishawack/lab-env-craftcms-3-apache:latest AS production
9
+
10
+ # Copy source code into container
11
+ COPY . /app