Skip to content

Commit aebe02c

Browse files
Fix vscdc build error (devcontainers#341)
1 parent ffaa18e commit aebe02c

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

build/src/push.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ async function push(repo, release, updateLatest, registry, registryPath, stubReg
2626
replaceImages = (configUtils.getVersionFromRelease(release, definitionId) == 'dev') || replaceImages;
2727

2828
// Stage content
29-
const stagingFolder = await configUtils.getStagingFolder(release);
30-
await configUtils.loadConfig(stagingFolder);
29+
let stagingFolder;
3130

3231
// Use or create a buildx / buildkit "builder" that using the docker-container driver which internally
3332
// uses QEMU to emulate different architectures for cross-platform builds. Setting up a separate
@@ -44,13 +43,19 @@ async function push(repo, release, updateLatest, registry, registryPath, stubReg
4443
if (definitionId) {
4544
const variants = configUtils.getVariants(definitionId) || [null];
4645
await asyncUtils.forEach(variants, async (variant) => {
46+
stagingFolder = await configUtils.getStagingFolder(release);
47+
await configUtils.loadConfig(stagingFolder);
48+
4749
console.log(`**** Pushing ${definitionId}: ${variant} ${release} ****`);
4850
await pushImage(
4951
definitionId, variant, repo, release, updateLatest, registry, registryPath, stubRegistry, stubRegistryPath, prepOnly, pushImages, replaceImages, secondaryRegistryPath);
5052
});
5153
} else {
5254
const definitionsToPush = configUtils.getSortedDefinitionBuildList(page, pageTotal, definitionsToSkip);
5355
await asyncUtils.forEach(definitionsToPush, async (currentJob) => {
56+
stagingFolder = await configUtils.getStagingFolder(release);
57+
await configUtils.loadConfig(stagingFolder);
58+
5459
console.log(`**** Pushing ${currentJob['id']}: ${currentJob['variant']} ${release} ****`);
5560
await pushImage(
5661
currentJob['id'], currentJob['variant'] || null, repo, release, updateLatest, registry, registryPath, stubRegistry, stubRegistryPath, prepOnly, pushImages, replaceImages, secondaryRegistryPath);

build/src/utils/config.js

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -671,18 +671,16 @@ function getFallbackPoolUrl(package) {
671671

672672

673673
async function getStagingFolder(release) {
674-
if (!stagingFolders[release]) {
675-
const stagingFolder = path.join(os.tmpdir(), 'dev-containers', release);
676-
console.log(`(*) Copying files to ${stagingFolder}\n`);
677-
await asyncUtils.rimraf(stagingFolder); // Clean out folder if it exists
678-
await asyncUtils.mkdirp(stagingFolder); // Create the folder
679-
await asyncUtils.copyFiles(
680-
path.resolve(__dirname, '..', '..', '..'),
681-
getConfig('filesToStage'),
682-
stagingFolder);
683-
684-
stagingFolders[release] = stagingFolder;
685-
}
674+
const stagingFolder = path.join(os.tmpdir(), 'dev-containers', release);
675+
console.log(`(*) Copying files to ${stagingFolder}\n`);
676+
await asyncUtils.rimraf(stagingFolder); // Clean out folder if it exists
677+
await asyncUtils.mkdirp(stagingFolder); // Create the folder
678+
await asyncUtils.copyFiles(
679+
path.resolve(__dirname, '..', '..', '..'),
680+
getConfig('filesToStage'),
681+
stagingFolder);
682+
683+
stagingFolders[release] = stagingFolder;
686684
return stagingFolders[release];
687685
}
688686

0 commit comments

Comments
 (0)