dda-python-terraform/.gitlab-ci.yml

76 lines
1.5 KiB
YAML
Raw Normal View History

2021-10-15 14:48:16 +00:00
image: "python:3.8"
2021-10-15 14:33:09 +00:00
before_script:
- python --version
2021-10-15 14:59:52 +00:00
- pip install .
2021-10-15 14:48:16 +00:00
- pip install -r dev_requirements.txt
2021-10-15 14:33:09 +00:00
stages:
2021-10-15 15:07:06 +00:00
- lint
2021-10-15 14:37:59 +00:00
- test
2021-10-15 14:33:09 +00:00
flake8:
2021-10-15 15:07:06 +00:00
stage: lint
allow_failure: true
2021-10-15 14:33:09 +00:00
script:
2021-10-15 14:37:59 +00:00
- flake8 --max-line-length=120 python_terraform/*.py
2021-10-15 15:07:06 +00:00
mypy:
stage: lint
allow_failure: true
script:
- python -m mypy python_terraform/terraform.py
- python -m mypy python_terraform/tfstate.py
pylint:
stage: lint
allow_failure: true
script:
- pylint -d C0301 python_terraform/*.py
2021-10-15 15:09:10 +00:00
test-0.13.4:
2021-10-15 14:37:59 +00:00
stage: test
script:
2021-10-15 14:48:16 +00:00
- export TFVER=0.13.4
- export TFURL=https://releases.hashicorp.com/terraform/
- TFURL+=$TFVER
- TFURL+="/terraform_"
- TFURL+=$TFVER
- TFURL+="_linux_amd64.zip"
- wget $TFURL -O terraform_bin.zip
- mkdir tf_bin
- unzip terraform_bin.zip -d tf_bin
2021-10-15 14:59:52 +00:00
- PATH=$PATH:$PWD/tf_bin
- pytest -v
2021-10-15 15:09:10 +00:00
test-0.13.7:
stage: test
script:
- export TFVER=0.13.7
- export TFURL=https://releases.hashicorp.com/terraform/
- TFURL+=$TFVER
- TFURL+="/terraform_"
- TFURL+=$TFVER
- TFURL+="_linux_amd64.zip"
- wget $TFURL -O terraform_bin.zip
- mkdir tf_bin
- unzip terraform_bin.zip -d tf_bin
- PATH=$PATH:$PWD/tf_bin
- pytest -v
test-1.0.8:
stage: test
script:
- export TFVER=1.0.8
- export TFURL=https://releases.hashicorp.com/terraform/
- TFURL+=$TFVER
- TFURL+="/terraform_"
- TFURL+=$TFVER
- TFURL+="_linux_amd64.zip"
- wget $TFURL -O terraform_bin.zip
- mkdir tf_bin
- unzip terraform_bin.zip -d tf_bin
- PATH=$PATH:$PWD/tf_bin
- pytest -v