2023-01-10 15:03:40 +01:00
|
|
|
name: run-in-docker
|
|
|
|
description: Run step in docker container
|
|
|
|
inputs:
|
|
|
|
script_name:
|
|
|
|
description: "script_name"
|
|
|
|
required: true
|
|
|
|
image_name:
|
|
|
|
description: "image_name"
|
|
|
|
required: true
|
|
|
|
image_version:
|
|
|
|
description: "image_version"
|
|
|
|
required: true
|
|
|
|
centreon_pat:
|
|
|
|
description: "Secret"
|
|
|
|
required: false
|
2023-02-23 17:24:11 +01:00
|
|
|
registry_url:
|
|
|
|
description: Docker registry url
|
2023-01-10 15:03:40 +01:00
|
|
|
required: true
|
2023-02-23 17:24:11 +01:00
|
|
|
registry_username:
|
|
|
|
description: Docker registry username
|
|
|
|
required: true
|
|
|
|
registry_password:
|
|
|
|
description: Docker registry password
|
2023-01-10 15:03:40 +01:00
|
|
|
required: true
|
|
|
|
params:
|
|
|
|
description: "params for script"
|
|
|
|
required: false
|
|
|
|
runs:
|
|
|
|
using: "composite"
|
|
|
|
steps:
|
|
|
|
- name: Login to Registry (via runner)
|
2023-12-20 12:23:48 +01:00
|
|
|
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0
|
2023-01-10 15:03:40 +01:00
|
|
|
with:
|
2023-02-23 17:24:11 +01:00
|
|
|
registry: ${{ inputs.registry_url }}
|
|
|
|
username: ${{ inputs.registry_username }}
|
|
|
|
password: ${{ inputs.registry_password }}
|
2023-01-10 15:03:40 +01:00
|
|
|
|
2023-02-23 17:24:11 +01:00
|
|
|
- run: docker run -i -e TOKEN=${{ inputs.centreon_pat }} --entrypoint /src/.github/scripts/${{ inputs.script_name }}.sh -v "$PWD:/src" ${{ inputs.registry_url }}/${{ inputs.image_name }}:${{ inputs.image_version }} ${{ inputs.params }}
|
2023-01-10 15:03:40 +01:00
|
|
|
shell: bash
|