From 5a3ab579a9ac91e5303690b3aefceb5b18bced95 Mon Sep 17 00:00:00 2001 From: Conner McCall Date: Thu, 6 Aug 2020 08:31:04 -0500 Subject: [PATCH] adding ci/cd --- .drone.yml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..82e95eb --- /dev/null +++ b/.drone.yml @@ -0,0 +1,38 @@ +--- +kind: pipeline +type: docker +name: default + +steps: +- name: build + image: atlassian/default-image:2 + when: + branch: + - main + commands: + - echo $AWS_CREDS | base64 -d > ~/.aws/credentials + - aws ecr get-login-password | docker login --username AWS --password-stdin $ECR_URL + - docker build . -t $ECR_URL/home_api:latest + - docker push $ECR_URL/home_api:latest + environment: + AWS_CREDS: + from_secret: AWS_CREDS + ECR_URL: + from_secret: ECR_URL +- name: build + image: atlassian/default-image:2 + when: + event: + - tag + commands: + - echo $AWS_CREDS | base64 -d > ~/.aws/credentials + - aws ecr get-login-password | docker login --username AWS --password-stdin $ECR_URL + - docker build . -t $ECR_URL/home_api:$DRONE_TAG + - docker build . -t $ECR_URL/home_api:latest + - docker push $ECR_URL/home_api:$DRONE_TAG + - docker build . -t $ECR_URL/home_api:latest + environment: + AWS_CREDS: + from_secret: AWS_CREDS + ECR_URL: + from_secret: ECR_URL