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

86 lines
1.8 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
2022-01-19 17:08:22 +00:00
- pip install setuptools wheel twine
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
2022-01-20 08:30:51 +00:00
- build
2022-01-19 17:08:22 +00:00
- upload
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:
2022-01-19 17:08:22 +00:00
- flake8 --max-line-length=120 --count --select=E9,F63,F7,F82 --show-source --statistics python_terraform/*.py
- flake8 --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics python_terraform/*.py
2021-10-15 14:37:59 +00:00
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
2022-01-19 16:23:10 +00:00
test-0.13.7:
2021-10-15 14:37:59 +00:00
stage: test
script:
2022-01-19 16:23:10 +00:00
- export TFVER=0.13.7
2021-10-15 14:48:16 +00:00
- 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
2022-01-19 16:23:10 +00:00
test-1.0.8:
2021-10-15 15:09:10 +00:00
stage: test
script:
2022-01-19 16:23:10 +00:00
- export TFVER=1.0.8
2021-10-15 15:09:10 +00:00
- 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
2022-01-19 16:23:10 +00:00
test-1.1.3:
2021-10-15 15:09:10 +00:00
stage: test
script:
2022-01-19 16:23:10 +00:00
- export TFVER=1.1.3
2021-10-15 15:09:10 +00:00
- 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
2022-01-19 17:08:22 +00:00
2022-01-20 08:30:51 +00:00
build:
stage: build
2022-01-19 17:08:22 +00:00
rules:
2022-01-20 08:30:51 +00:00
- if: '$CI_COMMIT_TAG == null'
2022-01-19 17:08:22 +00:00
script:
- python setup.py sdist bdist_wheel