#!/bin/bash

#ログイン認証確認
if [[ $(aws ecr get-login-password --region ap-northeast-1 | docker login --username AWS --password-stdin 826466435614.dkr.ecr.ap-northeast-1.amazonaws.com) == *"Login Succeeded"* ]]
then
    echo "AWS login succeeded"
    cd build-push-scanpoint
    bash build-dataimport.sh || { echo "build-dataimport.sh failed"; exit 1; }
    bash build-sap-data-decrypt.sh || { echo "build-sap-data-decrypt.sh failed"; exit 1; }
    bash build-check-view-security-option.sh || { echo "build-check-view-security-option.sh failed"; exit 1; }
    bash build-crm-datafetch.sh || { echo "build-crm-datafetch.sh failed"; exit 1; }
    bash build-jskult-dbdump.sh || { echo "build-jskult-dbdump.sh failed"; exit 1; }
    bash build-jskult-batch-daily.sh || { echo "build-jskult-batch-daily.sh failed"; exit 1; }
    bash build-jskult-batch-laundering.sh || { echo "build-jskult-batch-laundering.sh failed"; exit 1; }
    bash build-jskult-webapp.sh || { echo "build-jskult-webapp.sh failed"; exit 1; }
    bash build-export-dbdump.sh || { echo "build-export-dbdump.sh failed"; exit 1; }
    bash build-transfer-medpass-data.sh || { echo "build-transfer-medpass-data.sh failed"; exit 1; }
    bash build-jskult-transfer-receive-file.sh || { echo "build-jskult-transfer-receive-file.sh failed"; exit 1; }
else
    echo "AWS login failed"
fi
