Skip to content

Commit

Permalink
Retrieve command
Browse files Browse the repository at this point in the history
  • Loading branch information
CrazyMax committed Aug 20, 2020
1 parent da3da99 commit 26618cd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
10 changes: 8 additions & 2 deletions dist/index.js

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

10 changes: 8 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,18 @@ async function run(): Promise<void> {
process.env.AWS_ACCESS_KEY_ID = username;
process.env.AWS_SECRET_ACCESS_KEY = password;

core.info(`🔑 Logging into AWS ECR region ${ecrRegion}...`);
core.info(`⬇️ Retrieving docker login command for ECR region ${ecrRegion}...`);
await execm.exec('aws', ['ecr', 'get-login', '--region', ecrRegion, '--no-include-email'], true).then(res => {
if (res.stderr != '' && !res.success) {
throw new Error(res.stderr);
}
core.info('🎉 Login Succeeded!');
core.info(`🔑 Logging into ${registry}...`);
execm.exec(res.stdout, [], true).then(res => {
if (res.stderr != '' && !res.success) {
throw new Error(res.stderr);
}
core.info('🎉 Login Succeeded!');
});
});
} else {
let loginArgs: Array<string> = ['login', '--password', password];
Expand Down

0 comments on commit 26618cd

Please sign in to comment.