Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
---
###
### VARIABLES
###
variables:
AUTHOR: fejao
IMAGE_NAME_LINT: python:3.10.15-bullseye
PATH_ENV_DIR: "/builds/fejao/c3infodesk-deployment-role-docker-images"
PATH_PYTHON_REQ_FILE: "/builds/fejao/c3infodesk-deployment-role-docker-images/ci-cd/python_requirements.txt"
PATH_PLAYBOOK: "/builds/fejao/c3infodesk-deployment-role-docker-images/ci-cd/playbook_role_test.yml"
###
### STAGES
###
stages:
- yamllint
- upstream-trigger
###
### SCRIPTS
###
.install_dependencies: &install_dependencies
# Install python and it's requirements
- apt-get update && apt-get install -y python3-pip && apt-get clean && rm -rf /var/lib/apt/lists/*
- pip3 install -r $PYTHON_REQ_FILE_PATH
### Correct the permissions on the build environment directory.
### See https://github.com/ansible/ansible/pull/42142/files
- chmod 700 $PATH_ENV_DIR
yamllint-test:
stage: yamllint
image: $IMAGE_NAME_LINT
variables:
PYTHON_REQ_FILE_PATH: $PATH_PYTHON_REQ_FILE
PLAYBOOK_PATH: $PATH_PLAYBOOK
before_script:
- *install_dependencies
script:
- echo "This is the 'yamllint' test from the 'test' role"
- yamllint .
trigger-pipeline:
stage: upstream-trigger
variables:
RUN_UPSTREAM_FOR_ROLE_DOCKER_IMAGES: true
trigger:
project: fejao/c3infodesk-deployment
branch: main
strategy: depend