This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vversion: 0.2 | |
phases: | |
pre_build: | |
commands: | |
- echo Logging in to Amazon ECR... | |
- $(aws ecr get-login --registry-ids $AWS_ACCOUNT_ID --no-include-email --region $AWS_DEFAULT_REGION) | |
- echo Get Airflow version out of Dockerfile for version tagging | |
- AIRFLOW_VERSION=$(awk '$1=="ARG"{print $2}' Dockerfile | awk -F "=" '$1=="AIRFLOW_VERSION"{print $2}' -) | |
- echo Airflow version found $AIRFLOW_VERSION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3.7-slim-buster | |
LABEL maintainer="tt" | |
# Add labels | |
ARG LABEL_BUILD_NUMBER | |
ARG LABEL_BUILD_ID | |
ARG LABEL_TRIGGER | |
ARG SOURCE_VERSION | |
LABEL "LABEL_BUILD_NUMBER"=${LABEL_BUILD_NUMBER} "LABEL_BUILD_ID"=${LABEL_BUILD_ID} "LABEL_TRIGGER"=${LABEL_TRIGGER} "SOURCE_VERSION"=${SOURCE_VERSION} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
➜ airflow-gold git:(Dockerfile) ✗ token=$(aws ecr get-login-password --region eu-west-1 --profile=micropole) | |
➜ airflow-gold git:(Dockerfile) ✗ skopeo inspect --creds=AWS:$token docker://662050899999.dkr.ecr.eu-west-1.amazonaws.com/airlfow-gold:1.10.10 | jq '.Labels' | |
{ | |
"LABEL_BUILD_ID": "airflow-bold:cc5053dd-fa2a-482e-93c0-777d29d468b7", | |
"LABEL_BUILD_NUMBER": "23", | |
"LABEL_TRIGGER": "branch/Dockerfile", | |
"SOURCE_VERSION": "2eea3da019f6eb28672f5fe1bceef249a917a109", | |
"maintainer": "tt" | |
} | |
➜ airflow-gold git:(Dockerfile) ✗ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: 0.2 | |
env: | |
secrets-manager: | |
sonartoken: sonarcloud:token | |
phases: | |
install: | |
commands: | |
- echo Entered the install phase... | |
build: | |
commands: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def sec_task(): | |
local_file = "/tmp/secfile.txt" | |
with open(local_file, 'wt') as f: | |
print('dummy', file=f) | |
local_file = "/tmp/myfile.txt" | |
with open(local_file, 'wt') as f: | |
print('dummy', file=f) | |
# Let's fail the pipeline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: 1 | |
task_definition: | |
task_execution_role : arn:aws:iam::662050899999:role/airflow-dev-ecs | |
services: | |
webserver: | |
mem_limit: 1G | |
secrets: | |
- value_from: "arn:aws:secretsmanager:eu-west-1:662050899999:secret:airflow-dev/rds-123456:host::" | |
name: POSTGRES_HOST | |
- value_from: "arn:aws:secretsmanager:eu-west-1:662050899999:secret:airflow-dev/rds-123456:port::" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ecs-cli up --instance-role ecsInstanceRole \ | |
--extra-user-data cloud-config \ | |
--keypair thierryturpin \ | |
--size 1 \ | |
--port 8080 \ | |
--subnets subnet-c167d1a4 \ | |
--vpc vpc-975494f2 \ | |
--instance-type t3.large \ | |
--cluster airflow-dev \ | |
--region eu-west-1 \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ecs-cli compose up eu-west-1 --cluster airflow-dev --launch-type EC2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[turpin] | |
credential_process = /Users/thierryturpin/Documents/SYSTEM/awscreds/awscreds -p turpin | |
[micropole] | |
credential_process = /Users/thierryturpin/Documents/SYSTEM/awscreds/awscreds -p micropole |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
################################################## | |
# Bash script to source credentials from bitwarden | |
################################################## | |
pflag=false | |
while getopts "p:" opt; do | |
case $opt in |
OlderNewer