forked from rackspace/runway
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
77 lines (62 loc) · 3.34 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
sync:
PIPENV_VENV_IN_PROJECT=1 pipenv sync -d
# changes that need to be made inorder to sync python two (may also require deletion of the existing lock file)
sync_two:
pipenv install "astroid<2.0" "pylint<2.0" --dev
PIPENV_VENV_IN_PROJECT=1 pipenv install --dev
# sync all virtual environments used by this project with their Pipfile.lock
sync_all:
PIPENV_VENV_IN_PROJECT=1 pipenv sync --dev --three
pushd docs && PIPENV_VENV_IN_PROJECT=1 pipenv sync --dev --three && popd
pushd integration_tests && PIPENV_VENV_IN_PROJECT=1 pipenv sync --dev --three && popd
pushd integration_test_infrastructure && PIPENV_VENV_IN_PROJECT=1 pipenv sync --dev --three && popd
# update all Pipfile.lock's used by this project
pipenv_lock:
pipenv lock --dev
pushd docs && pipenv lock --dev && popd
pushd integration_tests && pipenv lock --dev && popd
pushd integration_test_infrastructure && pipenv lock --dev && popd
clean:
rm -rf build/
rm -rf dist/
rm -rf runway.egg-info/
rm -rf tmp/
rm -rf src/
rm -rf package.json postinstall.js preuninstall.js .coverage .npmignore
lint:
pipenv run flake8 --exclude=runway/embedded,runway/templates runway
find runway -name '*.py' -not -path 'runway/embedded*' -not -path 'runway/templates/stacker/*' -not -path 'runway/templates/cdk-py/*' -not -path 'runway/blueprints/*' | xargs pipenv run pylint --rcfile=.pylintrc
find runway/blueprints -name '*.py' | xargs pipenv run pylint --disable=duplicate-code
# linting for python 2, requires additional disables
lint_two:
pipenv run flake8 --exclude=runway/embedded,runway/templates --ignore=D101,D403,E124,W504 runway
find runway -name '*.py' -not -path 'runway/embedded*' -not -path 'runway/templates/stacker/*' -not -path 'runway/templates/cdk-py/*' -not -path 'runway/blueprints/*' | xargs pipenv run pylint --rcfile=.pylintrc --disable=bad-option-value,relative-import
find runway/blueprints -name '*.py' | xargs pipenv run pylint --disable=duplicate-code
test:
pipenv run pytest
test_shim:
bash ./.github/scripts/cicd/test_shim.sh
create_tfenv_ver_file:
curl --silent https://releases.hashicorp.com/index.json | jq -r '.terraform.versions | to_entries | map(select(.key | contains ("-") | not)) | sort_by(.key | split(".") | map(tonumber))[-1].key' | egrep -o '^[0-9]*\.[0-9]*\.[0-9]*' > runway/templates/terraform/.terraform-version
build: clean create_tfenv_ver_file
python setup.py sdist
build_pyinstaller_file: clean create_tfenv_ver_file
bash ./.github/scripts/cicd/build_pyinstaller.sh file
build_pyinstaller_folder: clean create_tfenv_ver_file
bash ./.github/scripts/cicd/build_pyinstaller.sh folder
build_whl: clean create_tfenv_ver_file
python setup.py bdist_wheel --universal
release: clean create_tfenv_ver_file build
twine upload dist/*
curl -D - -X PURGE https://pypi.org/simple/runway
# requires setuptools-scm and setuptools global python installs
# copies artifacts to src & npm package files to the root of the repo
# updates package.json with the name of the package & semver version from scm (formated for npm)
npm_prep:
mkdir -p tmp
mkdir -p src
cp -r artifacts/$$(python ./setup.py --version)/* src/
cp npm/* . && cp npm/.[^.]* .
jq ".version = \"$${NPM_PACKAGE_VERSION:-$$(python ./setup.py --version | sed -E "s/\.dev/-dev/")}\"" package.json > tmp/package.json
jq ".name = \"$${NPM_PACKAGE_NAME-undefined}\"" tmp/package.json > package.json
rm -rf tmp/package.json