Skip to content

Instantly share code, notes, and snippets.

@ivanobulo
Created June 21, 2019 18:42
Show Gist options
  • Save ivanobulo/ae9979c4cda77caf04a7d961681778c2 to your computer and use it in GitHub Desktop.
Save ivanobulo/ae9979c4cda77caf04a7d961681778c2 to your computer and use it in GitHub Desktop.
lazy val ecrGetLogin = taskKey[Unit]("Login to ECR")
ecrGetLogin in ThisBuild := {
val os = new java.io.ByteArrayOutputStream
(s"aws ecr get-login --no-include-email --registry-ids ${ecrCallerId.value}" #> os).!
os.close()
// this will run 'docker login ...' that 'aws ecr get-login' have returned
os.toString.!
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment