generated from pmo-actions/healthchecks-ping
Actualiser action.yaml
This commit is contained in:
139
action.yaml
139
action.yaml
@@ -57,142 +57,3 @@ runs:
|
||||
- name: Load bash library
|
||||
uses: https://gargoton.petite-maison-orange.fr/pmo-actions/bash-library@main
|
||||
|
||||
- name: Set debug mode
|
||||
if: inputs.debug
|
||||
shell: bash
|
||||
run: |
|
||||
source "${{ github.action_path }}/../bashlib.sh"
|
||||
export DEBUG="ON"
|
||||
echo "DEBUG=ON" >> $GITHUB_ENV
|
||||
debug Debug switch on
|
||||
|
||||
- name: Start the job
|
||||
if: inputs.check_server != '' && inputs.check_uuid != ''
|
||||
uses: https://gargoton.petite-maison-orange.fr/pmo-actions/healthchecks-ping@main
|
||||
with:
|
||||
check_server: ${{ inputs.check_server }}
|
||||
check_uuid: ${{ inputs.check_uuid }}
|
||||
check_command: start
|
||||
check_message: 'Starting job for image ${{ inputs.image_name }}'
|
||||
debug: ${{ inputs.debug }}
|
||||
|
||||
- name: Checkout and get version
|
||||
id: get_version
|
||||
uses: https://gargoton.petite-maison-orange.fr/pmo-actions/software-version@main
|
||||
with:
|
||||
git_checkout: true
|
||||
version_file: ${{ inputs.version_file }}
|
||||
debug: ${{ inputs.debug }}
|
||||
|
||||
- name: install podman
|
||||
if: inputs.build_command == 'podman' || inputs.tag_command == 'podman'
|
||||
shell: bash
|
||||
run: |
|
||||
source "${{ github.action_path }}/../bashlib.sh"
|
||||
step "Install software" "podman"
|
||||
|
||||
if command -v podman >/dev/null 2>&1; then
|
||||
success "Already installed" "Podman found"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
check_command apt-get
|
||||
|
||||
apt-get update
|
||||
|
||||
if apt-get -y install podman ; then
|
||||
success "Success" "Podman installed"
|
||||
else
|
||||
error "Install failed" "Could not install Podman"
|
||||
fi
|
||||
|
||||
- name: Build image starting
|
||||
if: inputs.check_server != '' && inputs.check_uuid != ''
|
||||
uses: https://gargoton.petite-maison-orange.fr/pmo-actions/healthchecks-ping@main
|
||||
with:
|
||||
check_server: ${{ inputs.check_server }}
|
||||
check_uuid: ${{ inputs.check_uuid }}
|
||||
check_command: log
|
||||
check_message: 'Buildind docker image for ${{ steps.get_version.outputs.version }}'
|
||||
debug: ${{ inputs.debug }}
|
||||
|
||||
- name: Store tag version
|
||||
shell: bash
|
||||
run: |
|
||||
echo "IMAGE_TAGS=${{ inputs.image_tags }}" >> $GITHUB_ENV
|
||||
|
||||
- name: Add PMO version tag
|
||||
if: inputs.add_version_tag
|
||||
run: |
|
||||
echo "IMAGE_TAGS=${{ env.IMAGE_TAGS }} pmo-${{ steps.get_version.outputs.version }}" >> $GITHUB_ENV
|
||||
|
||||
- name: Build and tag image
|
||||
uses: https://gargoton.petite-maison-orange.fr/pmo-actions/build-image@main
|
||||
with:
|
||||
image_name: '${{ inputs.image_name }}'
|
||||
image_tags: '${{ env.IMAGE_TAGS }}'
|
||||
registry_server: '${{ inputs.registry_server }}'
|
||||
build_command: '${{ inputs.build_command }}'
|
||||
tag_command: '${{ inputs.tag_command }}'
|
||||
debug: ${{ inputs.debug }}
|
||||
|
||||
- name: Canceled building
|
||||
if: cancelled() && inputs.check_server != '' && inputs.check_uuid != ''
|
||||
uses: https://gargoton.petite-maison-orange.fr/pmo-actions/healthchecks-ping@main
|
||||
with:
|
||||
check_server: ${{ inputs.check_server }}
|
||||
check_uuid: ${{ inputs.check_uuid }}
|
||||
check_command: fail
|
||||
check_message: 'Building image cancelled for ${{ inputs.image_name }}'
|
||||
debug: ${{ inputs.debug }}
|
||||
|
||||
- name: Build image failed
|
||||
if: failure() && inputs.check_server != '' && inputs.check_uuid != ''
|
||||
uses: https://gargoton.petite-maison-orange.fr/pmo-actions/healthchecks-ping@main
|
||||
with:
|
||||
check_server: ${{ inputs.check_server }}
|
||||
check_uuid: ${{ inputs.check_uuid }}
|
||||
check_command: fail
|
||||
check_message: 'Failed to build docker image for ${{ inputs.image_name }}'
|
||||
debug: ${{ inputs.debug }}
|
||||
|
||||
- name: Image built and tagged
|
||||
if: inputs.check_server != '' && inputs.check_uuid != ''
|
||||
uses: https://gargoton.petite-maison-orange.fr/pmo-actions/healthchecks-ping@main
|
||||
with:
|
||||
check_server: ${{ inputs.check_server }}
|
||||
check_uuid: ${{ inputs.check_uuid }}
|
||||
check_command: log
|
||||
check_message: 'Docker image for ${{ inputs.image_name }} built and tagged'
|
||||
debug: ${{ inputs.debug }}
|
||||
|
||||
- name: Push image to registry
|
||||
uses: https://gargoton.petite-maison-orange.fr/pmo-actions/push-image@main
|
||||
with:
|
||||
registry_login: true
|
||||
image_name: '${{ inputs.image_name }}'
|
||||
image_tags: '${{ env.IMAGE_TAGS }}'
|
||||
registry_server: '${{ inputs.registry_server }}'
|
||||
registry_user: '${{ inputs.registry_user }}'
|
||||
registry_password: '${{ inputs.registry_password }}'
|
||||
push_command: '${{ inputs.tag_command }}'
|
||||
debug: ${{ inputs.debug }}
|
||||
|
||||
- name: Push image failed
|
||||
if: failure() && inputs.check_server != '' && inputs.check_uuid != ''
|
||||
uses: https://gargoton.petite-maison-orange.fr/pmo-actions/healthchecks-ping@main
|
||||
with:
|
||||
check_server: ${{ inputs.check_server }}
|
||||
check_uuid: ${{ inputs.check_uuid }}
|
||||
check_command: fail
|
||||
check_message: 'Failed to push docker image for ${{ inputs.image_name }}'
|
||||
debug: ${{ inputs.debug }}
|
||||
|
||||
- name: End of the image building
|
||||
if: inputs.check_server != '' && inputs.check_uuid != ''
|
||||
uses: https://gargoton.petite-maison-orange.fr/pmo-actions/healthchecks-ping@main
|
||||
with:
|
||||
check_server: ${{ inputs.check_server }}
|
||||
check_uuid: ${{ inputs.check_uuid }}
|
||||
check_command: stop
|
||||
check_message: 'Docker image for ${{ inputs.image_name }}: task done'
|
||||
|
||||
Reference in New Issue
Block a user