fix: Fixed wrong commit sha reference from incoming webhook

This commit is contained in:
Antonis Stamatiou 2023-04-26 13:15:04 +03:00
parent dbb73b9239
commit ee23f6dc6b
No known key found for this signature in database
GPG Key ID: 84C1D3E2A8453312

View File

@ -25,15 +25,14 @@ jobs:
workflow_conclusion: success workflow_conclusion: success
name: server-dist-artifact name: server-dist-artifact
path: server/dist path: server/dist
# DISABLING THIS UNTIL WE FIGURE OUT IF WE NEED IT
# Get Branch name from calling workflow
# Search for the string "pull" and replace it with "PR" in branch-name
# - name: cd/Get branch name
# run: echo "BRANCH_NAME=$(echo ${{ github.event.workflow_run.head_branch }} | sed 's/^pull\//PR-/g')" >> $GITHUB_ENV
- name: cd/Upload artifacts to S3 - name: cd/Upload artifacts to S3
env:
BRANCH_NAME: ${{ github.event.workflow_run.head_branch }}
REPO_NAME: ${{ github.event.repository.name }}
COMMIT_SHA: ${{ github.event.workflow_run.head_sha }}
run: | run: |
aws s3 cp server/dist/ s3://pr-builds.mattermost.com/${{ github.event.repository.name }}/${{ github.event.workflow_run.head_branch }}/ --acl public-read --cache-control "no-cache" --recursive --no-progress aws s3 cp server/dist/ s3://pr-builds.mattermost.com/$REPO_NAME/$BRANCH_NAME/ --acl public-read --cache-control "no-cache" --recursive --no-progress
aws s3 cp server/dist/ s3://pr-builds.mattermost.com/${{ github.event.repository.name }}/commit/${{ github.sha }}/ --acl public-read --cache-control "no-cache" --recursive --no-progress aws s3 cp server/dist/ s3://pr-builds.mattermost.com/$REPO_NAME/commit/$COMMIT_SHA/ --acl public-read --cache-control "no-cache" --recursive --no-progress
build-docker: build-docker:
name: cd/Build and push docker image name: cd/Build and push docker image
@ -59,11 +58,13 @@ jobs:
- name: cd/Docker build and push - name: cd/Docker build and push
env: env:
DOCKER_CLI_EXPERIMENTAL: enabled DOCKER_CLI_EXPERIMENTAL: enabled
REPO_NAME: ${{ github.event.repository.name }}
COMMIT_SHA: ${{ github.event.workflow_run.head_sha }}
run: | run: |
export TAG=$(echo "${{ github.event.pull_request.head.sha || github.sha }}" | cut -c1-7) export TAG=$(echo "${{ github.event.pull_request.head.sha || github.event.workflow_run.head_sha }}" | cut -c1-7)
cd server/build cd server/build
export DOCKER_CLI_EXPERIMENTAL=enabled export DOCKER_CLI_EXPERIMENTAL=enabled
export MM_PACKAGE=https://pr-builds.mattermost.com/${{ github.event.repository.name }}/commit/${{ github.sha }}/mattermost-team-linux-amd64.tar.gz export MM_PACKAGE=https://pr-builds.mattermost.com/$REPO_NAME/commit/$COMMIT_SHA/mattermost-team-linux-amd64.tar.gz
docker buildx build --push --build-arg MM_PACKAGE=$MM_PACKAGE -t mattermostdevelopment/mm-te-test:${TAG} . docker buildx build --push --build-arg MM_PACKAGE=$MM_PACKAGE -t mattermostdevelopment/mm-te-test:${TAG} .
# Temporary uploading also to mattermost/mm-te-test:${TAG} except mattermostdevelopment/mm-te-test:${TAG} # Temporary uploading also to mattermost/mm-te-test:${TAG} except mattermostdevelopment/mm-te-test:${TAG}
@ -71,6 +72,9 @@ jobs:
build-docker-temp: build-docker-temp:
name: cd/Build and push docker image name: cd/Build and push docker image
needs: upload-s3 needs: upload-s3
env:
REPO_NAME: ${{ github.event.repository.name }}
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
steps: steps:
@ -92,11 +96,13 @@ jobs:
- name: cd/Docker build and push - name: cd/Docker build and push
env: env:
DOCKER_CLI_EXPERIMENTAL: enabled DOCKER_CLI_EXPERIMENTAL: enabled
REPO_NAME: ${{ github.event.repository.name }}
COMMIT_SHA: ${{ github.event.workflow_run.head_sha }}
run: | run: |
export TAG=$(echo "${{ github.event.pull_request.head.sha || github.sha }}" | cut -c1-7) export TAG=$(echo "${{ github.event.pull_request.head.sha || github.event.workflow_run.head_sha }}" | cut -c1-7)
cd server/build cd server/build
export DOCKER_CLI_EXPERIMENTAL=enabled export DOCKER_CLI_EXPERIMENTAL=enabled
export MM_PACKAGE=https://pr-builds.mattermost.com/${{ github.event.repository.name }}/commit/${{ github.sha }}/mattermost-team-linux-amd64.tar.gz export MM_PACKAGE=https://pr-builds.mattermost.com/$REPO_NAME/commit/$COMMIT_SHA/mattermost-team-linux-amd64.tar.gz
docker buildx build --push --build-arg MM_PACKAGE=$MM_PACKAGE -t mattermost/mm-te-test:${TAG} . docker buildx build --push --build-arg MM_PACKAGE=$MM_PACKAGE -t mattermost/mm-te-test:${TAG} .
sentry: sentry: