Skip to content

Add TCM failover docs #5535

Add TCM failover docs

Add TCM failover docs #5535

Workflow file for this run

name: Deploy to dev server
on:
pull_request:
# Cancel workflow runs on PRs when the PR is updated with a newer commit.
# Such runs will have a concurrency group named
# `{github.workflow}-{github.ref}`,
# for example,
# `deploy-branch/refs/add-concurrency`.
#
# Runs on branch `latest` and tags will never be canceled,
# due to having a unique group name
# `{github.run_id}-{github.run_attempt}`,
# for example,
# `3477882280-1`.
concurrency:
group: ${{
(
github.ref == 'refs/heads/latest' ||
startsWith(github.ref, 'refs/tags/')
) &&
format('{0}-{1}', github.run_id, github.run_attempt) ||
format('{0}-{1}', github.workflow, github.ref) }}
cancel-in-progress: true
jobs:
deploy-branch:
runs-on: ubuntu-latest
container: tarantool/doc-builder:fat-4.3
env:
AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}}
AWS_DEFAULT_REGION: ${{secrets.AWS_DEFAULT_REGION}}
S3_ENDPOINT_URL: ${{secrets.S3_ENDPOINT_URL}}
S3_UPLOAD_PATH: ${{secrets.S3_UPLOAD_PATH}}
TARANTOOL_UPDATE_KEY: ${{secrets.TARANTOOL_UPDATE_KEY}}
TARANTOOL_UPDATE_URL: ${{secrets.TARANTOOL_DEVELOP_UPDATE_URL}}
VKTEAMS_BOT_TOKEN: ${{secrets.VKTEAMS_TARANTOOLBOT_TOKEN}}
steps:
- name: Prevent dubious ownership
id: add-safe-directory
run: git config --global --add safe.directory '*'
- uses: actions/checkout@v3
id: checkout
with:
submodules: recursive
- name: Fetch submodules
id: fetch-submodules
run: git fetch --recurse-submodules
- name: Set deployment name from source branch
id: set-deployment-name
run: echo "DEPLOYMENT_NAME=${GITHUB_HEAD_REF##*/}" >> $GITHUB_ENV
- name: Start dev server deployment
uses: bobheadxi/deployments@v1
id: deployment
with:
step: start
token: ${{secrets.GITHUB_TOKEN}}
env: "branch-${{env.DEPLOYMENT_NAME}}"
ref: ${{github.head_ref}}
- run: cmake .
id: cmake
- run: make pull-modules
id: make-pull-modules
- run: make build-modules
id: make-build-modules
- run: make json
id: make-json
- run: make json-ru
id: make-json-ru
- run: bash upload_output.sh
id: upload-output
- name: Create or update a dev server deployment with version ${{env.DEPLOYMENT_NAME}}
uses: nick-fields/retry@v2
id: update-deployment-webhook
with:
command: bash webhooks/update_deployment.sh
timeout_seconds: 15
retry_wait_seconds: 15
max_attempts: 3
- name: update deployment status
id: finalize-deployment
uses: bobheadxi/deployments@v1
with:
step: finish
token: ${{secrets.GITHUB_TOKEN}}
env: "branch-${{env.DEPLOYMENT_NAME}}"
status: ${{job.status}}
deployment_id: ${{steps.deployment.outputs.deployment_id}}
env_url: ${{secrets.TARANTOOL_HOST}}/doc/${{env.DEPLOYMENT_NAME}}/
- name: Send VK Teams message on failures
# bot token won't be accessible in the forks
if: ${{ failure() && env.VKTEAMS_BOT_TOKEN != '' }}
uses: tarantool/actions/report-job-status@master
with:
api-url: "https://api.internal.myteam.mail.ru/bot/v1/"
bot-token: ${{ env.VKTEAMS_BOT_TOKEN }}
chat-id: tt_docs_cicd_reports
job-steps: ${{ ToJson(steps) }}