Skip to content
Snippets Groups Projects
Commit 4b919c8a authored by fejao's avatar fejao
Browse files

Adding .gitlab-ci.yml file

parent 875b69cf
No related branches found
No related tags found
1 merge request!6Setting ansible lint 01
Pipeline #37371 failed
# image: python:3.10.15-bullseye
image: ansible:latest
variables:
TEST_VAR_BUILD: "Building the application..."
DOC_PATH_TMP: tmp_docs
DOC_NAME: c3InfoDesk Printing
DOC_AUTHOR: fejao
DOC_VERSION: 1.0.0
DOC_LANGUAGE: english
# DOC_RETENTION: 1 day # <--- DON'T WORK :(
#####
#####
#####
PLAYBOOK_NAME_FOR_ROLE_TEST: "playbook_example_01_test.yml"
stages:
- debug
- build
- test
- docs
- deploy
###
### DEBUG
###
runner-debug:
stage: debug
script:
- echo "Testing local gitlab-runner config..."
- echo $PWD
- echo "list local folder..."
- ls -hal
###
### BUILD
###
build:
stage: build
script:
- echo "Here should be the images build and pushed"
###
### TESTS
###
ansible-lint-test:
stage: test
before_script:
# - apt-get update && apt-get install -y python3-pip libcups2-dev && apt-get clean && rm -rf /var/lib/apt/lists/*
# - pip3 install -r ci-cd/requirements.txt
- pip3 install -r requirements.txt
script:
- echo "Running ansible-lint tests at the role-> 'test'"
# - pycodestyle -v --config=./src/pycodestyle.cfg src/
# - ansible-lint playbook_example_01_dependencies.yml
- ansible-lint $PLAYBOOK_NAME_FOR_ROLE_TEST
allow_failure: false
# pylint:
# stage: test
# before_script:
# - apt-get update && apt-get install -y python3-pip libcups2-dev && apt-get clean && rm -rf /var/lib/apt/lists/*
# - pip3 install -r ci-cd/requirements.txt
# script:
# - echo "Running pylint tests..."
# ### Fix pylint 'import-error' --> hardcode init-hook on .pylintrc :(
# - cat .pylintrc | grep init-hook
# - rm .pylintrc
# - cp ci-cd/.pylintrc .
# - cat .pylintrc | grep init-hook
# ### RUN
# - pylint src/
# allow_failure: false
# unit-tests:
# stage: test
# before_script:
# - apt-get update && apt-get install -y python3-pip libcups2-dev && apt-get clean && rm -rf /var/lib/apt/lists/*
# - pip3 install -r ci-cd/requirements.txt
# script:
# - echo "Running pep8 tests..."
# - python3 -m pytest
# allow_failure: false
# ###
# ### DOCS
# ###
# sphinx-docs:
# stage: docs
# before_script:
# - pip3 install sphinx sphinx-rtd-theme
# script:
# - echo "Running sphinx-docs..."
# - mkdir -vp $DOC_PATH_TMP
# - cd $DOC_PATH_TMP
# - sphinx-quickstart -p '$DOC_NAME' -a '$DOC_AUTHOR' -v '$DOC_VERSION' -l '$DOC_LANGUAGE' -q
# - cd ..
# - sphinx-apidoc -o $DOC_PATH_TMP .
# - cd $DOC_PATH_TMP
# - make html
# artifacts:
# paths:
# - $DOC_PATH_TMP/*
# # expire_in: '$DOC_RETENTION' # <--- DON'T WORK :(
# expire_in: 1 day
# allow_failure: false
# only:
# - main
# ###
# ### DEPLOY
# ###
# deploy:
# stage: deploy
# script:
# - echo "Deploying the application..."
# - echo "TODO --> where to deploy this?"
# only:
# - main
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment