re adjust fork renaming & gitlab build

merge-requests/1/head
jerger 2 years ago
parent fe77b92cdd
commit 885d190254

@ -1,72 +0,0 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
on:
push:
branches: [ develop ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ develop ]
schedule:
- cron: '29 6 * * 6'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
steps:
- name: Checkout repository
uses: actions/checkout@v3
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
# Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

@ -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
```

@ -7,7 +7,7 @@ except ImportError:
from distutils.core import setup
dependencies = []
module_name = "python-terraform"
module_name = "dda-python-terraform"
short_description = (
"This is a python module provide a wrapper " "of terraform command line tool"
)
@ -22,13 +22,13 @@ except IOError:
setup(
name=module_name,
version="1.0.4-dev",
url="https://github.com/beelit94/python-terraform",
url="https://github.com/DomainDrivenArchitecture/python-terraform",
license="MIT",
author="Freddy Tan",
author_email="beelit94@gmail.com",
description=short_description,
long_description=long_description,
packages=["python_terraform"],
packages=["dda_python_terraform"],
package_data={},
platforms="any",
install_requires=dependencies,

Loading…
Cancel
Save