Skip to content

Commit

Permalink
Rename pullImage pull
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip Harrison committed Jul 26, 2021
1 parent cda2caf commit f6182de
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 63 deletions.
2 changes: 1 addition & 1 deletion __tests__/image-service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import {ImageService} from '../src/image-service'

describe('ImageService', () => {
test('pulls the image from docker hub', async () => {
await ImageService.pullImage('hello-world')
await ImageService.pull('hello-world')
})
})
2 changes: 1 addition & 1 deletion __tests__/updater-integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('Updater', () => {
// Skip this test on CI, as it takes too long to download the image
return
}
await ImageService.pullImage(UPDATER_IMAGE_NAME)
await ImageService.pull(UPDATER_IMAGE_NAME)
})

afterEach(async () => {
Expand Down
152 changes: 94 additions & 58 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/image-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const endOfStream = async (docker: Docker, stream: Readable): Promise<void> => {

export const ImageService = {
/** Fetch the configured updater image, if it isn't already available. */
async pullImage(imageName: string, force = false): Promise<void> {
async pull(imageName: string, force = false): Promise<void> {
const docker = new Docker()
try {
const image = await docker.getImage(imageName).inspect()
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ async function run(): Promise<void> {
const client = axios.create({baseURL: params.dependabotAPIURL})
const apiClient = new APIClient(client, params)
const updater = new Updater(UPDATER_IMAGE_NAME, apiClient)
await ImageService.pullImage(UPDATER_IMAGE_NAME)
await ImageService.pull(UPDATER_IMAGE_NAME)

await updater.runUpdater()
} catch (error) {
Expand Down

0 comments on commit f6182de

Please sign in to comment.