-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Publishing Test Details from CST task to Metadata store. (#11502)
* Publishing Test Details from CST task to Metadata store. * Fixing the payload. * using the right note name * Refactoring and addressing the PR comments * nit changes.
- Loading branch information
Showing
10 changed files
with
486 additions
and
148 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
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,32 @@ | ||
import RegistryAuthenticationToken from "docker-common-v2/registryauthenticationprovider/registryauthenticationtoken"; | ||
import ContainerConnection from "docker-common-v2/containerconnection"; | ||
import { getDockerRegistryEndpointAuthenticationToken } from "docker-common-v2/registryauthenticationprovider/registryauthenticationtoken"; | ||
import * as dockerCommandUtils from "docker-common-v2/dockercommandutils"; | ||
|
||
|
||
export class ContainerRegistry { | ||
constructor(registryConnection: string) { | ||
let registryAuthenticationToken: RegistryAuthenticationToken = getDockerRegistryEndpointAuthenticationToken(registryConnection); | ||
this.connection = new ContainerConnection(); | ||
this.connection.open(null, registryAuthenticationToken, true, false); | ||
} | ||
|
||
public getQualifiedImageName(repository: string, tag: string){ | ||
return `${this.connection.getQualifiedImageName(repository, true)}:${tag}` | ||
} | ||
|
||
public async pull(repository: string, tag: string): Promise<any> { | ||
return new Promise<any>((resolve, reject) => { | ||
try { | ||
const imageName = this.getQualifiedImageName(repository, tag); | ||
dockerCommandUtils.command(this.connection, "pull", imageName, (output: any) => { | ||
resolve(output); | ||
}) | ||
} catch (error) { | ||
reject(error); | ||
} | ||
}); | ||
} | ||
|
||
private connection: ContainerConnection; | ||
} |
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
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
Oops, something went wrong.