re adjust fork renaming & gitlab build
parent
fe77b92cdd
commit
885d190254
@ -1,34 +0,0 @@
|
||||
name: "pytest:py3 "
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
# Allows you to run this workflow manually from the Actions tab
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: [3.7, 3.8, 3.9]
|
||||
os: [ubuntu-latest, macOS-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r requirements_dev.txt
|
||||
- name: Test with pytest
|
||||
run: |
|
||||
PYTHONPATH=. python -m pytest -v -s --cache-clear --cov=python-terraform test
|
@ -1,31 +0,0 @@
|
||||
name: Upload Python Package
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [created]
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install setuptools wheel twine
|
||||
- name: Build python package
|
||||
run: |
|
||||
python setup.py sdist bdist_wheel
|
||||
- name: Publish package
|
||||
uses: pypa/gh-action-pypi-publish@v1.4.2
|
||||
with:
|
||||
user: __token__
|
||||
password: ${{ secrets.PYPI_API_TOKEN }}
|
||||
skip_existing: true
|
||||
verbose: true
|
@ -0,0 +1,117 @@
|
||||
image: "python:3.8"
|
||||
|
||||
before_script:
|
||||
- python --version
|
||||
- pip install setuptools wheel twine
|
||||
- pip install .
|
||||
- pip install -r requirements_dev.txt
|
||||
|
||||
stages:
|
||||
- lint
|
||||
- test
|
||||
- build
|
||||
- upload
|
||||
|
||||
flake8:
|
||||
stage: lint
|
||||
allow_failure: true
|
||||
script:
|
||||
- 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
|
||||
|
||||
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
|
||||
|
||||
|
||||
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
|
||||
|
||||
test-1.1.3:
|
||||
stage: test
|
||||
script:
|
||||
- export TFVER=1.1.3
|
||||
- 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
|
||||
|
||||
build:
|
||||
stage: build
|
||||
rules:
|
||||
- if: '$CI_COMMIT_TAG =~ /^release-.*$/'
|
||||
artifacts:
|
||||
paths:
|
||||
- dist/*
|
||||
script:
|
||||
- python setup.py sdist bdist_wheel
|
||||
|
||||
pypi:
|
||||
stage: upload
|
||||
rules:
|
||||
- if: '$CI_COMMIT_TAG =~ /^release-.*$/'
|
||||
script:
|
||||
- twine upload dist/*
|
||||
|
||||
gitlab:
|
||||
image: registry.gitlab.com/gitlab-org/release-cli:latest
|
||||
stage: upload
|
||||
rules:
|
||||
- if: '$CI_COMMIT_TAG =~ /^release-.*$/'
|
||||
artifacts:
|
||||
paths:
|
||||
- release/*
|
||||
before_script:
|
||||
- echo "upload to gitlab"
|
||||
script:
|
||||
- apk --no-cache add curl
|
||||
- cp -r dist release
|
||||
- cd release
|
||||
- rm *.whl
|
||||
- find . -type f -exec sha256sum {} \; | sort > sha256sum.lst
|
||||
- find . -type f -exec sha512sum {} \; | sort > sha512sum.lst
|
||||
- |
|
||||
release-cli create --name "Release $CI_COMMIT_TAG" --tag-name $CI_COMMIT_TAG \
|
||||
--assets-link "{\"name\":\"release\",\"url\":\"https://gitlab.com/domaindrivenarchitecture/python-terraform/-/jobs/${CI_JOB_ID}/artifacts/file/release\"}" \
|
@ -1,28 +0,0 @@
|
||||
language: python
|
||||
python:
|
||||
- '3.6'
|
||||
- '3.7'
|
||||
- '3.8'
|
||||
- '3.9'
|
||||
before_install: sudo apt-get install unzip
|
||||
before_script:
|
||||
- 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
|
||||
install:
|
||||
- curl https://bootstrap.pypa.io/ez_setup.py -o - | python
|
||||
- pip install .
|
||||
script:
|
||||
- export PATH=$PATH:$PWD/tf_bin
|
||||
- pytest -v
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- develop
|
||||
- release/**
|
@ -1,3 +1,3 @@
|
||||
Please see README at github_
|
||||
|
||||
.. _github: https://github.com/beelit94/python-terraform/blob/master/README.md
|
||||
.. _github: https://github.com/DomainDrivenArchitecture/python-terraform/blob/develop/README.md
|
||||
|
@ -0,0 +1,12 @@
|
||||
## Release
|
||||
|
||||
```
|
||||
adjust version no in setup.py to release version no.
|
||||
git commit -am "release"
|
||||
git tag -am "release" release-[release version no]
|
||||
git push --follow-tags
|
||||
increase version no in setup.py
|
||||
git commit -am "version bump"
|
||||
git push
|
||||
pip3 install --upgrade --user dda-python-terraform
|
||||
```
|
Loading…
Reference in New Issue