#!/bin/bash LIKE_GIT_REPO_NAME=$(jq < cfn-output.json -r '.MythicalLikeGitRepositoryName') CORE_GIT_REPO_NAME=$(jq < cfn-output.json -r '.MythicalCoreGitRepositoryName') # INFRA_REPO_NAME=$(jq < cfn-output.json -r '.MythicalInfraGitRepositoryName') LIKE_ECR_REPO_URI=$(jq < cfn-output.json -r '.LikeServiceEcrRepo') CORE_ECR_REPO_URI=$(jq < cfn-output.json -r '.CoreServiceEcrRepo') # XRAY_ECR_REPO=$(jq < cfn-output.json -r '.XrayEcrRepo') # DDB_TABLE_NAME=$(jq < cfn-output.json -r '.DynamoTable') cp -R app/like-service/* ~/environment/$LIKE_GIT_REPO_NAME/ sed -i -e 's;REPLACEME_PRIMARY_REPO_URI;'"$LIKE_ECR_REPO_URI"';' ~/environment/$LIKE_GIT_REPO_NAME/buildspec_prod.yml cp -R app/mysfits-service/* ~/environment/$CORE_GIT_REPO_NAME/ sed -i -e 's;REPLACEME_PRIMARY_REPO_URI;'"$CORE_ECR_REPO_URI"';' ~/environment/$CORE_GIT_REPO_NAME/buildspec_prod.yml # cp cfn/* ~/environment/$INFRA_REPO_NAME # sed -i -e 's;REPLACE_ME_DDB_TABLE_NAME;'"$DDB_TABLE_NAME"';' ~/environment/$INFRA_REPO_NAME/parameters_dr.json # sed -i -e 's;REPLACE_ME_DDB_TABLE_NAME;'"$DDB_TABLE_NAME"';' ~/environment/$INFRA_REPO_NAME/parameters_prod.json cd ~/environment/$LIKE_GIT_REPO_NAME/ git add -A git commit -m "Initial Commit of Like Service" git push origin master cd ~/environment/$CORE_GIT_REPO_NAME/ git add -A git commit -m "Initial Commit of Core Service" git push origin master # cd ~/environment/$INFRA_REPO_NAME/ # git add -A # git commit -m "Initial Commit of Infra" # git push origin master