Update collect stats script on a remote server #336
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update collect stats script on a remote server | |
on: | |
push: | |
branches: | |
- master | |
repository_dispatch: | |
workflow_dispatch: | |
inputs: | |
server_name: | |
description: "Server to run the collect stats script on" | |
default: qdrant-manager | |
bg_task_name: | |
description: "Unique name for the background task" | |
default: collect-stats | |
schedule: | |
- cron: "20 23 * * *" | |
jobs: | |
update-collect-stats: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: Install tools | |
run: | | |
bash -x tools/ci/install-tools.sh | |
bash -x tools/ci/install-hcloud.sh | |
- name: Update collect stats script | |
run: | | |
export HCLOUD_TOKEN=${{ secrets.HCLOUD_TOKEN }} | |
export QDRANT_CLUSTER_URL=${{ secrets.QDRANT_CLUSTER_URL }} | |
export QC_NAME="qdrant-$(echo $QDRANT_CLUSTER_URL | sed -E 's~([^.]+)\..*~\1~')" | |
export QDRANT_API_KEY=${{ secrets.QDRANT_API_KEY }} | |
export POSTGRES_HOST=${{ secrets.POSTGRES_HOST }} | |
export POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }} | |
export SERVER_NAME=${{ inputs.server_name }} | |
export BG_TASK_NAME=${{ inputs.bg_task_name }} | |
bash -x tools/run-collect-stats.sh | |
update-collect-stats-debug-cluster: | |
if: ${{ vars.ENABLE_DEBUG_CLUSTER == 'true' }} | |
needs: update-collect-stats | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: Install tools | |
run: | | |
bash -x tools/ci/install-tools.sh | |
bash -x tools/ci/install-hcloud.sh | |
- name: Update collect stats script | |
run: | | |
export HCLOUD_TOKEN=${{ secrets.HCLOUD_TOKEN }} | |
export QDRANT_CLUSTER_URL=${{ secrets.QDRANT_CLUSTER_URL_2 }} | |
export QC_NAME="qdrant-$(echo $QDRANT_CLUSTER_URL | sed -E 's~([^.]+)\..*~\1~')" | |
export QDRANT_API_KEY=${{ secrets.QDRANT_API_KEY }} | |
export POSTGRES_HOST=${{ secrets.POSTGRES_HOST }} | |
export POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }} | |
export SERVER_NAME=${{ inputs.server_name }} | |
export BG_TASK_NAME=${{ inputs.bg_task_name }} | |
bash -x tools/run-collect-stats.sh |