@fishawack/lab-env 1.13.0 → 1.17.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.
- package/CHANGELOG.md +16 -0
- package/cli.js +3 -0
- package/core/{0.0.19 → 0.0.20}/Dockerfile +0 -0
- package/core/{0.0.19 → 0.0.20}/entrypoint.sh +0 -0
- package/core/docker-compose-dev.yml +5 -0
- package/core/{0.0.19/docker-compose.yml → docker-compose.yml} +1 -4
- package/core/package.json +10 -0
- package/drupal/9/docker-compose.yml +1 -0
- package/drupal/9/php/Dockerfile +6 -0
- package/globals.js +24 -9
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
## Changelog
|
|
2
2
|
|
|
3
|
+
### 1.17.0 (2022-01-27)
|
|
4
|
+
* [Feature] Drupals php image now contains imagemagick and imagick
|
|
5
|
+
* [Change] Drupals php image is now labelled and tagged
|
|
6
|
+
|
|
7
|
+
### 1.16.0 (2022-01-25)
|
|
8
|
+
* [Feature] lab-env now checks if docker process is running. Only `origin` and `--version` commands allowed if not
|
|
9
|
+
|
|
10
|
+
### 1.15.0 (2022-01-17)
|
|
11
|
+
* [Feature] Docker images are now pulled from docker hub if lab-env not running with devDependencies installed
|
|
12
|
+
* [Feature] Added a package.json to the core package in lab-env for more streamlined docker hub publishes
|
|
13
|
+
* [Change] Core image path now defined by new $DIRNAME variable
|
|
14
|
+
* [Change] Ignore fixtures in tests folder as they're cloned repos
|
|
15
|
+
|
|
16
|
+
### 1.14.0 (2021-12-03)
|
|
17
|
+
* [Change] Bumped core `0.0.19` to `0.0.20`
|
|
18
|
+
|
|
3
19
|
### 1.13.0 (2021-12-03)
|
|
4
20
|
* [Feature] Installed elastic beanstalk cli into the core image
|
|
5
21
|
* [Feature] Core image now mounts the .aws folder
|
package/cli.js
CHANGED
|
@@ -15,6 +15,9 @@ const { hideBin } = require('yargs/helpers');
|
|
|
15
15
|
|
|
16
16
|
const args = hideBin(process.argv);
|
|
17
17
|
|
|
18
|
+
// Stop here if docker process not running and command isn't version or origin which don't require docker
|
|
19
|
+
if(!_.services && !(args[0] === 'origin' || args[0] === '--version')) return;
|
|
20
|
+
|
|
18
21
|
(async () => {
|
|
19
22
|
process.env.REPO = _.repo;
|
|
20
23
|
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "core",
|
|
3
|
+
"version": "0.0.20",
|
|
4
|
+
"description": "lab-env docker config for the @fishawack/core npm module",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"postversion": "docker tag fishawack/core:$npm_package_version fishawack/core:latest && docker push fishawack/core:$npm_package_version fishawack/core:latest"
|
|
7
|
+
},
|
|
8
|
+
"author": "Mike Mellor",
|
|
9
|
+
"license": "ISC"
|
|
10
|
+
}
|
package/drupal/9/php/Dockerfile
CHANGED
|
@@ -6,6 +6,12 @@ MAINTAINER Mike Mellor
|
|
|
6
6
|
RUN apt-get update && \
|
|
7
7
|
apt-get install -y mariadb-client
|
|
8
8
|
|
|
9
|
+
# Install Imagemagick
|
|
10
|
+
RUN apt-get install -y libmagickwand-dev --no-install-recommends
|
|
11
|
+
|
|
12
|
+
# PHP Imagick ext
|
|
13
|
+
RUN pecl install imagick && docker-php-ext-enable imagick
|
|
14
|
+
|
|
9
15
|
# Cleanup apt-get install folders
|
|
10
16
|
RUN apt-get clean && \
|
|
11
17
|
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
package/globals.js
CHANGED
|
@@ -4,6 +4,8 @@ const { lstatSync, readdirSync, copyFileSync, existsSync } = require('fs');
|
|
|
4
4
|
const semver = require('semver');
|
|
5
5
|
const getPort = require('get-port');
|
|
6
6
|
|
|
7
|
+
process.env.DIRNAME = __dirname;
|
|
8
|
+
|
|
7
9
|
const isDirectory = source => lstatSync(source).isDirectory();
|
|
8
10
|
const getDirectories = source => readdirSync(source).map(name => path.join(source, name)).filter(isDirectory);
|
|
9
11
|
|
|
@@ -50,35 +52,48 @@ const version = pkg && pkg.devDependencies && (pkg.devDependencies['@fishawack/c
|
|
|
50
52
|
process.env.VERSION = versions[0];
|
|
51
53
|
// }
|
|
52
54
|
|
|
55
|
+
var core = `-f ${__dirname}/core/docker-compose.yml`;
|
|
56
|
+
|
|
57
|
+
// If dev dep installed, then assume running from npm linked local dev version of lab-env and point to build context rather than docker hub
|
|
58
|
+
try {
|
|
59
|
+
require('mocha');
|
|
60
|
+
core = `-f ${__dirname}/core/docker-compose-dev.yml ${core}`;
|
|
61
|
+
} catch(e) {}
|
|
62
|
+
|
|
53
63
|
if(platform === 'laravel'){
|
|
54
64
|
if(!existsSync(path.join(process.cwd(), '.env'))){
|
|
55
65
|
copyFileSync(path.join(process.cwd(), '.env.example'), path.join(process.cwd(), '.env'));
|
|
56
66
|
}
|
|
57
67
|
|
|
58
|
-
docker = `docker-compose --env-file ${path.join(process.cwd(), '.env')} -f ${__dirname}/laravel/8/docker-compose.yml
|
|
68
|
+
docker = `docker-compose --env-file ${path.join(process.cwd(), '.env')} -f ${__dirname}/laravel/8/docker-compose.yml ${core} -p ${repo}`;
|
|
59
69
|
} else if(platform === 'wordpress'){
|
|
60
70
|
if(!existsSync(path.join(process.cwd(), '.env'))){
|
|
61
71
|
copyFileSync(path.join(process.cwd(), '.env.example'), path.join(process.cwd(), '.env'));
|
|
62
72
|
}
|
|
63
73
|
|
|
64
|
-
docker = `docker-compose --env-file ${path.join(process.cwd(), '.env')} -f ${__dirname}/wordpress/5.7.2/docker-compose.yml
|
|
74
|
+
docker = `docker-compose --env-file ${path.join(process.cwd(), '.env')} -f ${__dirname}/wordpress/5.7.2/docker-compose.yml ${core} -p ${repo}`;
|
|
65
75
|
} else if(platform === "drupal"){
|
|
66
76
|
if(!existsSync(path.join(process.cwd(), '.env'))){
|
|
67
77
|
copyFileSync(path.join(process.cwd(), '.env.example'), path.join(process.cwd(), '.env'));
|
|
68
78
|
}
|
|
69
79
|
|
|
70
|
-
docker = `docker-compose --env-file ${path.join(process.cwd(), '.env')} -f ${__dirname}/drupal/9/docker-compose.yml
|
|
80
|
+
docker = `docker-compose --env-file ${path.join(process.cwd(), '.env')} -f ${__dirname}/drupal/9/docker-compose.yml ${core} -p ${repo}`;
|
|
71
81
|
} else {
|
|
72
|
-
docker = `docker-compose
|
|
82
|
+
docker = `docker-compose ${core} -p ${repo}`;
|
|
73
83
|
}
|
|
74
84
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
85
|
+
try{
|
|
86
|
+
services = execSync(`${docker} ps --services --filter "status=running" 2>/dev/null`, {encoding: 'utf8'});
|
|
87
|
+
running = services.trim().length;
|
|
88
|
+
exec = `exec ${process.env.CI_BUILD_ID ? '-T' : ''}`;
|
|
89
|
+
method = running ? exec : 'run --rm --service-ports';
|
|
90
|
+
run = `${method} core bash -l`;
|
|
91
|
+
} catch(e){
|
|
92
|
+
console.log("Docker does not appear to be running...");
|
|
93
|
+
}
|
|
80
94
|
|
|
81
95
|
module.exports = {
|
|
96
|
+
services,
|
|
82
97
|
platform,
|
|
83
98
|
repo,
|
|
84
99
|
repo_safe: repo.replace(/\./g, ''),
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fishawack/lab-env",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.17.0",
|
|
4
4
|
"description": "Docker manager for FW",
|
|
5
5
|
"main": "cli.js",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"test": "mocha _Test/*.js --timeout 120s --bail",
|
|
7
|
+
"test": "rm -rf _Test/_fixtures && mocha _Test/*.js --timeout 120s --bail",
|
|
8
8
|
"preversion": "npm test",
|
|
9
9
|
"postversion": "git push && git push --tags && npm publish",
|
|
10
10
|
"postpublish": "git checkout development && git merge master && git push"
|