include:
  project: 'tools/continuous-integration/docker/docker-pure-trunk-latest'
  file: 'gitlab-ci.yml'

##########################################################################################################

## PIPELINE DEFINITION
stages:
  - lint
  - pack
  - test
  - scan
  - release

##########################################################################################################

#### TEST SECTION
test:
  image: ${DOCKER_IMAGE}
  services:
    - ${DIND_IMAGE}
  stage: test
  variables:
    GIT_STRATEGY: "none"
  script:
    - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
    - alias drr="docker run --rm -v \${PWD}:\${PWD} -w \${PWD}"
    - drr "${CI_REGISTRY_IMAGE}:temp-${CI_COMMIT_SHORT_SHA}" ansible --version
    - drr "${CI_REGISTRY_IMAGE}:temp-${CI_COMMIT_SHORT_SHA}" ansible -m ping localhost
    - drr "${CI_REGISTRY_IMAGE}:temp-${CI_COMMIT_SHORT_SHA}" ansible-lint --version
    - drr "${CI_REGISTRY_IMAGE}:temp-${CI_COMMIT_SHORT_SHA}" ansible-lint .
