@@ -164,16 +164,15 @@ devops_account () {
164164 aws cloudformation package \
165165 --s3-bucket " $ARTIFACTS_BUCKET " --s3-prefix template-cicd-sdlf-repositories \
166166 --template-file " $DIRNAME " /sdlf-cicd/template-cicd-sdlf-repositories.yaml \
167- --output-template-file " $DIRNAME " /output/packaged-template.yaml \
167+ --output-template-file " $DIRNAME " /output/packaged-template-cicd-sdlf-repositories .yaml \
168168 --region " $REGION " \
169169 --profile " $DEVOPS_AWS_PROFILE "
170170 STACK_NAME=sdlf-cicd-sdlf-repositories
171171 aws cloudformation deploy \
172172 --s3-bucket " $ARTIFACTS_BUCKET " --s3-prefix sdlf-cicd-sdlf-repositories \
173173 --stack-name " $STACK_NAME " \
174- --template-file " $DIRNAME " /output/packaged-template.yaml \
174+ --template-file " $DIRNAME " /output/packaged-template-cicd-sdlf-repositories .yaml \
175175 --parameter-overrides \
176- pArtifactsBucket=/SDLF/S3/DevOpsArtifactsBucket \
177176 pKMSKey=/SDLF/KMS/CICDKeyId \
178177 --tags Framework=sdlf \
179178 --capabilities " CAPABILITY_NAMED_IAM" " CAPABILITY_AUTO_EXPAND" \
@@ -182,10 +181,10 @@ devops_account () {
182181 template_protection " $STACK_NAME " " $REGION " " $DEVOPS_AWS_PROFILE "
183182 rm -Rf " $DIRNAME " /output
184183
185- declare -a REPOSITORIES=(" sdlf-cicd" " sdlf-foundations" " sdlf-team" " sdlf-pipeline" " sdlf-dataset" " sdlf-datalakeLibrary" " sdlf-stageA" " sdlf-stageB" )
184+ declare -a REPOSITORIES=(" sdlf-cicd" " sdlf-foundations" " sdlf-team" " sdlf-pipeline" " sdlf-dataset" " sdlf-datalakeLibrary" " sdlf-stageA" " sdlf-stageB" " sdlf-main " )
186185 for REPOSITORY in " ${REPOSITORIES[@]} "
187186 do
188- latest_commit=$( aws --region " $REGION " --profile " $DEVOPS_AWS_PROFILE " codecommit get-branch --repository-name " $REPOSITORY " --branch-name main --query ' branch.commitId' --output text)
187+ latest_commit=$( aws --region " $REGION " --profile " $DEVOPS_AWS_PROFILE " codecommit get-branch --repository-name " $REPOSITORY " --branch-name main --query " branch.commitId" --output text)
189188 aws --region " $REGION " --profile " $DEVOPS_AWS_PROFILE " codecommit create-branch --repository-name " $REPOSITORY " --branch-name dev --commit-id " $latest_commit "
190189 aws --region " $REGION " --profile " $DEVOPS_AWS_PROFILE " codecommit create-branch --repository-name " $REPOSITORY " --branch-name test --commit-id " $latest_commit "
191190 done
@@ -195,6 +194,28 @@ devops_account () {
195194 aws --region " $REGION " --profile " $DEVOPS_AWS_PROFILE " s3api put-object --bucket " $ARTIFACTS_BUCKET " --key aws-sam-cli-linux-x86_64.zip --body " $DIRNAME " /sdlf-cicd/aws-sam-cli-linux-x86_64.zip
196195 rm " $DIRNAME " /sdlf-cicd/aws-sam-cli-linux-x86_64.zip
197196
197+ mkdir " $DIRNAME " /output
198+ aws cloudformation package \
199+ --s3-bucket " $ARTIFACTS_BUCKET " --s3-prefix template-cicd-sdlf-pipelines \
200+ --template-file " $DIRNAME " /sdlf-cicd/template-cicd-sdlf-pipelines.yaml \
201+ --output-template-file " $DIRNAME " /output/packaged-template-cicd-sdlf-pipelines.yaml \
202+ --region " $REGION " \
203+ --profile " $DEVOPS_AWS_PROFILE "
204+ STACK_NAME=sdlf-cicd-sdlf-pipelines
205+ aws cloudformation deploy \
206+ --s3-bucket " $ARTIFACTS_BUCKET " --s3-prefix sdlf-cicd-sdlf-pipelines \
207+ --stack-name " $STACK_NAME " \
208+ --template-file " $DIRNAME " /output/packaged-template-cicd-sdlf-pipelines.yaml \
209+ --parameter-overrides \
210+ pArtifactsBucket=/SDLF/S3/DevOpsArtifactsBucket \
211+ pKMSKey=/SDLF/KMS/CICDKeyId \
212+ --tags Framework=sdlf \
213+ --capabilities " CAPABILITY_NAMED_IAM" " CAPABILITY_AUTO_EXPAND" \
214+ --region " $REGION " \
215+ --profile " $DEVOPS_AWS_PROFILE " || exit 1
216+ template_protection " $STACK_NAME " " $REGION " " $DEVOPS_AWS_PROFILE "
217+ rm -Rf " $DIRNAME " /output
218+
198219 exit
199220}
200221
0 commit comments