22
33apt-get update -y && apt-get install zip -y
44
5+ # github.job
6+ github_branch=${GITHUB_REF##*/ }
7+ software_version_trailing=" "
8+ main_branch=" main"
9+ if [ " $github_branch " = " $main_branch " ];
10+ then
11+ software_version=" "
12+ else
13+ software_version_trailing=" -${github_branch} -${GITHUB_RUN_ID} "
14+ fi
15+
516ZIP_NAME=' cumulus_lambda_functions_deployment.zip'
617TERRAFORM_ZIP_NAME=' terraform_cumulus_lambda_functions_deployment.zip'
718TERRAFORM_MARKETPLACE_ZIP_NAME=' terraform_marketplace_deployment.zip'
819TERRAFORM_ECR_ZIP_NAME=' terraform_ecr_deployment.zip'
920TERRAFORM_STAC_BR_ZIP_NAME=' terraform_stac_br_deployment.zip'
1021
1122project_root_dir=${GITHUB_WORKSPACE}
23+
24+ software_version=` python3 ${project_root_dir} /setup.py --version`
25+ echo " software_version=${software_version}${software_version_trailing} " >> ${GITHUB_ENV}
26+
1227zip_file=" ${project_root_dir} /$ZIP_NAME " ; # save the result file in current working directory
1328terraform_zip_file=" ${project_root_dir} /$TERRAFORM_ZIP_NAME " ; # save the result file in current working directory
1429terraform_marketplace_zip_file=" ${project_root_dir} /$TERRAFORM_MARKETPLACE_ZIP_NAME " ; # save the result file in current working directory
@@ -18,6 +33,13 @@ terraform_stac_br_zip_file="${project_root_dir}/$TERRAFORM_STAC_BR_ZIP_NAME" ; #
1833source_dir=` python3 -c ' import sysconfig; print(sysconfig.get_paths()["purelib"])' `
1934
2035cd ${source_dir}
36+ built_time=$( date -u +" %Y-%m-%dT%H:%M:%SZ" )
37+ cat << EOF > ds_version.json
38+ {
39+ "version": "$software_version ",
40+ "built": "$built_time "
41+ }
42+ EOF
2143rm -rf ${zip_file} && \
2244zip -r9 ${zip_file} . && \
2345echo " zipped to ${zip_file} "
@@ -38,16 +60,5 @@ zip -9 ${terraform_ecr_zip_file} * **/*
3860cd $project_root_dir /tf-module/stac_browser
3961zip -9 ${terraform_stac_br_zip_file} * ** /*
4062
41- # github.job
42- github_branch=${GITHUB_REF##*/ }
43- software_version_trailing=" "
44- main_branch=" main"
45- if [ " $github_branch " = " $main_branch " ];
46- then
47- software_version=" "
48- else
49- software_version_trailing=" -${github_branch} -${GITHUB_RUN_ID} "
50- fi
51- software_version=` python3 ${project_root_dir} /setup.py --version`
52- echo " software_version=${software_version}${software_version_trailing} " >> ${GITHUB_ENV}
63+
5364cat ${GITHUB_ENV}
0 commit comments