[Ops] delete the create-deply-tag workflow (#175424)

This workflow has been moved to Buildkite and is therefore no longer needed.
This commit is contained in:
Thomas Watson 2024-01-29 09:43:46 +01:00 committed by GitHub
parent 35e96a7250
commit 958320e5bd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,160 +0,0 @@
---
# - This workflow creates a tag with the format "deploy@<timestamp>" on the main branch.
# - It is triggered manually from the GitHub Actions UI.
# - It is only allowed to run on the main branch and ensures that the tag is created
# on the main branch only in a verification step.
# This is only to prevent accidental creation of the tag on other branches and cannot be used to prevent malicious creation of the tag.
name: "Serverless: Promote to QA"
on:
workflow_dispatch:
inputs:
commit:
description: "Commit to promote (default: latest commit on main)"
depth:
description: "Fetch depth (0 = everything)"
default: "500"
concurrency:
group: ${{ github.workflow }}
jobs:
create-deploy-tag:
# Temporary, we need a way to limit this to a GitHub team instead of specific users
if: contains('["watson","clintandrewhall","kobelb","lukeelmers","thomasneirynck","jbudz","mistic","delanni","Ikuni17","pheyos","dmlemeshko","mikecote"]', github.triggering_actor)
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: ${{ github.event.inputs.depth }}
fetch-tags: true
- name: Select commit to be tagged
run: |
commit="${{ github.event.inputs.commit || github.sha }}"
echo "COMMIT=${commit}" >> "${GITHUB_ENV}"
- name: Verify selected or newer commit isn't already tagged
run: |
git tag --contains ${COMMIT} | grep -P "^deploy@\d+$" && {
echo "A deploy-tag already exists on the selected or newer commit!"
exit 1
} || true
- name: Verify branch
run: |
if [[ "${GITHUB_REF}" != "refs/heads/main" ]]; then
echo "This workflow can only be run on the main branch"
exit 1
fi
- name: Find previous tag
run: |
prev_tag_name=`git tag -l 'deploy@[0-9]*' | tail -1`
echo "PREV_TAG_NAME=${prev_tag_name}" >> "${GITHUB_ENV}"
- name: Prepare tag
run: |
tag_name="deploy@$(date +%s)"
echo "TAG_NAME=${tag_name}" >> "${GITHUB_ENV}"
- name: Create tag
run: |
git tag ${TAG_NAME} ${COMMIT}
git push origin "refs/tags/${TAG_NAME}"
- name: Post Slack success message
if: success()
uses: slackapi/slack-github-action@v1.24.0
continue-on-error: true
with:
payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Promotion of a new <https://github.com/elastic/kibana/commit/${{ env.COMMIT }}|commit> to QA has been initiated!\n\nOnce promotion is complete, please begin any required manual testing.\n\n*Remember:* Promotion to Staging is currently a manual process and will proceed once the build is signed off in QA."
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Initiated by:*\n<https://github.com/${{ github.triggering_actor }}|${{ github.triggering_actor }}>"
},
{
"type": "mrkdwn",
"text": "*Commit:*\n<https://github.com/elastic/kibana/commit/${{ env.COMMIT }}|${{ env.COMMIT }}>"
},
{
"type": "mrkdwn",
"text": "*Git tag:*\n<https://github.com/elastic/kibana/releases/tag/${{ env.TAG_NAME }}|${{ env.TAG_NAME }}>"
}
]
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "${{ join(fromJSON(env.JSON_USEFUL_LINKS_ARRAY), '\n • ') }}"
}
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.DEPLOY_TAGGER_SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
JSON_USEFUL_LINKS_ARRAY: |
[
"*Useful links:*\\n",
"<https://github.com/elastic/kibana/compare/${{ env.PREV_TAG_NAME }}...${{ env.TAG_NAME }}|Commits contained in deploy>",
"<https://buildkite.com/elastic/kibana-serverless-release/builds?branch=${{ env.TAG_NAME }}|Kibana Serverless Release pipeline>",
"<https://argo-workflows.us-central1.gcp.qa.cld.elstc.co/workflows?label=hash%3D${{ env.COMMIT }}|Argo Workflow> (use Elastic Cloud Staging VPN)",
"<https://overview.qa.cld.elstc.co/app/dashboards#/view/serverless-tooling-gpctl-deployment-status?_g=(refreshInterval:(pause:!t,value:0),time:(from:now-1d,to:now))&service-name=kibana&_a=(controlGroupInput:(chainingSystem:HIERARCHICAL,controlStyle:oneLine,ignoreParentSettings:(ignoreFilters:!f,ignoreQuery:!f,ignoreTimerange:!f,ignoreValidations:!f),panels:('18201b8e-3aae-4459-947d-21e007b6a3a5':(explicitInput:(dataViewId:'serverless.logs-*',enhancements:(),fieldName:commit-hash,id:'18201b8e-3aae-4459-947d-21e007b6a3a5',selectedOptions:!('${{ env.COMMIT }}'),title:commit-hash),grow:!t,order:1,type:optionsListControl,width:medium),'41060e65-ce4c-414e-b8cf-492ccb19245f':(explicitInput:(dataViewId:'serverless.logs-*',enhancements:(),fieldName:service-name,id:'41060e65-ce4c-414e-b8cf-492ccb19245f',selectedOptions:!(kibana),title:service-name),grow:!t,order:0,type:optionsListControl,width:medium),ed96828e-efe9-43ad-be3f-0e04218f79af:(explicitInput:(dataViewId:'serverless.logs-*',enhancements:(),fieldName:to-env,id:ed96828e-efe9-43ad-be3f-0e04218f79af,selectedOptions:!(qa),title:to-env),grow:!t,order:2,type:optionsListControl,width:medium))))|GPCTL Deployment Status dashboard for nonprod>",
"<https://overview.elastic-cloud.com/app/dashboards#/view/serverless-tooling-gpctl-deployment-status?_g=(refreshInterval:(pause:!t,value:0),time:(from:now-1d,to:now))&service-name=kibana&_a=(controlGroupInput:(chainingSystem:HIERARCHICAL,controlStyle:oneLine,ignoreParentSettings:(ignoreFilters:!f,ignoreQuery:!f,ignoreTimerange:!f,ignoreValidations:!f),panels:('18201b8e-3aae-4459-947d-21e007b6a3a5':(explicitInput:(dataViewId:'serverless.logs-*',enhancements:(),fieldName:commit-hash,id:'18201b8e-3aae-4459-947d-21e007b6a3a5',selectedOptions:!('${{ env.COMMIT }}'),title:commit-hash),grow:!t,order:1,type:optionsListControl,width:medium),'41060e65-ce4c-414e-b8cf-492ccb19245f':(explicitInput:(dataViewId:'serverless.logs-*',enhancements:(),fieldName:service-name,id:'41060e65-ce4c-414e-b8cf-492ccb19245f',selectedOptions:!(kibana),title:service-name),grow:!t,order:0,type:optionsListControl,width:medium),ed96828e-efe9-43ad-be3f-0e04218f79af:(explicitInput:(dataViewId:'serverless.logs-*',enhancements:(),fieldName:to-env,id:ed96828e-efe9-43ad-be3f-0e04218f79af,selectedOptions:!(production),title:to-env),grow:!t,order:2,type:optionsListControl,width:medium))))|GPCTL Deployment Status dashboard>",
"<https://buildkite.com/elastic/kibana-tests/builds?branch=main|Quality Gate pipeline>"
]
- name: Post Slack failure message
if: failure()
uses: slackapi/slack-github-action@v1.24.0
with:
payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Creation of deploy tag on <https://github.com/elastic/kibana/commit/${{ env.COMMIT }}|commit> failed ⛔️"
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Initiated by:*\n<https://github.com/${{ github.triggering_actor }}|${{ github.triggering_actor }}>"
},
{
"type": "mrkdwn",
"text": "*Commit:*\n<https://github.com/elastic/kibana/commit/${{ env.COMMIT }}|${{ env.COMMIT }}>"
}
]
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "${{ join(fromJSON(env.JSON_USEFUL_LINKS_ARRAY), '\n • ') }}"
}
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.DEPLOY_TAGGER_SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
JSON_USEFUL_LINKS_ARRAY: |
[
"*Useful links:*\\n",
"<https://github.com/elastic/kibana/actions/runs/${{ github.run_id }}|GitHub Workflow run>"
]