Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions src/job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,10 @@ If you know what you're doing and would like to suppress this warning, use one o
return this.jobData["needs"] ?? null;
}

get certVolumeName (): string {
return `gcl-${this.safeJobName}-${this.jobId}-cert`;
}

get buildVolumeName (): string {
return `gcl-${this.safeJobName}-${this.jobId}-build`;
}
Expand Down Expand Up @@ -689,10 +693,15 @@ If you know what you're doing and would like to suppress this warning, use one o
const fileVariablesDir = this.fileVariablesDir;

this._containerVolumeNames.push(buildVolumeName, tmpVolumeName);
await Promise.all([
const volumeCreatePromises = [
Utils.spawn([this.argv.containerExecutable, "volume", "create", `${buildVolumeName}`], argv.cwd),
Utils.spawn([this.argv.containerExecutable, "volume", "create", `${tmpVolumeName}`], argv.cwd),
]);
];
if (this.argv.volume.some(v => v.startsWith("%gcl-cert%:"))) {
this._containerVolumeNames.push(this.certVolumeName);
volumeCreatePromises.push(Utils.spawn([this.argv.containerExecutable, "volume", "create", this.certVolumeName], argv.cwd));
}
await Promise.all(volumeCreatePromises);

const time = process.hrtime();
this.refreshLongRunningSilentTimeout(writeStreams);
Expand Down Expand Up @@ -1017,7 +1026,8 @@ If you know what you're doing and would like to suppress this warning, use one o
dockerCmd += `--workdir ${this.ciProjectDir} `;

for (const volume of this.argv.volume) {
dockerCmd += `--volume ${volume} `;
const v = volume.startsWith("%gcl-cert%:") ? `${this.certVolumeName}${volume.slice("%gcl-cert%".length)}` : volume;
dockerCmd += `--volume ${v} `;
}

for (const extraHost of this.argv.extraHost) {
Expand Down Expand Up @@ -1580,7 +1590,8 @@ If you know what you're doing and would like to suppress this warning, use one o
}

for (const volume of this.argv.volume) {
dockerCmd += `--volume ${volume} `;
const v = volume.startsWith("%gcl-cert%:") ? `${this.certVolumeName}${volume.slice("%gcl-cert%".length)}` : volume;
dockerCmd += `--volume ${v} `;
}

for (const extraHost of this.argv.extraHost) {
Expand Down