heroku 9.2.0-beta.0 → 9.2.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.
|
@@ -60,7 +60,13 @@ class Push extends command_1.Command {
|
|
|
60
60
|
else {
|
|
61
61
|
core_1.ux.styledHeader(`Building ${job.name} (${job.dockerfile})`);
|
|
62
62
|
}
|
|
63
|
-
await DockerHelper.buildImage(
|
|
63
|
+
await DockerHelper.buildImage({
|
|
64
|
+
dockerfile: job.dockerfile,
|
|
65
|
+
resource: job.resource,
|
|
66
|
+
buildArgs,
|
|
67
|
+
path: contextPath,
|
|
68
|
+
arch: this.config.arch,
|
|
69
|
+
});
|
|
64
70
|
}
|
|
65
71
|
}
|
|
66
72
|
catch (error) {
|
|
@@ -19,6 +19,14 @@ export declare type groupedDockerJobs = {
|
|
|
19
19
|
export declare const getJobs: (resourceRoot: string, dockerfiles: string[]) => groupedDockerJobs;
|
|
20
20
|
export declare const filterByProcessType: (jobs: groupedDockerJobs, processTypes: string[]) => groupedDockerJobs;
|
|
21
21
|
export declare const chooseJobs: (jobs: groupedDockerJobs) => Promise<dockerJob[]>;
|
|
22
|
-
|
|
22
|
+
declare type BuildImageParams = {
|
|
23
|
+
dockerfile: string;
|
|
24
|
+
resource: string;
|
|
25
|
+
buildArgs: string[];
|
|
26
|
+
path?: string;
|
|
27
|
+
arch?: string;
|
|
28
|
+
};
|
|
29
|
+
export declare const buildImage: ({ dockerfile, resource, buildArgs, path, arch }: BuildImageParams) => Promise<string>;
|
|
23
30
|
export declare const pushImage: (resource: string) => Promise<string>;
|
|
24
31
|
export declare const runImage: (resource: string, command: string, port: number) => Promise<string>;
|
|
32
|
+
export {};
|
|
@@ -7,6 +7,7 @@ const glob = require("glob");
|
|
|
7
7
|
const Path = require("path");
|
|
8
8
|
const inquirer = require("inquirer");
|
|
9
9
|
const os = require("os");
|
|
10
|
+
const core_1 = require("@oclif/core");
|
|
10
11
|
const DOCKERFILE_REGEX = /\bDockerfile(.\w*)?$/;
|
|
11
12
|
const cmd = async function (cmd, args, options = {}) {
|
|
12
13
|
(0, debug_1.debug)(cmd, args);
|
|
@@ -114,6 +115,10 @@ const chooseJobs = async function (jobs) {
|
|
|
114
115
|
for (const processType in jobs) {
|
|
115
116
|
if (Object.prototype.hasOwnProperty.call(jobs, processType)) {
|
|
116
117
|
const group = jobs[processType];
|
|
118
|
+
if (group === undefined) {
|
|
119
|
+
core_1.ux.warn(`Dockerfile.${processType} not found`);
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
117
122
|
if (group.length > 1) {
|
|
118
123
|
const prompt = [{
|
|
119
124
|
type: 'list',
|
|
@@ -135,9 +140,13 @@ const chooseJobs = async function (jobs) {
|
|
|
135
140
|
return chosenJobs;
|
|
136
141
|
};
|
|
137
142
|
exports.chooseJobs = chooseJobs;
|
|
138
|
-
const buildImage = async function (dockerfile, resource, buildArgs, path) {
|
|
143
|
+
const buildImage = async function ({ dockerfile, resource, buildArgs, path, arch }) {
|
|
139
144
|
const cwd = path || Path.dirname(dockerfile);
|
|
140
|
-
const args = ['build', '-f', dockerfile, '-t', resource
|
|
145
|
+
const args = ['build', '-f', dockerfile, '-t', resource];
|
|
146
|
+
// Older Docker versions don't allow for this flag, but we are
|
|
147
|
+
// adding it here when necessary to allow for pushing a docker build from m1/m2 Macs.
|
|
148
|
+
if (arch === 'arm64')
|
|
149
|
+
args.push('--platform', 'linux/amd64');
|
|
141
150
|
for (const element of buildArgs) {
|
|
142
151
|
if (element.length > 0) {
|
|
143
152
|
args.push('--build-arg', element);
|