@faable/faable 1.4.1 → 1.4.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.
|
@@ -27,10 +27,12 @@ const entrypoint_template = Handlebars.compile(entrypoint);
|
|
|
27
27
|
const bundle_docker = async (props) => {
|
|
28
28
|
const { app, workdir, template_context } = props;
|
|
29
29
|
const entrypoint_custom = entrypoint_template(template_context);
|
|
30
|
+
const start_command = Configuration.instance().startCommand;
|
|
31
|
+
log.info(`⚙️ Start command: ${start_command}`);
|
|
30
32
|
const dockerfile = docker_template({
|
|
31
33
|
from: template_context.from,
|
|
32
34
|
entry_script: entrypoint_custom,
|
|
33
|
-
start_command
|
|
35
|
+
start_command,
|
|
34
36
|
});
|
|
35
37
|
log.info(`📦 Packaging inside a docker image`);
|
|
36
38
|
// Build options
|
|
@@ -7,7 +7,7 @@ const upload_tag = async (args) => {
|
|
|
7
7
|
const registry = await api.getRegistry(app.id);
|
|
8
8
|
// Registry login
|
|
9
9
|
const { user, password, hostname, image } = registry;
|
|
10
|
-
await cmd(`echo "${password}" | docker login --username ${user} --password-stdin ${hostname}`);
|
|
10
|
+
await cmd(`echo "${password}" | docker login --username "${user}" --password-stdin ${hostname}`);
|
|
11
11
|
// Tag image for production
|
|
12
12
|
const upload_tagname = `${hostname}/${image}`;
|
|
13
13
|
await cmd(`docker tag ${app.id} ${upload_tagname}`);
|
|
@@ -4,7 +4,7 @@ import { log } from '../log.js';
|
|
|
4
4
|
|
|
5
5
|
class Configuration {
|
|
6
6
|
static _instance;
|
|
7
|
-
config;
|
|
7
|
+
config = {};
|
|
8
8
|
constructor() {
|
|
9
9
|
// Try to read default config file
|
|
10
10
|
this.setConfigFile("faable.json", { ignoreWarnings: true });
|
|
@@ -22,16 +22,16 @@ class Configuration {
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
static instance() {
|
|
25
|
-
if (Configuration._instance) {
|
|
26
|
-
|
|
25
|
+
if (!Configuration._instance) {
|
|
26
|
+
Configuration._instance = new Configuration();
|
|
27
27
|
}
|
|
28
|
-
return
|
|
28
|
+
return Configuration._instance;
|
|
29
29
|
}
|
|
30
30
|
get startCommand() {
|
|
31
|
-
return this.config
|
|
31
|
+
return this.config.startCommand || "npm run start";
|
|
32
32
|
}
|
|
33
33
|
get buildCommand() {
|
|
34
|
-
return this.config
|
|
34
|
+
return this.config.buildCommand;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
|