Skip to content

Commit

Permalink
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
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 31 deletions.
5 changes: 0 additions & 5 deletions Dockerfile

This file was deleted.

28 changes: 3 additions & 25 deletions src/docker-tags.ts
@@ -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
3 changes: 2 additions & 1 deletion tsconfig.json
Expand Up @@ -7,7 +7,8 @@
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
"moduleResolution": "node",
"noEmit": true, /* Do not emit compiler output files as we use ncc to package the action */
"forceConsistentCasingInFileNames": true /* Error if requiring a file by a casing different from the casing on disk */
"forceConsistentCasingInFileNames": true, /* Error if requiring a file by a casing different from the casing on disk */
"resolveJsonModule": true
},
"include": ["src/**/*.ts"],
"exclude": ["**/node_modules/**"]
Expand Down

0 comments on commit 0f7930d

Please sign in to comment.