mirror of
https://github.com/docker/login-action.git
synced 2025-04-19 01:26:45 +00:00
Add example for Azure Container Registry (ACR)
This commit is contained in:
parent
1bd3567034
commit
e56233ce43
5 changed files with 52 additions and 20 deletions
|
@ -1,4 +1,3 @@
|
|||
import * as exec from '@actions/exec';
|
||||
import * as core from '@actions/core';
|
||||
import * as aws from './aws';
|
||||
import * as execm from './exec';
|
||||
|
@ -43,13 +42,13 @@ export async function loginECR(registry: string, username: string, password: str
|
|||
const cliPath = await aws.getCLI();
|
||||
const cliVersion = await aws.getCLIVersion();
|
||||
const region = await aws.getRegion(registry);
|
||||
core.info(`💡 AWS ECR registry detected with ${region} region`);
|
||||
core.info(`💡 AWS ECR detected with ${region} region`);
|
||||
|
||||
process.env.AWS_ACCESS_KEY_ID = username;
|
||||
process.env.AWS_SECRET_ACCESS_KEY = password;
|
||||
|
||||
core.info(`⬇️ Retrieving docker login command through AWS CLI ${cliVersion} (${cliPath})...`);
|
||||
const loginCmd = await aws.getECRLoginCmd(cliVersion, registry, region);
|
||||
const loginCmd = await aws.getDockerLoginCmd(cliVersion, registry, region);
|
||||
|
||||
core.info(`🔑 Logging into ${registry}...`);
|
||||
execm.exec(loginCmd, [], true).then(res => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue