Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Ingest the docker/containers.json config
- Loading branch information
Barry Gordon
committed
Feb 23, 2022
1 parent
f2040d9
commit 0f7930d
Showing
3 changed files
with
5 additions
and
31 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,4 @@ | ||
import fs from 'fs' | ||
import dockerContainerConfig from '../docker/containers.json' | ||
|
||
const dockerfile = fs.readFileSync(require.resolve('../Dockerfile'), 'utf8') | ||
|
||
const imageNames = dockerfile | ||
.split(/\n/) | ||
.filter(a => a.startsWith('FROM')) | ||
.map(a => a.replace('FROM', '').trim()) | ||
|
||
const updaterImageName = imageNames.find(a => | ||
a.includes('dependabot/dependabot-updater') | ||
) | ||
const proxyImageName = imageNames.find(a => | ||
a.includes('github/dependabot-update-job-proxy') | ||
) | ||
|
||
if (!updaterImageName) { | ||
throw new Error('Could not find dependabot-updater image name') | ||
} | ||
|
||
if (!proxyImageName) { | ||
throw new Error('Could not find dependabot-update-job-proxy image name') | ||
} | ||
|
||
export const UPDATER_IMAGE_NAME = updaterImageName | ||
export const PROXY_IMAGE_NAME = proxyImageName | ||
export const UPDATER_IMAGE_NAME = dockerContainerConfig.updater | ||
export const PROXY_IMAGE_NAME = dockerContainerConfig.proxy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters