version: 0.2 phases: install: runtime-versions: php: latest build: commands: - current_deployment=$(aws ssm get-parameter --name $SSM_PARAMETER --query "Parameter.Value" --region $REGION --output text) - echo $current_deployment - echo $SSM_PARAMETER - echo $EFS_ID $REGION - if [[ "$current_deployment" == "null" ]]; then echo "this is the first GREEN deployment for this project" ; dir='/efs/green' ; fi - if [[ "$current_deployment" == "green" ]]; then dir='/efs/blue' ; else dir='/efs/green' ; fi - if [ ! -d $dir ]; then mkdir $dir >/dev/null 2>&1 ; fi - echo $dir - rsync -ar $CODEBUILD_SRC_DIR/ $dir/ artifacts: files: - '**/*'