-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #84 from dependabot/feelepxyz/extract-docker-tags-…
…dockerfile Use automatically updated Dockerfiles to set the tag of the updater/proxy used.
- Loading branch information
Showing
12 changed files
with
103 additions
and
13 deletions.
There are no files selected for viewing
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,10 +1,15 @@ | ||
version: 2 | ||
updates: | ||
# Enable version updates for npm | ||
- package-ecosystem: 'npm' | ||
# Look for `package.json` and `lock` files in the `root` directory | ||
directory: '/' | ||
# Check the npm registry for updates every day (weekdays) | ||
schedule: | ||
interval: 'weekly' | ||
- package-ecosystem: 'docker' | ||
directory: '/docker' | ||
schedule: | ||
interval: 'daily' | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
FROM docker.pkg.github.com/github/dependabot-update-job-proxy:v1 |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
FROM docker.pkg.github.com/dependabot/dependabot-updater:v1 |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
## Dependabot Containers | ||
|
||
This Action uses two Dependabot containers from the GitHub Container Registry to perform jobs. | ||
|
||
In order to ensure that any given release of the Action deterministically uses the same, tested containers we | ||
uses these Dockerfiles to check-in the specific SHA for each. | ||
|
||
This allows us to use Dependabot to keep these SHAs up to date as new versions of the container are published. | ||
|
||
These Dockerfiles are not actually built by the Action or any CI processes, they are purely used as compile-time | ||
configuration to generate `containers.json` which is used at runtime. |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"proxy": "docker.pkg.github.com/github/dependabot-update-job-proxy:v1", | ||
"updater": "docker.pkg.github.com/dependabot/dependabot-updater:v1" | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,4 +1,4 @@ | ||
export const UPDATER_IMAGE_NAME = | ||
'docker.pkg.github.com/dependabot/dependabot-updater:v1' | ||
export const PROXY_IMAGE_NAME = | ||
'docker.pkg.github.com/github/dependabot-update-job-proxy:v1' | ||
import dockerContainerConfig from '../docker/containers.json' | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import fs from 'fs' | ||
|
||
function getImageName(dockerfileName: string): String { | ||
const dockerfile = fs.readFileSync( | ||
require.resolve(`../docker/${dockerfileName}`), | ||
'utf8' | ||
) | ||
|
||
const imageName = dockerfile | ||
.split(/\n/) | ||
.find(a => a.startsWith('FROM')) | ||
?.replace('FROM', '') | ||
.trim() | ||
|
||
if (!imageName) { | ||
throw new Error(`Could not find an image name in ${dockerfile}`) | ||
} | ||
|
||
return imageName | ||
} | ||
|
||
const manifest = { | ||
proxy: getImageName('Dockerfile.proxy'), | ||
updater: getImageName('Dockerfile.updater') | ||
} | ||
|
||
fs.writeFile( | ||
require.resolve(`../docker/containers.json`), | ||
JSON.stringify(manifest, null, 2), | ||
function (err) { | ||
if (err) { | ||
// eslint-disable-next-line no-console | ||
console.log(err) | ||
} | ||
} | ||
) |
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