Skip to content

Commit

Permalink
Switch to md5sum to generate checksum
Browse files Browse the repository at this point in the history
  • Loading branch information
ebronson68 committed Dec 15, 2023
1 parent 313a19f commit e7eef7b
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions .github/workflows/ephemeral-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,6 @@ jobs:
echo "jiraTicketIdLc=${JIRA_TICKET_ID_LC}" >> $GITHUB_OUTPUT
echo "jiraTicketId=${JIRA_TICKET_ID}" >> $GITHUB_OUTPUT
- name: Fix repository name
id: repository-name
run: |
REPOSITORY_NAME="${{ inputs.repositoryName }}"
REPO_NAME_SHORT=$(echo "${REPOSITORY_NAME:0:21}" | tr '[:upper:]' '[:lower:]' | tr "_" "-")
echo "repositoryName=${REPO_NAME_SHORT}" >> $GITHUB_OUTPUT
- name: Get Environment
id: environment
shell: bash
Expand All @@ -106,15 +99,15 @@ jobs:
- name: Generate container app name
id: checksum
run: |
CHECKSUM=$(echo -n '${{ steps.repository-name.outputs.repositoryName }}-${{ steps.jira-ticket.outputs.jiraTicketIdLc }}' | sha256sum | awk '{print $1}')
SHORT_CHECKSUM=${CHECKSUM:0:16}
REPOSITORY_NAME="${{ inputs.repositoryName }}"
CHECKSUM=$(echo -n '${REPOSITORY_NAME}-${{ steps.jira-ticket.outputs.jiraTicketIdLc }}' | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9-]//g' | sed 's/--/-/g' | sed 's/^-//;s/-$//' | cut -c1-31 | md5sum | cut -d' ' -f1 | sed 's/^\([0-9]\)/a\1/')
SHORT_CHECKSUM=${CHECKSUM:0:20}
CONTAINER_APP_NAME="${SHORT_CHECKSUM}-${{ steps.jira-ticket.outputs.jiraTicketIdLc }}"
echo "containerAppName=${CONTAINER_APP_NAME}" >> $GITHUB_OUTPUT
outputs:
environment: ${{ steps.environment.outputs.environment }}
jiraTicketId: ${{ steps.jira-ticket.outputs.jiraTicketId }}
jiraTicketIdLc: ${{ steps.jira-ticket.outputs.jiraTicketIdLc }}
repositoryName: ${{ steps.repository-name.outputs.repositoryName }}
containerAppName: ${{ steps.checksum.outputs.containerAppName }}

deploy:
Expand Down

0 comments on commit e7eef7b

Please sign in to comment.