aws-samples/iam-identity-center-team

Deploying a new version results in Main being deployed

Opened this issue · 1 comments

Describe the bug

All of the deployment scripts refer to the "main" branch in git, therefore when attempting to update to a new version its possible to deploy unwanted changes, for example the latest release 1.2.0 is 8 commits behind the "main" branch:

image

To Reproduce
Steps to reproduce the behavior:

  1. Run the Deploy.sh or update.sh scripts

Expected behavior

The version should be a variable that can be used to retrieve the correct version to deploy.

Additional context

Providing a link to the update.sh script as an example:

https://github.com/aws-samples/iam-identity-center-team/blob/main/deployment/update.sh#L30

if [ -z "$SECRET_NAME" ]; then
  git remote remove origin
  git remote add origin codecommit::$REGION://team-idc-app
  git remote add team https://github.com/aws-samples/iam-identity-center-team.git
  git pull team main

this should be updated to something like:

export VERSION=1.2.0

if [ -z "$SECRET_NAME" ]; then
  git remote remove origin
  git remote add origin codecommit::$REGION://team-idc-app
  git remote add team https://github.com/aws-samples/iam-identity-center-team.git
  git checkout -B main
  git pull team $VERSION

This has been opened a couple of times and completely ignored.

This is a real problem as theres no defined way to deploy a specific version, main can and does contain un-released and potentially un-documented features as it may contain untagged commits.