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