Skip to content
Snippets Groups Projects
Commit 71c2d0f9 authored by fejao's avatar fejao
Browse files

Moving files

parent 881b6a1a
No related branches found
No related tags found
1 merge request!9Moving files 01
...@@ -57,6 +57,8 @@ skip_list: ...@@ -57,6 +57,8 @@ skip_list:
- loop-var-prefix[missing] - loop-var-prefix[missing]
### Sometimes, it is need to run as command... ### Sometimes, it is need to run as command...
- command-instead-of-module - command-instead-of-module
### For not having the playbooks on the root path
- role-name[path]
# Ansible-lint does not automatically load rules that have the 'opt-in' tag. # Ansible-lint does not automatically load rules that have the 'opt-in' tag.
# You must enable opt-in rules by listing each rule 'id' below. # You must enable opt-in rules by listing each rule 'id' below.
......
...@@ -12,16 +12,24 @@ variables: ...@@ -12,16 +12,24 @@ variables:
##### #####
##### #####
##### #####
PLAYBOOK_NAME_FOR_ROLE_TEST: "playbook_example_01_test.yml" INVENTORIES_PATH: "inventories/hosts"
# PLAYBOOK_NAME_FOR_ROLE_TEST: "playbook_example_01_test.yml"
PLAYBOOK_NAME_FOR_ROLE_TEST: "playbooks/ci-cd/01_test.yml"
PLAYBOOK_NAME_FOR_ROLE_DEPENDENCIES: "playbook_example_02_dependencies.yml" PLAYBOOK_NAME_FOR_ROLE_DEPENDENCIES: "playbook_example_02_dependencies.yml"
PLAYBOOK_NAME_FOR_ROLE_CLONE_REPOSITORIES: "playbook_example_03_clone_repositories.yml" PLAYBOOK_NAME_FOR_ROLE_CLONE_REPOSITORIES: "playbook_example_03_clone_repositories.yml"
PLAYBOOK_NAME_FOR_ROLE_DOCKER_IMAGES: "playbook_example_04_docker_images.yml" PLAYBOOK_NAME_FOR_ROLE_DOCKER_IMAGES: "playbook_example_04_docker_images.yml"
PLAYBOOK_NAME_FOR_ROLE_DOCKER_CONTAINERS: "playbook_example_05_docker_containers.yml" PLAYBOOK_NAME_FOR_ROLE_DOCKER_CONTAINERS: "playbook_example_05_docker_containers.yml"
# PLAYBOOK_NAME_FOR_ROLE_TEST: "playbook_example_01_test.yml"
# PLAYBOOK_NAME_FOR_ROLE_DEPENDENCIES: "playbook_example_02_dependencies.yml"
# PLAYBOOK_NAME_FOR_ROLE_CLONE_REPOSITORIES: "playbook_example_03_clone_repositories.yml"
# PLAYBOOK_NAME_FOR_ROLE_DOCKER_IMAGES: "playbook_example_04_docker_images.yml"
# PLAYBOOK_NAME_FOR_ROLE_DOCKER_CONTAINERS: "playbook_example_05_docker_containers.yml"
stages: stages:
- debug - debug
- build - build
- test - test
- syntax-check
- lint-tests - lint-tests
- docs - docs
- deploy - deploy
...@@ -45,6 +53,20 @@ build: ...@@ -45,6 +53,20 @@ build:
script: script:
- echo "Here should be the images build and pushed" - echo "Here should be the images build and pushed"
###
### SYNTAX-CHECK
###
systax-check-test:
stage: lint-tests
before_script:
- apt-get update && apt-get install -y python3-pip && apt-get clean && rm -rf /var/lib/apt/lists/*
- pip3 install -r requirements.txt
script:
- echo "Running ansible-lint tests at the role-> 'test'"
# - ansible-playbook --systax-check -i inventories/hosts $PLAYBOOK_NAME_FOR_ROLE_TEST
- ansible-playbook --systax-check -i $INVENTORIES_PATH $PLAYBOOK_NAME_FOR_ROLE_TEST
allow_failure: false
### ###
### TESTS ### TESTS
### ###
......
---
# Runs the role test
- name: CI-CD playbook for running the role 'test'
hosts:
- example_servers_group
roles:
- roles/test
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment