Skip to content
22 changes: 22 additions & 0 deletions bin/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,22 @@ run_test() {
return 0
}

run_activate_runtime() {
runtime=$1
version=$2
space=" "
file=docker-compose.yml
echo "Activating runtime: $runtime on version: $version"

exec_builder "test -f docker-compose.yml" && \
command="echo -e version: \"3.8\"\n${space}${space}services:\n${space}${space}${space}${space}${runtime}-${version}\n${space}${space}${space}${space}${space}${space}image:310957825501.dkr.ecr.us-east-1.amazonaws.com/cphp/runtime/${runtime}:${version} >> docker-compose.yml" || \
command="echo -e ${space}${space}${space}${space}${space}${space}image:310957825501.dkr.ecr.us-east-1.amazonaws.com/cphp/runtime/${runtime}:${version} >> docker-compose.yml"
exec_builder "$command" || return 1
exec_builder "cat docker-compose.yml" || return 1
#aws --profile runtime-containers-builder s3 cp docker-compose.yml "$BUILT_RUNTIMES_S3/docker-compose.yml"
return 0
}

run_deploy() {
runtime=$1
version=$2
Expand Down Expand Up @@ -103,6 +119,12 @@ then
exit 0
fi

if [ "activate_runtime" == "$action" ];
then
run_activate_runtime $runtime $version
exit 0
fi

if [ "copy_build_package" == "$action" ];
then
run_copy_build_package
Expand Down