Skip to content

Commit

Permalink
Merge pull request #243 from engedaam/add_git_ref_to_stack_when_no_ref
Browse files Browse the repository at this point in the history
Add git_ref for no ref is mentioned
  • Loading branch information
engedaam authored Dec 14, 2023
2 parents 47c82ea + fa79d6a commit 63a5c5a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
10 changes: 9 additions & 1 deletion .github/actions/e2e/setup-cluster/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ runs:
PRIVATE_CLUSTER: ${{ inputs.private_cluster }}
GIT_REF: ${{ inputs.git_ref }}
run: |
if [[ "$GIT_REF" == '' ]]; then
GIT_REF = $(git rev-parse --short "$GITHUB_SHA")
fi
echo "$GIT_REF"
# Create or Upgrade the cluster based on whether the cluster already exists
cmd="create"
eksctl get cluster --name "$CLUSTER_NAME" && cmd="upgrade"
Expand Down Expand Up @@ -188,8 +192,12 @@ runs:
env:
ACCOUNT_ID: ${{ inputs.account_id }}
CLUSTER_NAME: ${{ inputs.cluster_name }}
GIT_REF: ${{ inputs.git_ref }}
GIT_REF: ${{ inputs.git_ref }}
run: |
if [[ "$GIT_REF" == '' ]]; then
GIT_REF = $(git rev-parse --short "$GITHUB_SHA")
fi
echo "$GIT_REF"
oidc_id=$(aws eks describe-cluster --name "$CLUSTER_NAME" --query "cluster.identity.oidc.issuer" --output text | cut -d '/' -f 3,4,5)
arn="arn:aws:iam::$ACCOUNT_ID:oidc-provider/${oidc_id}"
aws iam tag-open-id-connect-provider --open-id-connect-provider-arn $arn \
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ jobs:
role-to-assume: arn:aws:iam::${{ vars.CI_ACCOUNT_ID }}:role/${{ vars.CI_ROLE_NAME }}
aws-region: ${{ inputs.region }}
role-duration-seconds: 21600
- name: add jitter on cluster setup
run: |
# Creating jitter so that we can stagger cluster creation to avoid throttling
sleep $(( RANDOM % 300 + 1 ))
# - name: add jitter on cluster setup
# run: |
# # Creating jitter so that we can stagger cluster creation to avoid throttling
# sleep $(( RANDOM % 300 + 1 ))
- id: generate-cluster-name
name: generate cluster name
env:
Expand Down

0 comments on commit 63a5c5a

Please sign in to comment.