@fishawack/lab-env 1.6.3
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/.gitattributes +1 -0
- package/CHANGELOG.md +234 -0
- package/README.md +197 -0
- package/cli.js +71 -0
- package/commands/artisan.js +15 -0
- package/commands/check.js +16 -0
- package/commands/clean.js +16 -0
- package/commands/composer.js +15 -0
- package/commands/connect.js +15 -0
- package/commands/content.js +10 -0
- package/commands/create/cmds/delete.js +27 -0
- package/commands/create/cmds/diagnose.js +77 -0
- package/commands/create/cmds/new.js +48 -0
- package/commands/create/libs/prompts.js +60 -0
- package/commands/create/libs/utilities.js +50 -0
- package/commands/create/libs/vars.js +95 -0
- package/commands/create/services/api.js +3 -0
- package/commands/create/services/bitbucket.js +92 -0
- package/commands/create/services/egnyte.js +31 -0
- package/commands/create/services/git.js +31 -0
- package/commands/create/services/gitlab.js +30 -0
- package/commands/create/services/guide.js +296 -0
- package/commands/create/services/test.js +138 -0
- package/commands/deploy.js +23 -0
- package/commands/docker/build.js +10 -0
- package/commands/docker/config.js +10 -0
- package/commands/docker/down.js +10 -0
- package/commands/docker/mocha.js +10 -0
- package/commands/docker/rebuild.js +10 -0
- package/commands/docker/up.js +15 -0
- package/commands/docker/volumes.js +27 -0
- package/commands/execute.js +21 -0
- package/commands/install.js +15 -0
- package/commands/npm.js +15 -0
- package/commands/nuke.js +17 -0
- package/commands/origin.js +126 -0
- package/commands/php.js +15 -0
- package/commands/production.js +10 -0
- package/commands/regenerate.js +16 -0
- package/commands/reinstall.js +16 -0
- package/commands/run.js +25 -0
- package/commands/setup.js +27 -0
- package/commands/start.js +33 -0
- package/commands/test.js +22 -0
- package/commands/uninstall.js +15 -0
- package/commands/watch.js +20 -0
- package/core/0.0.19/Dockerfile +234 -0
- package/core/0.0.19/docker-compose.yml +27 -0
- package/core/0.0.19/entrypoint.sh +4 -0
- package/globals.js +85 -0
- package/intercept.sh +37 -0
- package/laravel/8/docker-compose.yml +49 -0
- package/laravel/8/nginx/nginx.conf +37 -0
- package/laravel/8/php/custom.conf +7 -0
- package/package.json +33 -0
- package/wordpress/5.7.2/apache/.htaccess +25 -0
- package/wordpress/5.7.2/apache/uploads.ini +6 -0
- package/wordpress/5.7.2/docker-compose.yml +42 -0
package/commands/php.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const _ = require('../globals.js');
|
|
2
|
+
|
|
3
|
+
const execSync = require('child_process').execSync;
|
|
4
|
+
|
|
5
|
+
module.exports = [
|
|
6
|
+
'php [command...]',
|
|
7
|
+
'run php command',
|
|
8
|
+
yargs => {
|
|
9
|
+
yargs.positional('command', {
|
|
10
|
+
describe: 'command to run',
|
|
11
|
+
default: ''
|
|
12
|
+
});
|
|
13
|
+
},
|
|
14
|
+
argv => execSync(`${_.docker} ${_.method} php bash -lc "php ${argv.command.join(' ')}"`, _.opts)
|
|
15
|
+
];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const _ = require('../globals.js');
|
|
2
|
+
|
|
3
|
+
const execSync = require('child_process').execSync;
|
|
4
|
+
|
|
5
|
+
module.exports = [
|
|
6
|
+
['production', 'prod'],
|
|
7
|
+
'builds for production',
|
|
8
|
+
yargs => {},
|
|
9
|
+
argv => execSync(`${_.docker} ${_.run}c "xvfb-run npm run production"`, _.opts)
|
|
10
|
+
];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const _ = require('../globals.js');
|
|
2
|
+
|
|
3
|
+
const execSync = require('child_process').execSync;
|
|
4
|
+
|
|
5
|
+
module.exports = [
|
|
6
|
+
['regenerate', 'regen'],
|
|
7
|
+
'regenerates dependency lock files',
|
|
8
|
+
yargs => {},
|
|
9
|
+
argv => {
|
|
10
|
+
execSync(`${_.docker} ${_.run}c "rm package-lock.json; git clean -xfd node_modules/ 2>/dev/null || true; npm install"`, _.opts);
|
|
11
|
+
|
|
12
|
+
if(_.platform === "laravel"){
|
|
13
|
+
execSync(`${_.docker} ${_.method} php bash -lc "rm composer.lock; git clean -xfd vendor/ 2>/dev/null || true; composer install"`, _.opts)
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const _ = require('../globals.js');
|
|
2
|
+
|
|
3
|
+
const execSync = require('child_process').execSync;
|
|
4
|
+
|
|
5
|
+
module.exports = [
|
|
6
|
+
['reinstall', 'ci'],
|
|
7
|
+
'installs fresh dependencies',
|
|
8
|
+
yargs => {},
|
|
9
|
+
argv => {
|
|
10
|
+
execSync(`${_.docker} ${_.run}c "npm ci || npm i"`, _.opts);
|
|
11
|
+
|
|
12
|
+
if(_.platform === "laravel"){
|
|
13
|
+
execSync(`${_.docker} ${_.method} php bash -lc "composer install"`, _.opts);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
];
|
package/commands/run.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const _ = require('../globals.js');
|
|
2
|
+
|
|
3
|
+
const execSync = require('child_process').execSync;
|
|
4
|
+
|
|
5
|
+
module.exports = [
|
|
6
|
+
'run [command] [flags...]',
|
|
7
|
+
'run an npm script',
|
|
8
|
+
yargs => {
|
|
9
|
+
yargs.positional('command', {
|
|
10
|
+
describe: 'command to run',
|
|
11
|
+
default: 'test'
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
yargs.positional('flags', {
|
|
15
|
+
describe: 'flags to pass',
|
|
16
|
+
default: ''
|
|
17
|
+
});
|
|
18
|
+
yargs.option('display', {
|
|
19
|
+
alias: 'd',
|
|
20
|
+
describe: 'Run with a virtual display',
|
|
21
|
+
type: 'boolean'
|
|
22
|
+
});
|
|
23
|
+
},
|
|
24
|
+
argv => execSync(`${_.docker} ${_.run}c "${argv.d ? 'xvfb-run ' : ''}npm run ${argv.command} -- -- ${argv.flags.join(' ')}"`, _.opts)
|
|
25
|
+
];
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const _ = require('../globals.js');
|
|
2
|
+
|
|
3
|
+
const execSync = require('child_process').execSync;
|
|
4
|
+
|
|
5
|
+
module.exports = [
|
|
6
|
+
'setup',
|
|
7
|
+
'runs the initial setup',
|
|
8
|
+
yargs => {},
|
|
9
|
+
argv => {
|
|
10
|
+
if(_.platform === "laravel" || _.platform === "wordpress"){
|
|
11
|
+
execSync(`lab-env up -d`, _.opts);
|
|
12
|
+
|
|
13
|
+
// Run setup.sh directly as other containers need to run not just node/core
|
|
14
|
+
try{
|
|
15
|
+
execSync(`source ${__dirname}/../intercept.sh && /bin/bash ./_Scripts/setup.sh`, _.opts);
|
|
16
|
+
} catch(e){
|
|
17
|
+
if(e.status !== 130 && e.status !== 131 && e.status !== 1){
|
|
18
|
+
console.log(e.message);
|
|
19
|
+
}
|
|
20
|
+
} finally{
|
|
21
|
+
execSync(`lab-env down`, _.opts);
|
|
22
|
+
}
|
|
23
|
+
} else {
|
|
24
|
+
execSync(`${_.docker} ${_.run}c "npm run setup"`, _.opts);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
];
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const _ = require('../globals.js');
|
|
2
|
+
|
|
3
|
+
const execSync = require('child_process').execSync;
|
|
4
|
+
|
|
5
|
+
module.exports = [
|
|
6
|
+
'start [flags...]',
|
|
7
|
+
'build -> watch',
|
|
8
|
+
yargs => {
|
|
9
|
+
yargs.positional('flags', {
|
|
10
|
+
describe: 'flags to pass',
|
|
11
|
+
default: ''
|
|
12
|
+
});
|
|
13
|
+
},
|
|
14
|
+
argv => {
|
|
15
|
+
if(_.platform === "laravel" || _.platform === "wordpress"){
|
|
16
|
+
_.ports();
|
|
17
|
+
|
|
18
|
+
execSync(`lab-env up -d`, _.opts);
|
|
19
|
+
|
|
20
|
+
try{
|
|
21
|
+
execSync(`${_.docker} ${_.exec} core bash -lc "npm start -- -- ${argv.flags.join(' ')}" 2>/dev/null`, _.opts);
|
|
22
|
+
} catch(e){
|
|
23
|
+
if(e.status !== 130 && e.status !== 131 && e.status !== 1){
|
|
24
|
+
console.log(e);
|
|
25
|
+
}
|
|
26
|
+
} finally{
|
|
27
|
+
execSync(`lab-env down`, _.opts);
|
|
28
|
+
}
|
|
29
|
+
} else {
|
|
30
|
+
execSync(`${_.docker} ${_.run}c "npm start -- -- ${argv.flags.join(' ')}" 2>/dev/null`, _.opts);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
];
|
package/commands/test.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const _ = require('../globals.js');
|
|
2
|
+
|
|
3
|
+
const execSync = require('child_process').execSync;
|
|
4
|
+
|
|
5
|
+
module.exports = [
|
|
6
|
+
'test',
|
|
7
|
+
'run tests',
|
|
8
|
+
yargs => {},
|
|
9
|
+
argv => {
|
|
10
|
+
execSync(`lab-env up -d`, _.opts);
|
|
11
|
+
|
|
12
|
+
try{
|
|
13
|
+
execSync(`${_.docker} ${_.exec} core bash -lc "xvfb-run npm run test"`, _.opts);
|
|
14
|
+
|
|
15
|
+
if(_.platform === "laravel"){
|
|
16
|
+
execSync(`${_.docker} ${_.exec} php bash -lc "php artisan test"`, _.opts);
|
|
17
|
+
}
|
|
18
|
+
} finally{
|
|
19
|
+
execSync(`lab-env down`, _.opts);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const _ = require('../globals.js');
|
|
2
|
+
|
|
3
|
+
const execSync = require('child_process').execSync;
|
|
4
|
+
|
|
5
|
+
module.exports = [
|
|
6
|
+
['uninstall [package...]'],
|
|
7
|
+
'runs npm uninstall on a package/packages',
|
|
8
|
+
yargs => {
|
|
9
|
+
yargs.positional('package', {
|
|
10
|
+
describe: 'package to uninstall',
|
|
11
|
+
default: ''
|
|
12
|
+
});
|
|
13
|
+
},
|
|
14
|
+
argv => execSync(`${_.docker} ${_.run}c "npm uninstall ${argv.package.join(' ')}"`, _.opts)
|
|
15
|
+
];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const _ = require('../globals.js');
|
|
2
|
+
|
|
3
|
+
const execSync = require('child_process').execSync;
|
|
4
|
+
|
|
5
|
+
module.exports = [
|
|
6
|
+
'watch',
|
|
7
|
+
'watch',
|
|
8
|
+
yargs => {},
|
|
9
|
+
argv => {
|
|
10
|
+
if(
|
|
11
|
+
_.pkg.name === "sprinkle-base" ||
|
|
12
|
+
_.pkg.name === "@fishawack/sprinkle-base" ||
|
|
13
|
+
_.pkg.name === "@fishawack/stream"
|
|
14
|
+
){
|
|
15
|
+
console.log("Watch command not supported in this project");
|
|
16
|
+
} else {
|
|
17
|
+
execSync(`${_.docker} ${_.run}c "$grunt browserSync watch" 2>/dev/null`, _.opts)
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
];
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
FROM ubuntu:20.04
|
|
2
|
+
|
|
3
|
+
MAINTAINER Mike Mellor
|
|
4
|
+
|
|
5
|
+
# Silences bash no tty warning
|
|
6
|
+
RUN echo '#! /bin/sh' > /usr/bin/mesg
|
|
7
|
+
|
|
8
|
+
SHELL ["/bin/bash", "-l", "-c"]
|
|
9
|
+
|
|
10
|
+
# Set Timezone
|
|
11
|
+
ENV TZ=Europe/London
|
|
12
|
+
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
|
13
|
+
|
|
14
|
+
# Update apt-get
|
|
15
|
+
RUN apt-get update
|
|
16
|
+
|
|
17
|
+
# Install curl
|
|
18
|
+
RUN apt-get install -y curl git zip unzip vim
|
|
19
|
+
|
|
20
|
+
# Install wget
|
|
21
|
+
RUN apt-get install -y wget
|
|
22
|
+
|
|
23
|
+
# Install node
|
|
24
|
+
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash
|
|
25
|
+
|
|
26
|
+
RUN apt-get install -y nodejs
|
|
27
|
+
|
|
28
|
+
# Update npm to latest
|
|
29
|
+
RUN npm install npm@6 -g
|
|
30
|
+
|
|
31
|
+
# Lock npm versions
|
|
32
|
+
RUN npm config set save-exact=true
|
|
33
|
+
|
|
34
|
+
# Install grunt-cli
|
|
35
|
+
RUN npm install grunt-cli -g
|
|
36
|
+
|
|
37
|
+
# Install package.json checker
|
|
38
|
+
RUN npm install check-dependencies -g
|
|
39
|
+
|
|
40
|
+
# Install imagemagick
|
|
41
|
+
RUN apt-get update && apt-get install -y imagemagick
|
|
42
|
+
|
|
43
|
+
# Install dart
|
|
44
|
+
# RUN apt-get update
|
|
45
|
+
# RUN apt-get install -y apt-transport-https
|
|
46
|
+
# RUN sh -c 'wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -'
|
|
47
|
+
# RUN sh -c 'wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'
|
|
48
|
+
# RUN apt-get update
|
|
49
|
+
# RUN apt-get install dart
|
|
50
|
+
# RUN echo 'export PATH="$PATH:/usr/lib/dart/bin"' >> ~/.profile
|
|
51
|
+
# RUN echo 'export PATH="$PATH:$HOME/.pub-cache/bin"' >> ~/.profile
|
|
52
|
+
# RUN pub global activate sass
|
|
53
|
+
|
|
54
|
+
# Install dart sass vm
|
|
55
|
+
RUN curl -L -o /sass.tar.gz https://github.com/sass/dart-sass/releases/download/1.34.0/dart-sass-1.34.0-linux-x64.tar.gz
|
|
56
|
+
RUN tar -xf /sass.tar.gz -C /
|
|
57
|
+
RUN echo 'export PATH="$PATH:/dart-sass/"' >> ~/.profile
|
|
58
|
+
|
|
59
|
+
# Install python
|
|
60
|
+
RUN apt-get update
|
|
61
|
+
RUN apt-get install -y python
|
|
62
|
+
|
|
63
|
+
# Install wine
|
|
64
|
+
RUN apt install -y software-properties-common
|
|
65
|
+
RUN dpkg --add-architecture i386
|
|
66
|
+
|
|
67
|
+
RUN wget -nc https://dl.winehq.org/wine-builds/winehq.key
|
|
68
|
+
RUN apt-key add winehq.key
|
|
69
|
+
|
|
70
|
+
RUN add-apt-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main'
|
|
71
|
+
|
|
72
|
+
RUN wget -nv https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_18.04/Release.key -O /tmp/Release.key
|
|
73
|
+
RUN apt-key add - < /tmp/Release.key
|
|
74
|
+
|
|
75
|
+
RUN apt-add-repository 'deb https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_18.04/ ./'
|
|
76
|
+
RUN apt-get update
|
|
77
|
+
|
|
78
|
+
RUN apt-get install -y --install-recommends winehq-stable
|
|
79
|
+
|
|
80
|
+
# Install PHP & composer
|
|
81
|
+
RUN add-apt-repository ppa:ondrej/php
|
|
82
|
+
RUN apt-get update
|
|
83
|
+
RUN apt-get install -y php7.2 php7.2-gd
|
|
84
|
+
# RUN apt-get install -y php7.0
|
|
85
|
+
# RUN apt-get install -y php7.0-gd
|
|
86
|
+
# RUN docker-php-ext-install gd
|
|
87
|
+
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
|
88
|
+
|
|
89
|
+
# Install ftp
|
|
90
|
+
RUN apt-get install -y tnftp
|
|
91
|
+
|
|
92
|
+
# Install lftp
|
|
93
|
+
RUN apt-get install -y lftp
|
|
94
|
+
|
|
95
|
+
# PDF
|
|
96
|
+
RUN apt-get install -y g++ build-essential ghostscript
|
|
97
|
+
RUN apt install -y default-jre
|
|
98
|
+
RUN apt-get install -y xvfb
|
|
99
|
+
|
|
100
|
+
# Latest chrome version
|
|
101
|
+
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
|
|
102
|
+
RUN echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' | tee /etc/apt/sources.list.d/google-chrome.list
|
|
103
|
+
RUN apt-get update
|
|
104
|
+
# RUN apt-get install -y google-chrome-stable
|
|
105
|
+
|
|
106
|
+
# Specific chrome version
|
|
107
|
+
# Check available versions here: https://www.ubuntuupdates.org/package/google_chrome/stable/main/base/google-chrome-stable
|
|
108
|
+
ARG CHROME_VERSION="87.0.4280.141-1"
|
|
109
|
+
RUN wget --no-verbose -O /tmp/chrome.deb http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}_amd64.deb
|
|
110
|
+
RUN apt install -y /tmp/chrome.deb
|
|
111
|
+
|
|
112
|
+
# Set flags to allow chrome to run as root user
|
|
113
|
+
RUN sed -i '49s/.*/exec -a "$0" "$HERE\/chrome" "$@" --no-sandbox --disable-setuid-sandbox --disable-dev-shm-usage/' /opt/google/chrome/google-chrome
|
|
114
|
+
|
|
115
|
+
# RUN apt-get install -y firefox
|
|
116
|
+
ARG FIREFOX_VERSION=84.0
|
|
117
|
+
RUN apt-get update -qqy \
|
|
118
|
+
&& apt-get -qqy --no-install-recommends install firefox \
|
|
119
|
+
# && rm -rf /var/lib/apt/lists/* /var/cache/apt/* \
|
|
120
|
+
&& wget --no-verbose -O /tmp/firefox.tar.bz2 https://download-installer.cdn.mozilla.net/pub/firefox/releases/$FIREFOX_VERSION/linux-x86_64/en-US/firefox-$FIREFOX_VERSION.tar.bz2 \
|
|
121
|
+
&& apt-get -y purge firefox \
|
|
122
|
+
&& rm -rf /opt/firefox \
|
|
123
|
+
&& tar -C /opt -xjf /tmp/firefox.tar.bz2 \
|
|
124
|
+
&& rm /tmp/firefox.tar.bz2 \
|
|
125
|
+
&& mv /opt/firefox /opt/firefox-$FIREFOX_VERSION \
|
|
126
|
+
&& ln -fs /opt/firefox-$FIREFOX_VERSION/firefox /usr/bin/firefox
|
|
127
|
+
|
|
128
|
+
RUN apt-get install -y dos2unix
|
|
129
|
+
|
|
130
|
+
RUN apt-get install -y locales
|
|
131
|
+
|
|
132
|
+
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
|
|
133
|
+
locale-gen
|
|
134
|
+
|
|
135
|
+
# Cleanup apt-get install folders
|
|
136
|
+
RUN apt-get clean && \
|
|
137
|
+
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
|
138
|
+
|
|
139
|
+
# Add known hosts to stop npm from stopping when hitting a git dependency
|
|
140
|
+
#RUN ssh-keyscan bitbucket.org > /etc/ssh/ssh_known_hosts
|
|
141
|
+
|
|
142
|
+
RUN echo $'\
|
|
143
|
+
parse_git_branch() {\n\
|
|
144
|
+
git branch 2> /dev/null | sed -e "/^[^*]/d" -e "s/* \(.*\)/ @\\1/"\n\
|
|
145
|
+
}\n\
|
|
146
|
+
export OVERRIDE=true\n\
|
|
147
|
+
git(){(\n\
|
|
148
|
+
set -e\n\
|
|
149
|
+
if [[ ${OVERRIDE} == true && "$1" == "rev-parse" && "$2" == "--show-toplevel" ]]; then\n\
|
|
150
|
+
echo ${REPO}\n\
|
|
151
|
+
elif [[ ${OVERRIDE} == true && "$1" == "rev-parse" && "$2" == "--short" && "$3" == "HEAD" && ! $(git rev-parse --git-dir 2>/dev/null) ]]; then\n\
|
|
152
|
+
echo "$((100000 + $RANDOM % 999999))"\n\
|
|
153
|
+
else\n\
|
|
154
|
+
command git "$@" || exit 1\n\
|
|
155
|
+
fi\n\
|
|
156
|
+
)}\n\
|
|
157
|
+
npm(){(\n\
|
|
158
|
+
set -e\n\
|
|
159
|
+
if [[ "$1" != "start" && "$1" != "test" && "$1" != "run" && "$1" != "version" ]]; then\n\
|
|
160
|
+
export OVERRIDE=false\n\
|
|
161
|
+
command npm "$@" || exit 1\n\
|
|
162
|
+
echo "Adding the --upload-older flag to lftp deploy to stop vendor files being ignored"\n\
|
|
163
|
+
sed -i \'s/--parallel=10/--upload-older --parallel=10/g\' $PWD/node_modules/@fishawack/core/_Tasks/deploy.js 2>/dev/null || true\n\
|
|
164
|
+
echo "Replacing parallel flag of lftp push as uploads can sometimes fail if the server rejects"\n\
|
|
165
|
+
sed -i \'s/--parallel=10/--parallel=1/g\' $PWD/node_modules/@fishawack/config-grunt/_Tasks/options/shell.js 2>/dev/null || true\n\
|
|
166
|
+
sed -i \'s/--parallel=10/--parallel=1/g\' $PWD/node_modules/@fishawack/core/_Tasks/options/shell.js 2>/dev/null || true\n\
|
|
167
|
+
echo "Replacing any npm variables with the full values"\n\
|
|
168
|
+
sed -i \'s/$npm_package_vars_config/--prefix node_modules\/@fishawack\/config-grunt\//g\' package.json 2>/dev/null || true\n\
|
|
169
|
+
echo "Replace line in ftpscript that toggles passive which these days toggles it to off mode which breaks the docker setup"\n\
|
|
170
|
+
sed -i "s/cmds.push \'passive\' if opts.passive/\#remove passive line/g" $PWD/node_modules/grunt-ftpscript/tasks/ftpscript.coffee 2>/dev/null || true\n\
|
|
171
|
+
echo "Add line to browser-sync to enable polling as file events not fired on windows docker projects"\n\
|
|
172
|
+
sed -i \'s/watchTask: true,/watchTask: true,watchOptions: { usePolling: true },port: process.env.PORT || 3000, ui: {port: +process.env.PORT_OPT || 3001},/g\' $PWD/node_modules/@fishawack/core/_Tasks/options/browserSync.js 2>/dev/null || true\n\
|
|
173
|
+
sed -i \'s/watchTask: true,/watchTask: true,watchOptions: { usePolling: true },port: process.env.PORT || 3000, ui: {port: +process.env.PORT_OPT || 3001},/g\' $PWD/node_modules/@fishawack/config-grunt/_Tasks/options/browserSync.js 2>/dev/null || true\n\
|
|
174
|
+
echo "Overwrite webdriver browsers to fix them to specific browser versions"\n\
|
|
175
|
+
sed -i \'s/exports.config = {.*/exports.config = { seleniumArgs: { drivers: {chrome: { version: "87.0.4280.88" },firefox: { version: "0.28.0" }} },/\' $PWD/node_modules/@fishawack/core/wdio.conf.js 2>/dev/null || true\n\
|
|
176
|
+
sed -i \'s/exports.config = {.*/exports.config = { seleniumArgs: { drivers: {chrome: { version: "87.0.4280.88" },firefox: { version: "0.28.0" }} },/\' $PWD/node_modules/@fishawack/config-grunt/wdio.conf.js 2>/dev/null || true\n\
|
|
177
|
+
sed -i \'s/puppeteer.launch({headless: true}).*/puppeteer.launch({headless: true, args: [ "--no-sandbox", "--disable-setuid-sandbox", "--disable-dev-shm-usage" ]}).then(async browser => {/\' $PWD/node_modules/sprinkle/bin/commands/screenshots.js 2>/dev/null || true\n\
|
|
178
|
+
npx --no-install selenium-standalone --singleDriverInstall=chrome install --drivers.chrome.version=87.0.4280.88 2>/dev/null || true\n\
|
|
179
|
+
npx --no-install selenium-standalone --singleDriverInstall=firefox install --drivers.firefox.version=0.28.0 2>/dev/null || true\n\
|
|
180
|
+
export OVERRIDE=true\n\
|
|
181
|
+
else\n\
|
|
182
|
+
command npm "$@" || exit 1\n\
|
|
183
|
+
fi\n\
|
|
184
|
+
)}\n\
|
|
185
|
+
export -f git\n\
|
|
186
|
+
export -f npm\n\
|
|
187
|
+
export bb="git@bitbucket.org:fishawackdigital"\n\
|
|
188
|
+
export gl="git@diggit01.fw.local:"\n\
|
|
189
|
+
export mm="git@github.com-mikemellor11:mikemellor11"\n\
|
|
190
|
+
export s="staging"\n\
|
|
191
|
+
export d="development"\n\
|
|
192
|
+
export m="master"\n\
|
|
193
|
+
export p="production"\n\
|
|
194
|
+
export vh="195.238.175.226"\n\
|
|
195
|
+
export ny1="167.99.153.125"\n\
|
|
196
|
+
export ny2="198.199.84.153"\n\
|
|
197
|
+
export gal="31.170.122.20"\n\
|
|
198
|
+
export grunt="grunt --gruntfile node_modules/@fishawack/core/Gruntfile.js"\n\
|
|
199
|
+
export gruntOld="grunt --gruntfile node_modules/@fishawack/config-grunt/Gruntfile.js"\n\
|
|
200
|
+
export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\[\033[31m\]\$(parse_git_branch)\[\033[00m\]\$ "\n\
|
|
201
|
+
alias ls="ls -l -GFh"\n\
|
|
202
|
+
# Load in enviroment variables if they exist in the root of the project\n\
|
|
203
|
+
if [ -f ./env.sh ]; then . ./env.sh; fi\n\
|
|
204
|
+
'\
|
|
205
|
+
>> ~/.profile
|
|
206
|
+
|
|
207
|
+
RUN mkdir ~/.ssh/
|
|
208
|
+
|
|
209
|
+
RUN echo $'\
|
|
210
|
+
Host *\n\
|
|
211
|
+
StrictHostKeyChecking no\n\
|
|
212
|
+
UserKnownHostsFile=/dev/null\n\
|
|
213
|
+
'\
|
|
214
|
+
>> ~/.ssh/config
|
|
215
|
+
|
|
216
|
+
# make /bin/sh symlink to bash instead of dash:
|
|
217
|
+
RUN echo "dash dash/sh boolean false" | debconf-set-selections
|
|
218
|
+
RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash
|
|
219
|
+
|
|
220
|
+
WORKDIR /app
|
|
221
|
+
|
|
222
|
+
EXPOSE 3000
|
|
223
|
+
EXPOSE 3001
|
|
224
|
+
|
|
225
|
+
ENV LANG en_US.UTF-8
|
|
226
|
+
ENV LANGUAGE en_US:en
|
|
227
|
+
ENV LC_ALL en_US.UTF-8
|
|
228
|
+
|
|
229
|
+
COPY entrypoint.sh /bin/entrypoint.sh
|
|
230
|
+
RUN chmod +x /bin/entrypoint.sh
|
|
231
|
+
RUN dos2unix /bin/entrypoint.sh
|
|
232
|
+
ENTRYPOINT ["/bin/entrypoint.sh"]
|
|
233
|
+
|
|
234
|
+
CMD ["bash", "-l"]
|