You've already forked ci-templates
generated from public/repo-template
init
This commit is contained in:
48
.gitea/workflows/drist.yaml
Normal file
48
.gitea/workflows/drist.yaml
Normal file
@@ -0,0 +1,48 @@
|
||||
name: Drist
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
ci_image:
|
||||
required: true
|
||||
type: string
|
||||
description: image to use inside the workflow jobs
|
||||
default: git.romalex.cc/public/ci-image:v1
|
||||
hosts_file:
|
||||
required: true
|
||||
type: string
|
||||
description: file containing hosts for drist
|
||||
default: hosts
|
||||
ssh_options:
|
||||
required: true
|
||||
type: string
|
||||
description: options to pass to ssh client
|
||||
default: -o StrictHostKeyChecking=no
|
||||
secrets:
|
||||
ssh_private_key:
|
||||
required: true
|
||||
description: SSH private key to access the hosts
|
||||
|
||||
jobs:
|
||||
|
||||
drist:
|
||||
name: Run drist
|
||||
runs-on: romalex-public
|
||||
container:
|
||||
image: ${{ inputs.ci_image }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Prepare SSH client
|
||||
run: |
|
||||
cat > ~/.ssh/private_key << EOF
|
||||
${{ secrets.ssh_private_key }}
|
||||
EOF
|
||||
chmod 600 ~/.ssh/private_key
|
||||
if [ -f ssh_config ]; then
|
||||
cp ssh_config ~/.ssh/config
|
||||
chmod 600 ~/.ssh/config
|
||||
fi
|
||||
- name: Run Drist
|
||||
env:
|
||||
SSH_PARAMS: ${{ inputs.ssh_options }} -i /root/.ssh/private_key
|
||||
run: drist -s ${{ inputs.hosts_file }}
|
||||
Reference in New Issue
Block a user