image:
name: debian:buster
default:
before_script:
- DEBIAN_FRONTEND=noninteractive apt update -qq
- DEBIAN_FRONTEND=noninteractive apt install -yqq python3-pip wget apt-utils gnupg
- pip3 install yamllint
- pip3 install salt-lint
- mkdir -p /srv/salt
- cp -r $CI_PROJECT_DIR/* /srv/salt
stages:
- Lint
- Test
linux:lint:
stage: Lint
needs: []
tags:
- docker
script:
- wget -O -
https://repo.saltproject.io/py3/debian/10/amd64/latest/salt-archive-keyring.gpg | apt-key add -
- "echo 'deb
https://repo.saltproject.io/py3/debian/10/amd64/latest buster main' > /etc/apt/sources.list.d/salt.list"
- DEBIAN_FRONTEND=noninteractive apt update -qq && DEBIAN_FRONTEND=noninteractive apt install salt-minion -yqq
- "echo 'file_client: local' >> /etc/salt/minion"
- find /srv -type f -name "*.sls" ! -path "*states/win/*" | xargs --no-run-if-empty salt-lint -x 201 -x 207 -x 208 -x 204
- cd /srv/salt/states && for i in *; do echo $i; salt-call --id=
test-minion.aei.mpg.de --local --file-root=/srv/salt/states --pillar-root=/srv/salt/pillars --retcode-passthrough state.show_sls linux.${i%.*} ; done
only:
- branches
highstate:
stage: Test
needs: ["linux:lint"]
tags:
- docker
script:
- salt-call state.highstate --local --retcode-passthrough mocked=True --state-output=mixed --state_verbose=False
only:
- master
```
thanks for help!