95 lines
2.0 KiB
YAML
95 lines
2.0 KiB
YAML
---
|
|
kind: pipeline
|
|
type: docker
|
|
name: run_ansible_tests
|
|
|
|
global-variables:
|
|
ansible_image : &ansible_image "gitea.thezengarden.net/podman/images/ansible-dev:latest"
|
|
ansible_inventory : &ansible_inventory "-i 127.0.0.1, --connection=local"
|
|
ansible_playbook : &ansible_playbook "hello.yml"
|
|
|
|
environment:
|
|
ANSIBLE_INVENTORY : *ansible_inventory
|
|
ANSIBLE_PLAYBOOK : *ansible_playbook
|
|
ANSIBLE_DOCKER_IMAGE : *ansible_image
|
|
|
|
trigger:
|
|
branch:
|
|
exclude:
|
|
- main
|
|
event: [push]
|
|
|
|
steps:
|
|
- name: "ansible_environment_verify"
|
|
image: *ansible_image
|
|
commands:
|
|
- git log -1
|
|
- ansible --version
|
|
- ansible-lint --version
|
|
|
|
# - name: "ansible_galaxy_requirements"
|
|
# image: *ansible_image
|
|
# commands:
|
|
# - ansible-galaxy install -r requirements.yml
|
|
|
|
- name: "ansible_lint"
|
|
image: *ansible_image
|
|
commands:
|
|
- ansible-lint --offline
|
|
|
|
- name: "ansible_playbook_execution"
|
|
image: *ansible_image
|
|
commands:
|
|
- ansible-playbook -v $ANSIBLE_INVENTORY $ANSIBLE_PLAYBOOK
|
|
|
|
---
|
|
kind: pipeline
|
|
type: exec
|
|
name: check_docker
|
|
|
|
environment:
|
|
BUILD_PREFIX : gitea.thezengarden.net/podman/images
|
|
BUILD_NAME : ansible-dev
|
|
|
|
trigger:
|
|
branch:
|
|
exclude:
|
|
- main
|
|
event: [push]
|
|
status: [success]
|
|
|
|
depends_on:
|
|
- run_ansible_tests
|
|
|
|
steps:
|
|
- name: check_env
|
|
commands:
|
|
- whoami
|
|
- hostnamectl
|
|
- env
|
|
- pwd
|
|
- tree
|
|
- cat requirements.yml
|
|
- echo "$BUILD_PREFIX/$BUILD_NAME"
|
|
|
|
- name: docker_info
|
|
commands:
|
|
- docker info
|
|
|
|
- name: docker_images
|
|
commands:
|
|
- docker images
|
|
|
|
- name: docker_psa
|
|
commands:
|
|
- docker ps -a
|
|
|
|
- name: docker_build
|
|
environment:
|
|
BUILD_PREFIX : gitea.thezengarden.net/podman/images
|
|
BUILD_NAME : ansible-dev
|
|
commands:
|
|
- echo "$BUILD_PREFIX/$BUILD_NAME"
|
|
- echo "docker build -t $BUILD_PREFIX/$BUILD_NAME:$CI_BUILD_NUMBER ."
|
|
- docker build -t $BUILD_PREFIX/$BUILD_NAME:$CI_BUILD_NUMBER .
|