Skip to content

Commit 7ac66a3

Browse files
committed
Merge branch 'master' into feature/dan_integration_tests
2 parents ba5385c + 5b60d94 commit 7ac66a3

32 files changed

Lines changed: 109 additions & 213 deletions

.github/workflows/ci.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: CI
4+
5+
# Triggers the workflow on push or pull request events
6+
on: [push, pull_request]
7+
8+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
9+
jobs:
10+
Build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0
16+
- name: Set up Python
17+
uses: actions/setup-python@v2
18+
with:
19+
python-version: 3.7
20+
21+
- name: Install dependencies
22+
run: |
23+
cd package
24+
echo "Installing requirements.txt and test_requirements.txt:"
25+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
26+
if [ -f test_requirements.txt ]; then pip install -r test_requirements.txt; fi
27+
- name: Lint with flake8
28+
run: |
29+
pwd
30+
python -m pip install flake8
31+
# stop the build if there are Python syntax errors or undefined names
32+
# E722 bare 'except'
33+
# W605 invalid escape sequence '\.'
34+
# E501 line too long
35+
# F841 local variable 'e' is assigned to but never used
36+
python -m flake8 . --count --ignore=E722,W605,E501,F841 --exclude=*__init__.py,*tag_terraform_resources.py,*data_model.py --statistics --show-source
37+
38+
- name: Create package and install it
39+
run: |
40+
python -m pip install --upgrade pip
41+
chmod +x ci_deploy.sh
42+
./ci_deploy.sh
43+
- name: Test with unittest
44+
run: |
45+
python -m unittest
46+

ci_deploy.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
cd package
4+
python setup.py sdist
5+
cd dist
6+
# package_name=$(find ./ -maxdepth 1 -type f -name "cloudshell-iac-terraform-*.tar.gz" -printf "%f\n")
7+
pip install --no-index -f . cloudshell-iac-terraform
8+
cd ../..

package/cloudshell/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
__author__ = 'quali'
22
from pkgutil import extend_path
3-
__path__ = extend_path(__path__, __name__)
3+
__path__ = extend_path(__path__, __name__)

package/cloudshell/iac/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
__author__ = 'quali'
22
from pkgutil import extend_path
3-
__path__ = extend_path(__path__, __name__)
3+
__path__ = extend_path(__path__, __name__)

package/cloudshell/iac/terraform/constants.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
# OS types defined by sys.platform
66
OS_TYPES = {
7-
'darwin': 'darwin_amd64',
8-
'linux': 'linux_amd64',
9-
'win32': 'windows_amd64'
10-
}
7+
'darwin': 'darwin_amd64',
8+
'linux': 'linux_amd64',
9+
'win32': 'windows_amd64'
10+
}
1111

1212
# Log levels
1313
ERROR_LOG_LEVEL = 40
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
__author__ = 'quali'
22
from pkgutil import extend_path
3-
__path__ = extend_path(__path__, __name__)
3+
__path__ = extend_path(__path__, __name__)

package/cloudshell/iac/terraform/downloaders/tf_exec_downloader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def download_terraform_executable(tf_workingdir: str, version='latest'):
3838
if 'current_version' in cont.keys():
3939
version = cont['current_version']
4040
else:
41-
raise ValueError(f'Could not find latest TF version from hashicorp site')
41+
raise ValueError('Could not find latest TF version from hashicorp site')
4242

4343
# Verifying values
4444
if not os.path.exists(tf_workingdir):
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
__author__ = 'quali'
22
from pkgutil import extend_path
3-
__path__ = extend_path(__path__, __name__)
3+
__path__ = extend_path(__path__, __name__)

package/cloudshell/iac/terraform/models/config.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@ def __init__(self, write_sandbox_messages: bool = False, update_live_status: boo
88
self.update_live_status = update_live_status
99
self.inputs_map = inputs_map
1010
self.outputs_map = outputs_map
11-

package/cloudshell/iac/terraform/models/tf_service.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,3 @@ def _set_context_resource_attributes(self) -> dict:
3434
attr_dict[attribute.Name] = attribute.Value
3535
return attr_dict
3636
raise ValueError(f"Service:{self.name} was not found in order to construct data object")
37-

0 commit comments

Comments
 (0)