iotedgedev 3.3.4__zip
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- s/.devcontainer/Dockerfile +75 -0
- s/.devcontainer/devcontainer.json +40 -0
- s/.devcontainer/library-scripts/docker-in-docker-debian.sh +236 -0
- s/.env.tmp +108 -0
- s/.git/FETCH_HEAD +61 -0
- s/.git/HEAD +1 -0
- s/.git/config +12 -0
- s/.git/description +1 -0
- s/.git/hooks/applypatch-msg.sample +15 -0
- s/.git/hooks/commit-msg.sample +24 -0
- s/.git/hooks/fsmonitor-watchman.sample +173 -0
- s/.git/hooks/post-update.sample +8 -0
- s/.git/hooks/pre-applypatch.sample +14 -0
- s/.git/hooks/pre-commit.sample +49 -0
- s/.git/hooks/pre-merge-commit.sample +13 -0
- s/.git/hooks/pre-push.sample +53 -0
- s/.git/hooks/pre-rebase.sample +169 -0
- s/.git/hooks/pre-receive.sample +24 -0
- s/.git/hooks/prepare-commit-msg.sample +42 -0
- s/.git/hooks/push-to-checkout.sample +78 -0
- s/.git/hooks/update.sample +128 -0
- s/.git/index +0 -0
- s/.git/info/exclude +6 -0
- s/.git/logs/HEAD +1 -0
- s/.git/logs/refs/remotes/origin/EO +1 -0
- s/.git/logs/refs/remotes/origin/avagraw/security_fix +1 -0
- s/.git/logs/refs/remotes/origin/cherry-pick-rename +1 -0
- s/.git/logs/refs/remotes/origin/chyuan/fix-validation-not-fail-test +1 -0
- s/.git/logs/refs/remotes/origin/chyuan/update-linux-agent +1 -0
- s/.git/logs/refs/remotes/origin/dependabot/pip/pyyaml-5.4 +1 -0
- s/.git/logs/refs/remotes/origin/eliises/add-device-tagging-docs +1 -0
- s/.git/logs/refs/remotes/origin/main +1 -0
- s/.git/logs/refs/remotes/origin/ray-deps +1 -0
- s/.git/logs/refs/remotes/origin/ray-dev-setup +1 -0
- s/.git/logs/refs/remotes/origin/ray-tox +1 -0
- s/.git/logs/refs/remotes/origin/release-pipeline-automation +1 -0
- s/.git/logs/refs/remotes/origin/spmcdono/fix-pipeline-test-install +1 -0
- s/.git/logs/refs/remotes/origin/spmcdono/layered-deployments +1 -0
- s/.git/logs/refs/remotes/origin/spmcdono/pypi-package-test-pipeline +1 -0
- s/.git/logs/refs/remotes/origin/spmcdono/remove-py2 +1 -0
- s/.git/logs/refs/remotes/origin/spmcdono/remove-py2-dev +1 -0
- s/.git/logs/refs/remotes/origin/spmcdono/test-native-runtime-install +1 -0
- s/.git/logs/refs/remotes/origin/spmcdono/update-pipeline +1 -0
- s/.git/logs/refs/remotes/origin/user/marine/EliiseS/devcontainer +1 -0
- s/.git/logs/refs/remotes/origin/user/marine/fixsimver +1 -0
- s/.git/logs/refs/remotes/origin/user/marine/layereddeploymentsbuildtest +1 -0
- s/.git/logs/refs/remotes/origin/user/marine/master-to-main +1 -0
- s/.git/logs/refs/remotes/origin/user/marine/pipeline +1 -0
- s/.git/logs/refs/remotes/origin/user/vikas +1 -0
- s/.git/logs/refs/remotes/origin/user/vikas0212/verify-tests +1 -0
- s/.git/logs/refs/remotes/origin/user/vikas2 +1 -0
- s/.git/logs/refs/remotes/origin/user/vikas_pypi +1 -0
- s/.git/logs/refs/remotes/origin/user/vikas_pypi-1 +1 -0
- s/.git/logs/refs/remotes/origin/user/vikas_testing +1 -0
- s/.git/logs/refs/remotes/origin/user/xinzed/dps_conn_str +1 -0
- s/.git/logs/refs/remotes/origin/user/xinzed/update-python-docker +1 -0
- s/.git/logs/refs/remotes/origin/vikas/azure +1 -0
- s/.git/logs/refs/remotes/origin/vikas/dependebot +1 -0
- s/.git/logs/refs/remotes/origin/xinzed/3_1_0rc1 +1 -0
- s/.git/logs/refs/remotes/origin/xinzed/update-runtime +1 -0
- s/.git/objects/pack/pack-a8179feb7da51d11a42c37c5b3c8593cffe17075.idx +0 -0
- s/.git/objects/pack/pack-a8179feb7da51d11a42c37c5b3c8593cffe17075.pack +0 -0
- s/.git/refs/remotes/origin/EO +1 -0
- s/.git/refs/remotes/origin/avagraw/security_fix +1 -0
- s/.git/refs/remotes/origin/cherry-pick-rename +1 -0
- s/.git/refs/remotes/origin/chyuan/fix-validation-not-fail-test +1 -0
- s/.git/refs/remotes/origin/chyuan/update-linux-agent +1 -0
- s/.git/refs/remotes/origin/dependabot/pip/pyyaml-5.4 +1 -0
- s/.git/refs/remotes/origin/eliises/add-device-tagging-docs +1 -0
- s/.git/refs/remotes/origin/main +1 -0
- s/.git/refs/remotes/origin/ray-deps +1 -0
- s/.git/refs/remotes/origin/ray-dev-setup +1 -0
- s/.git/refs/remotes/origin/ray-tox +1 -0
- s/.git/refs/remotes/origin/release-pipeline-automation +1 -0
- s/.git/refs/remotes/origin/spmcdono/fix-pipeline-test-install +1 -0
- s/.git/refs/remotes/origin/spmcdono/layered-deployments +1 -0
- s/.git/refs/remotes/origin/spmcdono/pypi-package-test-pipeline +1 -0
- s/.git/refs/remotes/origin/spmcdono/remove-py2 +1 -0
- s/.git/refs/remotes/origin/spmcdono/remove-py2-dev +1 -0
- s/.git/refs/remotes/origin/spmcdono/test-native-runtime-install +1 -0
- s/.git/refs/remotes/origin/spmcdono/update-pipeline +1 -0
- s/.git/refs/remotes/origin/user/marine/EliiseS/devcontainer +1 -0
- s/.git/refs/remotes/origin/user/marine/fixsimver +1 -0
- s/.git/refs/remotes/origin/user/marine/layereddeploymentsbuildtest +1 -0
- s/.git/refs/remotes/origin/user/marine/master-to-main +1 -0
- s/.git/refs/remotes/origin/user/marine/pipeline +1 -0
- s/.git/refs/remotes/origin/user/vikas +1 -0
- s/.git/refs/remotes/origin/user/vikas0212/verify-tests +1 -0
- s/.git/refs/remotes/origin/user/vikas2 +1 -0
- s/.git/refs/remotes/origin/user/vikas_pypi +1 -0
- s/.git/refs/remotes/origin/user/vikas_pypi-1 +1 -0
- s/.git/refs/remotes/origin/user/vikas_testing +1 -0
- s/.git/refs/remotes/origin/user/xinzed/dps_conn_str +1 -0
- s/.git/refs/remotes/origin/user/xinzed/update-python-docker +1 -0
- s/.git/refs/remotes/origin/vikas/azure +1 -0
- s/.git/refs/remotes/origin/vikas/dependebot +1 -0
- s/.git/refs/remotes/origin/xinzed/3_1_0rc1 +1 -0
- s/.git/refs/remotes/origin/xinzed/update-runtime +1 -0
- s/.git/refs/tags/v0.49.0 +1 -0
- s/.git/refs/tags/v0.50.0 +1 -0
- s/.git/refs/tags/v0.51.0 +1 -0
- s/.git/refs/tags/v0.52.0 +1 -0
- s/.git/refs/tags/v0.53.0 +1 -0
- s/.git/refs/tags/v0.54.0 +1 -0
- s/.git/refs/tags/v0.55.0 +1 -0
- s/.git/refs/tags/v0.56.0 +1 -0
- s/.git/refs/tags/v0.57.0 +1 -0
- s/.git/refs/tags/v0.58.0 +1 -0
- s/.git/refs/tags/v0.59.0 +1 -0
- s/.git/refs/tags/v0.60.0 +1 -0
- s/.git/refs/tags/v0.61.0 +1 -0
- s/.git/refs/tags/v0.62.0 +1 -0
- s/.git/refs/tags/v0.63.0 +1 -0
- s/.git/refs/tags/v0.64.0 +1 -0
- s/.git/refs/tags/v0.65.0 +1 -0
- s/.git/refs/tags/v0.66.0 +1 -0
- s/.git/refs/tags/v0.67.0 +1 -0
- s/.git/refs/tags/v0.68.0 +1 -0
- s/.git/refs/tags/v0.69.0 +1 -0
- s/.git/refs/tags/v0.70.0 +1 -0
- s/.git/refs/tags/v0.71.0 +1 -0
- s/.git/refs/tags/v0.72.0 +1 -0
- s/.git/refs/tags/v0.73.0 +1 -0
- s/.git/refs/tags/v0.74.0 +1 -0
- s/.git/refs/tags/v0.75.0 +1 -0
- s/.git/refs/tags/v0.76.0 +1 -0
- s/.git/refs/tags/v0.77.0 +1 -0
- s/.git/refs/tags/v0.78.0 +1 -0
- s/.git/refs/tags/v0.79.0 +1 -0
- s/.git/refs/tags/v0.82.0 +1 -0
- s/.git/refs/tags/v0.82.0-container +1 -0
- s/.git/refs/tags/v1.0.0 +1 -0
- s/.git/refs/tags/v1.1.0 +1 -0
- s/.git/refs/tags/v1.2.0 +1 -0
- s/.git/refs/tags/v1.3.0 +1 -0
- s/.git/refs/tags/v2.0.0 +1 -0
- s/.git/refs/tags/v2.0.1 +1 -0
- s/.git/refs/tags/v2.0.2 +1 -0
- s/.git/refs/tags/v2.1.0 +1 -0
- s/.git/refs/tags/v2.1.1 +1 -0
- s/.git/refs/tags/v2.1.2 +1 -0
- s/.git/refs/tags/v2.1.3 +1 -0
- s/.git/refs/tags/v2.1.4 +1 -0
- s/.git/refs/tags/v2.1.6 +1 -0
- s/.git/refs/tags/v2.2.0 +1 -0
- s/.git/refs/tags/v3.0.0 +1 -0
- s/.git/refs/tags/v3.0.0-rc +1 -0
- s/.git/refs/tags/v3.1.0 +1 -0
- s/.git/refs/tags/v3.1.1 +1 -0
- s/.git/refs/tags/v3.1.2 +1 -0
- s/.git/refs/tags/v3.2.0 +1 -0
- s/.git/refs/tags/v3.2.0rc0 +1 -0
- s/.git/refs/tags/v3.3.0 +1 -0
- s/.git/refs/tags/v3.3.1 +1 -0
- s/.git/refs/tags/v3.3.2 +1 -0
- s/.git/refs/tags/v3.3.3 +1 -0
- s/.git/refs/tags/v3.3.3-rc0 +1 -0
- s/.git/refs/tags/v3.3.4 +1 -0
- s/.github/ISSUE_TEMPLATE/bug_report.md +16 -0
- s/.github/ISSUE_TEMPLATE/feature_request.md +7 -0
- s/.github/workflows/wiki.yml +54 -0
- s/.gitignore +103 -0
- s/.vscode/launch.json +26 -0
- s/.vscode/settings.json +30 -0
- s/CHANGELOG.md +156 -0
- s/CODE_OF_CONDUCT.md +1 -0
- s/CONTRIBUTING.md +122 -0
- s/LICENSE +14 -0
- s/MANIFEST.in +7 -0
- s/Makefile +87 -0
- s/README.md +204 -0
- s/assets/armdeployment.png +0 -0
- s/assets/armoutputs.png +0 -0
- s/assets/deploy/ARMDeployment/ARMDeployment.deployproj +36 -0
- s/assets/deploy/ARMDeployment/Deploy-AzureResourceGroup.ps1 +118 -0
- s/assets/deploy/ARMDeployment/azuredeploy.json +145 -0
- s/assets/deploy/ARMDeployment/azuredeploy.parameters.json +6 -0
- s/assets/deploy/ARMDeployment.sln +25 -0
- s/assets/edgedevtool2mins.png +0 -0
- s/assets/edgedevtoolintro.png +0 -0
- s/assets/edgedevtoolquickstartlarge.png +0 -0
- s/assets/edgedevtoolquickstartsmall.png +0 -0
- s/assets/edgedevtoolwsl.png +0 -0
- s/azure-pipelines.yml +144 -0
- s/build/lib/iotedgedev/__init__.py +6 -0
- s/build/lib/iotedgedev/args.py +18 -0
- s/build/lib/iotedgedev/azurecli.py +542 -0
- s/build/lib/iotedgedev/buildoptionsparser.py +151 -0
- s/build/lib/iotedgedev/buildprofile.py +5 -0
- s/build/lib/iotedgedev/cli.py +830 -0
- s/build/lib/iotedgedev/connectionstring.py +58 -0
- s/build/lib/iotedgedev/constants.py +12 -0
- s/build/lib/iotedgedev/containerregistry.py +5 -0
- s/build/lib/iotedgedev/decorators.py +116 -0
- s/build/lib/iotedgedev/deploymentmanifest.py +313 -0
- s/build/lib/iotedgedev/dockercls.py +255 -0
- s/build/lib/iotedgedev/dotnet.py +31 -0
- s/build/lib/iotedgedev/edge.py +33 -0
- s/build/lib/iotedgedev/envvars.py +240 -0
- s/build/lib/iotedgedev/iothub.py +65 -0
- s/build/lib/iotedgedev/module.py +62 -0
- s/build/lib/iotedgedev/modules.py +332 -0
- s/build/lib/iotedgedev/organizedgroup.py +48 -0
- s/build/lib/iotedgedev/output.py +57 -0
- s/build/lib/iotedgedev/simulator.py +58 -0
- s/build/lib/iotedgedev/solution.py +48 -0
- s/build/lib/iotedgedev/telemetry.py +155 -0
- s/build/lib/iotedgedev/telemetryconfig.py +85 -0
- s/build/lib/iotedgedev/telemetryuploader.py +53 -0
- s/build/lib/iotedgedev/template/.env.tmp +87 -0
- s/build/lib/iotedgedev/template/.gitignore +10 -0
- s/build/lib/iotedgedev/template/deployment.template.json +79 -0
- s/build/lib/iotedgedev/template/launch_c.json +50 -0
- s/build/lib/iotedgedev/template/launch_csharp.json +43 -0
- s/build/lib/iotedgedev/template/launch_java.json +27 -0
- s/build/lib/iotedgedev/template/launch_node.json +36 -0
- s/build/lib/iotedgedev/template/launch_python.json +22 -0
- s/build/lib/iotedgedev/utility.py +179 -0
- s/build/lib/iotedgedev/version.py +4 -0
- s/build.sh +150 -0
- s/cleanup.sh +7 -0
- s/dist/iotedgedev-3.3.4-py3-none-any.whl +0 -0
- s/docker/tool/build-docker.sh +168 -0
- s/docker/tool/deps.txt +7 -0
- s/docker/tool/linux/Dockerfile +7 -0
- s/docker/tool/linux/Dockerfile.base +61 -0
- s/docker/tool/linux/install-dev.sh +8 -0
- s/docker/tool/linux/run.ps1 +5 -0
- s/docker/tool/linux/run.sh +5 -0
- s/docker/tool/push-docker.sh +35 -0
- s/docker/tool/windows/Dockerfile +4 -0
- s/docker/tool/windows/Dockerfile.base +63 -0
- s/docker/tool/windows/install-dev.bat +4 -0
- s/docker/tool/windows/run.ps1 +30 -0
- s/docs/Azure-Setup.md +102 -0
- s/docs/Command-List.md +564 -0
- s/docs/Command-Tips.md +51 -0
- s/docs/Edge-Device-Setup.md +23 -0
- s/docs/Home.md +10 -0
- s/docs/Manual-Dev-Machine-Setup.md +77 -0
- s/docs/Migration-Guides.md +131 -0
- s/docs/Overview.md +66 -0
- s/docs/Python-Virtual-Environment-Setup.md +35 -0
- s/docs/Quickstart-with-IoT-Edge-Dev-Container.md +145 -0
- s/docs/Test-Coverage.md +7 -0
- s/docs/Troubleshooting.md +21 -0
- s/docs/Usage.md +123 -0
- s/docs/_Sidebar.md +13 -0
- s/iotedgedev/__init__.py +6 -0
- s/iotedgedev/args.py +18 -0
- s/iotedgedev/azurecli.py +542 -0
- s/iotedgedev/buildoptionsparser.py +151 -0
- s/iotedgedev/buildprofile.py +5 -0
- s/iotedgedev/cli.py +830 -0
- s/iotedgedev/connectionstring.py +58 -0
- s/iotedgedev/constants.py +12 -0
- s/iotedgedev/containerregistry.py +5 -0
- s/iotedgedev/decorators.py +116 -0
- s/iotedgedev/deploymentmanifest.py +313 -0
- s/iotedgedev/dockercls.py +255 -0
- s/iotedgedev/dotnet.py +31 -0
- s/iotedgedev/edge.py +33 -0
- s/iotedgedev/envvars.py +240 -0
- s/iotedgedev/iothub.py +65 -0
- s/iotedgedev/module.py +62 -0
- s/iotedgedev/modules.py +332 -0
- s/iotedgedev/organizedgroup.py +48 -0
- s/iotedgedev/output.py +57 -0
- s/iotedgedev/simulator.py +58 -0
- s/iotedgedev/solution.py +48 -0
- s/iotedgedev/telemetry.py +155 -0
- s/iotedgedev/telemetryconfig.py +85 -0
- s/iotedgedev/telemetryuploader.py +53 -0
- s/iotedgedev/template/.env.tmp +87 -0
- s/iotedgedev/template/.gitignore +10 -0
- s/iotedgedev/template/deployment.template.json +79 -0
- s/iotedgedev/template/launch_c.json +50 -0
- s/iotedgedev/template/launch_csharp.json +43 -0
- s/iotedgedev/template/launch_java.json +27 -0
- s/iotedgedev/template/launch_node.json +36 -0
- s/iotedgedev/template/launch_python.json +22 -0
- s/iotedgedev/utility.py +179 -0
- s/iotedgedev/version.py +4 -0
- s/iotedgedev.egg-info/PKG-INFO +21 -0
- s/iotedgedev.egg-info/SOURCES.txt +100 -0
- s/iotedgedev.egg-info/dependency_links.txt +1 -0
- s/iotedgedev.egg-info/entry_points.txt +3 -0
- s/iotedgedev.egg-info/not-zip-safe +1 -0
- s/iotedgedev.egg-info/requires.txt +18 -0
- s/iotedgedev.egg-info/top_level.txt +1 -0
- s/pull_request_template.md +9 -0
- s/pytest.ini +4 -0
- s/requirements.txt +12 -0
- s/requirements_dev.txt +17 -0
- s/scripts/gen-help-markdown.bat +177 -0
- s/scripts/install-pip.sh +1 -0
- s/scripts/setup-wsl.sh +7 -0
- s/setup.cfg +18 -0
- s/setup.py +66 -0
- s/tests/__init__.py +5 -0
- s/tests/assets/deployment.manifest_invalid.json +106 -0
- s/tests/assets/deployment.manifest_invalid_createoptions.json +102 -0
- s/tests/assets/deployment.manifest_invalid_schema.json +69 -0
- s/tests/assets/deployment.template.non_str_placeholder.json +79 -0
- s/tests/assets/deployment.template_1.json +163 -0
- s/tests/assets/deployment.template_2.json +163 -0
- s/tests/assets/deployment.template_3.json +174 -0
- s/tests/assets/deployment.template_4.json +79 -0
- s/tests/assets/deployment.template_invalidresult.json +183 -0
- s/tests/assets/deployment.template_without_schema_template.json +99 -0
- s/tests/assets/launch.json +225 -0
- s/tests/assets/launch_without_nodejs.json +194 -0
- s/tests/assets/test_solution_shared_lib/.gitignore +2 -0
- s/tests/assets/test_solution_shared_lib/.vscode/launch.json +43 -0
- s/tests/assets/test_solution_shared_lib/deployment.debug.template.json +100 -0
- s/tests/assets/test_solution_shared_lib/deployment.escapedpath.template.json +90 -0
- s/tests/assets/test_solution_shared_lib/deployment.template.json +106 -0
- s/tests/assets/test_solution_shared_lib/layered_deployment.flattened_props.template.json +21 -0
- s/tests/assets/test_solution_shared_lib/layered_deployment.no_modules.template.json +12 -0
- s/tests/assets/test_solution_shared_lib/libs/sharedlib/Class1.cs +12 -0
- s/tests/assets/test_solution_shared_lib/libs/sharedlib/sharedlib.csproj +7 -0
- s/tests/assets/test_solution_shared_lib/modules/non_module_project/placeholder.txt +0 -0
- s/tests/assets/test_solution_shared_lib/modules/sample_module/.gitignore +34 -0
- s/tests/assets/test_solution_shared_lib/modules/sample_module/Dockerfile.amd64 +18 -0
- s/tests/assets/test_solution_shared_lib/modules/sample_module/Dockerfile.amd64.debug +25 -0
- s/tests/assets/test_solution_shared_lib/modules/sample_module/Dockerfile.windows-amd64 +15 -0
- s/tests/assets/test_solution_shared_lib/modules/sample_module/Program.cs +91 -0
- s/tests/assets/test_solution_shared_lib/modules/sample_module/module.json +18 -0
- s/tests/assets/test_solution_shared_lib/modules/sample_module/sample_module.csproj +26 -0
- s/tests/assets/test_solution_shared_lib/sample_module_2/.gitignore +34 -0
- s/tests/assets/test_solution_shared_lib/sample_module_2/Dockerfile.amd64 +18 -0
- s/tests/assets/test_solution_shared_lib/sample_module_2/Dockerfile.amd64.debug +25 -0
- s/tests/assets/test_solution_shared_lib/sample_module_2/Dockerfile.windows-amd64 +15 -0
- s/tests/assets/test_solution_shared_lib/sample_module_2/Program.cs +91 -0
- s/tests/assets/test_solution_shared_lib/sample_module_2/module.json +18 -0
- s/tests/assets/test_solution_shared_lib/sample_module_2/sample_module_2.csproj +26 -0
- s/tests/test_azurecli.py +33 -0
- s/tests/test_buildoptionsparser.py +155 -0
- s/tests/test_cli.py +55 -0
- s/tests/test_config.py +28 -0
- s/tests/test_connectionstring.py +87 -0
- s/tests/test_decorators.py +44 -0
- s/tests/test_deploymentmanifest.py +106 -0
- s/tests/test_envvars.py +169 -0
- s/tests/test_iotedgedev_iothub_deploy.py +199 -0
- s/tests/test_iotedgedev_simulator.py +133 -0
- s/tests/test_iotedgedev_solution.py +457 -0
- s/tests/test_iotedgedev_solution_build.py +246 -0
- s/tests/test_iotedgedev_solution_tag.py +99 -0
- s/tests/test_utility.py +132 -0
- s/tests/utility.py +132 -0
- s/tox.ini +29 -0
- s/vsts_ci/.vsts-ci.yml +93 -0
- s/vsts_ci/darwin/continuous-build-darwin.yml +54 -0
- s/vsts_ci/linux/continuous-build-linux.yml +28 -0
- s/vsts_ci/win32/continuous-build-win32.yml +26 -0
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import fnmatch
|
|
2
|
+
import json
|
|
3
|
+
import os
|
|
4
|
+
import subprocess
|
|
5
|
+
from base64 import b64decode, b64encode
|
|
6
|
+
from hashlib import sha256
|
|
7
|
+
from hmac import HMAC
|
|
8
|
+
from time import time
|
|
9
|
+
|
|
10
|
+
from urllib.parse import quote, urlencode
|
|
11
|
+
|
|
12
|
+
from .constants import Constants
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class Utility:
|
|
16
|
+
def __init__(self, envvars, output):
|
|
17
|
+
self.envvars = envvars
|
|
18
|
+
self.output = output
|
|
19
|
+
|
|
20
|
+
def exe_proc(self, params, shell=False, cwd=None, suppress_out=False):
|
|
21
|
+
proc = subprocess.Popen(
|
|
22
|
+
params, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=shell, cwd=cwd)
|
|
23
|
+
|
|
24
|
+
stdout_data, stderr_data = proc.communicate()
|
|
25
|
+
if not suppress_out and stdout_data != "":
|
|
26
|
+
self.output.procout(self.decode(stdout_data))
|
|
27
|
+
|
|
28
|
+
if proc.returncode != 0:
|
|
29
|
+
raise Exception(self.decode(stderr_data))
|
|
30
|
+
|
|
31
|
+
def call_proc(self, params, shell=False, cwd=None):
|
|
32
|
+
try:
|
|
33
|
+
subprocess.check_call(params, shell=shell, cwd=cwd)
|
|
34
|
+
return 0
|
|
35
|
+
except KeyboardInterrupt as ki:
|
|
36
|
+
return 1
|
|
37
|
+
except Exception as e:
|
|
38
|
+
self.output.error("Error while executing command: {0}. {1}".format(' '.join(params), str(e)))
|
|
39
|
+
return 1
|
|
40
|
+
|
|
41
|
+
def check_dependency(self, params, description):
|
|
42
|
+
try:
|
|
43
|
+
self.exe_proc(params, shell=not self.envvars.is_posix(), suppress_out=True)
|
|
44
|
+
except FileNotFoundError:
|
|
45
|
+
raise FileNotFoundError("{0} is required by the Azure IoT Edge Dev Tool. For installation instructions, see https://aka.ms/iotedgedevwiki.".format(description))
|
|
46
|
+
|
|
47
|
+
def is_dir_empty(self, name):
|
|
48
|
+
if os.path.exists(name):
|
|
49
|
+
return len(os.listdir(name)) == 0
|
|
50
|
+
else:
|
|
51
|
+
return True
|
|
52
|
+
|
|
53
|
+
def ensure_dir(self, name):
|
|
54
|
+
if not os.path.exists(name):
|
|
55
|
+
os.makedirs(name)
|
|
56
|
+
|
|
57
|
+
def find_files(self, directory, pattern):
|
|
58
|
+
# find all files in directory that match the pattern.
|
|
59
|
+
for root, dirs, files in os.walk(directory):
|
|
60
|
+
for basename in files:
|
|
61
|
+
if fnmatch.fnmatch(basename, pattern):
|
|
62
|
+
filename = os.path.join(root, basename)
|
|
63
|
+
yield filename
|
|
64
|
+
|
|
65
|
+
def get_iot_hub_sas_token(self, uri, key, policy_name, expiry=3600):
|
|
66
|
+
ttl = time() + expiry
|
|
67
|
+
sign_key = "%s\n%d" % ((quote(uri)), int(ttl))
|
|
68
|
+
signature = b64encode(
|
|
69
|
+
HMAC(b64decode(key), sign_key.encode("utf-8"), sha256).digest())
|
|
70
|
+
|
|
71
|
+
rawtoken = {
|
|
72
|
+
"sr": uri,
|
|
73
|
+
"sig": signature,
|
|
74
|
+
"se": str(int(ttl))
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if policy_name is not None:
|
|
78
|
+
rawtoken["skn"] = policy_name
|
|
79
|
+
|
|
80
|
+
return "SharedAccessSignature " + urlencode(rawtoken)
|
|
81
|
+
|
|
82
|
+
@staticmethod
|
|
83
|
+
def get_file_contents(file, expandvars=False):
|
|
84
|
+
with open(file, "r") as file:
|
|
85
|
+
content = file.read()
|
|
86
|
+
if expandvars:
|
|
87
|
+
return os.path.expandvars(content)
|
|
88
|
+
else:
|
|
89
|
+
return content
|
|
90
|
+
|
|
91
|
+
def decode(self, val):
|
|
92
|
+
return val.decode("utf-8").strip()
|
|
93
|
+
|
|
94
|
+
def get_config_files(self):
|
|
95
|
+
# config files are in root of solution
|
|
96
|
+
|
|
97
|
+
return [os.path.join(os.getcwd(), f) for f in os.listdir(os.getcwd()) if f.endswith("template.json")]
|
|
98
|
+
|
|
99
|
+
def get_bypass_modules(self):
|
|
100
|
+
return [module.strip()
|
|
101
|
+
for module in self.envvars.BYPASS_MODULES.split(",") if module]
|
|
102
|
+
|
|
103
|
+
def in_asterisk_list(self, item, asterisk_list):
|
|
104
|
+
return len(asterisk_list) > 0 and (asterisk_list[0] == "*" or item in asterisk_list)
|
|
105
|
+
|
|
106
|
+
def copy_from_template_dir(self, src_file, dest_dir, dest_file=None, replacements=None):
|
|
107
|
+
if dest_file is None:
|
|
108
|
+
dest_file = src_file
|
|
109
|
+
|
|
110
|
+
template_dir = os.path.join(os.path.split(__file__)[0], "template")
|
|
111
|
+
self.copy_template(os.path.join(template_dir, src_file), os.path.join(dest_dir, dest_file), replacements, expandvars=False)
|
|
112
|
+
|
|
113
|
+
def copy_template(self, src, dest=None, replacements=None, expandvars=True):
|
|
114
|
+
"""Read file at src, replace the keys in replacements with their values, optionally expand environment variables, and save to dest"""
|
|
115
|
+
if dest is None:
|
|
116
|
+
dest = src
|
|
117
|
+
|
|
118
|
+
content = Utility.get_file_contents(src)
|
|
119
|
+
|
|
120
|
+
if replacements:
|
|
121
|
+
for key, value in replacements.items():
|
|
122
|
+
content = content.replace(key, value)
|
|
123
|
+
|
|
124
|
+
if expandvars:
|
|
125
|
+
content = os.path.expandvars(content)
|
|
126
|
+
|
|
127
|
+
with open(dest, "w") as dest_file:
|
|
128
|
+
dest_file.write(content)
|
|
129
|
+
|
|
130
|
+
def nested_set(self, dict_, key_path, value):
|
|
131
|
+
current = dict_
|
|
132
|
+
for key in key_path[:-1]:
|
|
133
|
+
if key not in current:
|
|
134
|
+
current[key] = {}
|
|
135
|
+
current = current.get(key)
|
|
136
|
+
|
|
137
|
+
current[key_path[-1]] = value
|
|
138
|
+
|
|
139
|
+
def del_key(self, dict_, key_path):
|
|
140
|
+
if not isinstance(dict_, dict):
|
|
141
|
+
return None
|
|
142
|
+
|
|
143
|
+
current = dict_
|
|
144
|
+
for key in key_path[:-1]:
|
|
145
|
+
current = current.get(key, None)
|
|
146
|
+
|
|
147
|
+
if not isinstance(current, dict):
|
|
148
|
+
return None
|
|
149
|
+
|
|
150
|
+
return current.pop(key_path[-1], None)
|
|
151
|
+
|
|
152
|
+
@staticmethod
|
|
153
|
+
def get_sha256_hash(val):
|
|
154
|
+
hash_object = sha256(val.encode('utf-8'))
|
|
155
|
+
|
|
156
|
+
return str(hash_object.hexdigest()).lower()
|
|
157
|
+
|
|
158
|
+
@staticmethod
|
|
159
|
+
def get_deployment_manifest_name(template_file, template_schema_ver, platform):
|
|
160
|
+
if "DEPLOYMENT_CONFIG_FILE" in os.environ:
|
|
161
|
+
return os.environ["DEPLOYMENT_CONFIG_FILE"]
|
|
162
|
+
|
|
163
|
+
if template_schema_ver is None:
|
|
164
|
+
if os.path.exists(template_file):
|
|
165
|
+
json_ = json.loads(Utility.get_file_contents(template_file, expandvars=True))
|
|
166
|
+
template_schema_ver = json_.get("$schema-template", "")
|
|
167
|
+
else:
|
|
168
|
+
template_schema_ver = Constants.deployment_template_schema_version
|
|
169
|
+
|
|
170
|
+
platform = "." + platform if template_schema_ver > "0.0.1" else ""
|
|
171
|
+
prefix = os.path.basename(template_file)
|
|
172
|
+
if prefix.endswith(Constants.deployment_template_suffix):
|
|
173
|
+
prefix = prefix[:-len(Constants.deployment_template_suffix)]
|
|
174
|
+
elif prefix.endswith(".json"):
|
|
175
|
+
prefix = prefix[:-len(".json")]
|
|
176
|
+
else:
|
|
177
|
+
prefix = "deployment"
|
|
178
|
+
|
|
179
|
+
return "{0}{1}.json".format(prefix, platform)
|
s/build.sh
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# stop on error
|
|
4
|
+
set -e
|
|
5
|
+
|
|
6
|
+
function show_help
|
|
7
|
+
{
|
|
8
|
+
echo "Usage:"
|
|
9
|
+
echo "build.sh local|test|prod none|minor|major imagename [windows|linux]"
|
|
10
|
+
echo "local: don't upload to pypi, test: uses pypitest, prod: uses pypi"
|
|
11
|
+
echo "none: don't bumpversion, minor: bumpversion minor --no-commit --no-tag, major: bumpversion major"
|
|
12
|
+
echo "imagename: localhost:5000/iotedgedev, jongacr.azurecr.io/iotedgedev, microsoft/iotedgedev"
|
|
13
|
+
echo "windows: builds only windows container, linux: builds only linux container. omit to build both."
|
|
14
|
+
echo "NOTES: 1. You must have .pypirc in repo root with pypi and pypitest sections. 2. You must have .env file in root with connection strings set."
|
|
15
|
+
|
|
16
|
+
exit 1
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
MODE="$1"
|
|
20
|
+
VERSION_BUMP="$2"
|
|
21
|
+
IMAGE_NAME="$3"
|
|
22
|
+
PLATFORM="$4"
|
|
23
|
+
|
|
24
|
+
if [ -z "$MODE" ] || [ -z "$VERSION_BUMP" ] || [ -z "$IMAGE_NAME" ]; then
|
|
25
|
+
show_help
|
|
26
|
+
fi
|
|
27
|
+
|
|
28
|
+
echo -e "\n===== Setting up build environment"
|
|
29
|
+
if [ "$MODE" = "local" ]; then
|
|
30
|
+
echo "Environment: $MODE"
|
|
31
|
+
elif [ "$MODE" = "test" ]; then
|
|
32
|
+
echo "Environment: $MODE"
|
|
33
|
+
elif [ "$MODE" = "prod" ]; then
|
|
34
|
+
echo "Environment: $MODE"
|
|
35
|
+
else
|
|
36
|
+
echo "ERROR> Build mode parameter not known. must be 'local', 'prod' or 'test'"
|
|
37
|
+
exit 1
|
|
38
|
+
fi
|
|
39
|
+
|
|
40
|
+
if [ ! -z $PLATFORM ]; then
|
|
41
|
+
echo "Platform: $PLATFORM"
|
|
42
|
+
fi
|
|
43
|
+
|
|
44
|
+
if [ "$OSTYPE" = "msys" ]; then
|
|
45
|
+
echo -e "\n===== Checking pre-requisistes"
|
|
46
|
+
IS_ADMIN=$(powershell '([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")')
|
|
47
|
+
if [ "$IS_ADMIN" = "False" ]; then
|
|
48
|
+
echo "ERROR> Build script must be run as administrator"
|
|
49
|
+
exit 1
|
|
50
|
+
fi
|
|
51
|
+
fi
|
|
52
|
+
|
|
53
|
+
#TODO
|
|
54
|
+
# check if running in administrator mode
|
|
55
|
+
# make sure docker is in linux mode
|
|
56
|
+
# make sure docker supports manifest option
|
|
57
|
+
# stop and restart docker to make sure to avoid networking problem?
|
|
58
|
+
# check that dockerhub exists and is accessible
|
|
59
|
+
# check that pipy repo exists and is accessible
|
|
60
|
+
# make sure there are no pending changes in GIT otherwise bumpversion will complain
|
|
61
|
+
|
|
62
|
+
function run_tox {
|
|
63
|
+
echo -e "\n===== Preventive cleanup"
|
|
64
|
+
rm __pycache__ -rf
|
|
65
|
+
rm .pytest_cache -rf
|
|
66
|
+
rm .tox -rf
|
|
67
|
+
rm .pytest_cache -rf
|
|
68
|
+
rm tests/__pycache__ -rf
|
|
69
|
+
|
|
70
|
+
echo -e "\n===== Running Tox"
|
|
71
|
+
tox
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function get_version
|
|
75
|
+
{
|
|
76
|
+
VERSION=$(cat ./iotedgedev/__init__.py | grep '__version__' | grep -oP "'\K[^']+")
|
|
77
|
+
echo ${VERSION}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function run_bumpversion {
|
|
81
|
+
|
|
82
|
+
if [ "$VERSION_BUMP" = "none" ]; then
|
|
83
|
+
return
|
|
84
|
+
fi
|
|
85
|
+
|
|
86
|
+
echo -e "\n===== Bumping version"
|
|
87
|
+
|
|
88
|
+
if [ "$MODE" = "prod" ]; then
|
|
89
|
+
bumpversion $VERSION_BUMP
|
|
90
|
+
else
|
|
91
|
+
bumpversion $VERSION_BUMP --no-commit --no-tag --allow-dirty
|
|
92
|
+
fi
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function run_build_wheel
|
|
96
|
+
{
|
|
97
|
+
echo -e "\n===== Building Python Wheel"
|
|
98
|
+
python setup.py bdist_wheel
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function run_upload_pypi
|
|
102
|
+
{
|
|
103
|
+
if [ "$MODE" != "local" ]; then
|
|
104
|
+
echo -e "\n===== Uploading to PyPi"
|
|
105
|
+
PYPI=$([ "$MODE" = "prod" ] && echo "pypi" || echo "pypitest")
|
|
106
|
+
twine upload -r ${PYPI} --config-file .pypirc dist/iotedgedev-$(get_version)-py3-none-any.whl
|
|
107
|
+
fi
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function run_build_docker
|
|
111
|
+
{
|
|
112
|
+
echo -e "\n===== Building Docker Containers"
|
|
113
|
+
./docker/tool/build-docker.sh $IMAGE_NAME $PLATFORM
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function run_push_docker
|
|
117
|
+
{
|
|
118
|
+
echo -e "\n===== Pushing Docker Containers"
|
|
119
|
+
./docker/tool/push-docker.sh $IMAGE_NAME $PLATFORM
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function run_push_git
|
|
123
|
+
{
|
|
124
|
+
if [ "$MODE" = "prod" ]; then
|
|
125
|
+
echo 'Resetting __init__ file'
|
|
126
|
+
git checkout ./iotedgedev/__init__.py
|
|
127
|
+
|
|
128
|
+
echo -e "\n===== Pushing Tags to Git"
|
|
129
|
+
git push --tags && git push
|
|
130
|
+
fi
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function set_analytics_key
|
|
134
|
+
{
|
|
135
|
+
if [[ ${AIKEY//-/} =~ ^[[:xdigit:]]{32}$ ]]; then
|
|
136
|
+
echo 'Found AIKEY environment variable. Replacing __AIkey__'
|
|
137
|
+
sed -i "/__AIkey__/c __AIkey__ = '${AIKEY}'" ./iotedgedev/__init__.py
|
|
138
|
+
fi
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
set_analytics_key
|
|
142
|
+
run_bumpversion
|
|
143
|
+
run_tox
|
|
144
|
+
run_build_wheel
|
|
145
|
+
run_build_docker
|
|
146
|
+
run_upload_pypi
|
|
147
|
+
run_push_docker
|
|
148
|
+
run_push_git
|
|
149
|
+
|
|
150
|
+
echo -e "\n===== All done"
|
s/cleanup.sh
ADDED
|
Binary file
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# stop on error
|
|
4
|
+
set -e
|
|
5
|
+
|
|
6
|
+
# make sure we're in docker folder
|
|
7
|
+
original_folder=$PWD
|
|
8
|
+
|
|
9
|
+
if [ ! -z "$(echo $PWD | grep /docker/tool$)" ]; then
|
|
10
|
+
in_docker_folder=1
|
|
11
|
+
else
|
|
12
|
+
in_docker_folder=0
|
|
13
|
+
cd docker/tool
|
|
14
|
+
fi
|
|
15
|
+
|
|
16
|
+
# read IoTEdgeDev version from python __init__ file
|
|
17
|
+
|
|
18
|
+
export VERSION=$(cat ../../iotedgedev/__init__.py | grep '__version__' | grep -oP "'\K[^']+")
|
|
19
|
+
|
|
20
|
+
IMAGE_NAME="$1"
|
|
21
|
+
PLATFORM="$2"
|
|
22
|
+
|
|
23
|
+
if [ "$IMAGE_NAME" = "--help" ]; then
|
|
24
|
+
echo "Usage:"
|
|
25
|
+
echo "build-docker.sh imagename [linux|windows]"
|
|
26
|
+
exit 1
|
|
27
|
+
fi
|
|
28
|
+
|
|
29
|
+
PYTHON2="2.7.14" #TODO READ FROM deps.txt
|
|
30
|
+
PYTHON3="3.6.6"
|
|
31
|
+
|
|
32
|
+
build_linux=1
|
|
33
|
+
build_windows=1
|
|
34
|
+
|
|
35
|
+
function switch_docker
|
|
36
|
+
{
|
|
37
|
+
echo "===== Switching Docker engine"
|
|
38
|
+
echo "===== From: " $(docker version --format '{{.Server.Os}}')
|
|
39
|
+
/c/Program\ Files/Docker/Docker/DockerCli.exe -SwitchDaemon
|
|
40
|
+
echo "===== To: " $(docker version --format '{{.Server.Os}}')
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function get_docker_mode
|
|
44
|
+
{
|
|
45
|
+
echo $(docker version --format '{{.Server.Os}}')
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function check_docker_expected_mode
|
|
49
|
+
{
|
|
50
|
+
local mode=$(get_docker_mode)
|
|
51
|
+
|
|
52
|
+
if [ $mode != $PLATFORM ]; then
|
|
53
|
+
echo "===== ERROR: docker is not in expected mode: '$PLATFORM'"
|
|
54
|
+
exit 1
|
|
55
|
+
fi
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function build_linux
|
|
59
|
+
{
|
|
60
|
+
echo "===== Building Linux Based images"
|
|
61
|
+
|
|
62
|
+
check_docker_expected_mode "linux"
|
|
63
|
+
|
|
64
|
+
cd linux
|
|
65
|
+
|
|
66
|
+
rm iotedgedev-$VERSION-py3-none-any.whl --force
|
|
67
|
+
|
|
68
|
+
cp ../../../dist/iotedgedev-$VERSION-py3-none-any.whl iotedgedev-$VERSION-py3-none-any.whl
|
|
69
|
+
|
|
70
|
+
docker build \
|
|
71
|
+
-f Dockerfile.base \
|
|
72
|
+
-t iotedgedev-linux-base \
|
|
73
|
+
.
|
|
74
|
+
|
|
75
|
+
docker build \
|
|
76
|
+
-f Dockerfile \
|
|
77
|
+
--build-arg IOTEDGEDEV_VERSION=$VERSION \
|
|
78
|
+
-t $IMAGE_NAME:$VERSION-amd64 \
|
|
79
|
+
-t $IMAGE_NAME:latest-amd64 \
|
|
80
|
+
-t $IMAGE_NAME:$VERSION \
|
|
81
|
+
-t $IMAGE_NAME:latest \
|
|
82
|
+
.
|
|
83
|
+
|
|
84
|
+
rm iotedgedev-$VERSION-py3-none-any.whl --force
|
|
85
|
+
|
|
86
|
+
cd ..
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function build_windows
|
|
90
|
+
{
|
|
91
|
+
echo "===== Building Windows Based images"
|
|
92
|
+
|
|
93
|
+
check_docker_expected_mode "windows"
|
|
94
|
+
|
|
95
|
+
cd windows
|
|
96
|
+
|
|
97
|
+
rm iotedgedev-$VERSION-py3-none-any.whl --force
|
|
98
|
+
|
|
99
|
+
cp ../../../dist/iotedgedev-$VERSION-py3-none-any.whl iotedgedev-$VERSION-py3-none-any.whl
|
|
100
|
+
|
|
101
|
+
docker build \
|
|
102
|
+
-f Dockerfile.base \
|
|
103
|
+
-t iotedgedev-windows-base \
|
|
104
|
+
--build-arg PYTHON2_VERSION=$PYTHON2 \
|
|
105
|
+
--build-arg PYTHON3_VERSION=$PYTHON3 \
|
|
106
|
+
.
|
|
107
|
+
|
|
108
|
+
docker build \
|
|
109
|
+
-f Dockerfile \
|
|
110
|
+
--build-arg IOTEDGEDEV_VERSION=$VERSION \
|
|
111
|
+
-t microsoft/iotedgedev:$VERSION-windows-amd64 \
|
|
112
|
+
-t microsoft/iotedgedev:latest-windows-amd64 \
|
|
113
|
+
-t mcr.microsoft.com/public/iotedge/iotedgedev:$VERSION-windows-amd64 \
|
|
114
|
+
-t mcr.microsoft.com/public/iotedge/iotedgedev:latest-windows-amd64 \
|
|
115
|
+
-t $IMAGE_NAME:$VERSION-windows-amd64 \
|
|
116
|
+
-t $IMAGE_NAME:latest-windows-amd64 \
|
|
117
|
+
.
|
|
118
|
+
|
|
119
|
+
rm iotedgedev-$VERSION-py3-none-any.whl --force
|
|
120
|
+
|
|
121
|
+
cd ..
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
if [ ! -z "$PLATFORM" ]; then
|
|
127
|
+
if [ "$PLATFORM" = "linux" ]; then
|
|
128
|
+
build_windows=0
|
|
129
|
+
echo "===== Building Linux image only"
|
|
130
|
+
elif [ "$PLATFORM" = "windows" ]; then
|
|
131
|
+
build_linux=0
|
|
132
|
+
echo "===== Building Windows image only"
|
|
133
|
+
else
|
|
134
|
+
echo "Unknown option: $PLATFORM"
|
|
135
|
+
echo "Use --help for help"
|
|
136
|
+
exit 1
|
|
137
|
+
fi
|
|
138
|
+
else
|
|
139
|
+
echo "===== Building Windows and Linux images"
|
|
140
|
+
fi
|
|
141
|
+
|
|
142
|
+
mode=$(get_docker_mode)
|
|
143
|
+
echo "===== Docker is in '$mode' container mode"
|
|
144
|
+
if [ $mode = "windows" ]; then
|
|
145
|
+
# Docker is in Windows Container mode
|
|
146
|
+
if [ $build_windows = "1" ]; then
|
|
147
|
+
build_windows
|
|
148
|
+
fi
|
|
149
|
+
if [ $build_linux = "1" ]; then
|
|
150
|
+
switch_docker
|
|
151
|
+
build_linux
|
|
152
|
+
switch_docker
|
|
153
|
+
fi
|
|
154
|
+
else
|
|
155
|
+
# Docker is in Linux Container mode
|
|
156
|
+
if [ $build_linux -eq "1" ]; then
|
|
157
|
+
build_linux
|
|
158
|
+
fi
|
|
159
|
+
if [ $build_windows -eq "1" ]; then
|
|
160
|
+
switch_docker
|
|
161
|
+
build_windows
|
|
162
|
+
switch_docker
|
|
163
|
+
fi
|
|
164
|
+
fi
|
|
165
|
+
|
|
166
|
+
if [ in_docker_folder = 0 ]; then
|
|
167
|
+
cd original_folder
|
|
168
|
+
fi
|
s/docker/tool/deps.txt
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
FROM iotedgedev-linux-base
|
|
2
|
+
ARG IOTEDGEDEV_VERSION
|
|
3
|
+
COPY iotedgedev-$IOTEDGEDEV_VERSION-py3-none-any.whl dist/iotedgedev-$IOTEDGEDEV_VERSION-py3-none-any.whl
|
|
4
|
+
RUN sudo -H pip3 install dist/iotedgedev-$IOTEDGEDEV_VERSION-py3-none-any.whl && \
|
|
5
|
+
sudo rm -rf dist/
|
|
6
|
+
ENV LC_ALL C.UTF-8
|
|
7
|
+
ENV LANG C.UTF-8
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
FROM ubuntu:18.04
|
|
2
|
+
ENV DEBIAN_FRONTEND noninteractive
|
|
3
|
+
ENV DOTNETCORESDK_VERSION 2.1
|
|
4
|
+
ENV DOCKER_COMPOSE_VERSION 1.22.0
|
|
5
|
+
ENV MAVEN_VERSION=3.5.4
|
|
6
|
+
RUN apt-get update && apt-get install -y apt-transport-https ca-certificates curl software-properties-common && \
|
|
7
|
+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - && \
|
|
8
|
+
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" && \
|
|
9
|
+
apt-get update && \
|
|
10
|
+
apt-get install -y docker-ce
|
|
11
|
+
RUN apt-get install git gnupg gnupg2 gnupg1 -y && \
|
|
12
|
+
apt-get install -y --no-install-recommends dialog apt-utils curl apt-transport-https python-pip python3-pip libltdl-dev && \
|
|
13
|
+
curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
|
|
14
|
+
apt-get install -y nodejs
|
|
15
|
+
RUN apt-get install -y wget && \
|
|
16
|
+
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg && \
|
|
17
|
+
mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/ && \
|
|
18
|
+
wget -q https://packages.microsoft.com/config/ubuntu/18.04/prod.list && \
|
|
19
|
+
mv prod.list /etc/apt/sources.list.d/microsoft-prod.list && \
|
|
20
|
+
apt-get install -y apt-transport-https && \
|
|
21
|
+
apt-get update && \
|
|
22
|
+
apt-get install -y dotnet-sdk-$DOTNETCORESDK_VERSION
|
|
23
|
+
RUN curl -L https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_VERSION/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose && \
|
|
24
|
+
chmod +x /usr/local/bin/docker-compose
|
|
25
|
+
RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash
|
|
26
|
+
RUN apt-get update && \
|
|
27
|
+
npm i npm@latest -g && \
|
|
28
|
+
npm i -g azure-iothub yo generator-azure-iot-edge-module && \
|
|
29
|
+
apt-get install -y --no-install-recommends python-dev build-essential libssl-dev libffi-dev libxml2-dev libxslt1-dev zlib1g-dev sudo
|
|
30
|
+
RUN python3 -m pip install --upgrade pip && \
|
|
31
|
+
pip3 install setuptools && \
|
|
32
|
+
pip3 install cookiecutter
|
|
33
|
+
RUN apt-get -y install openjdk-8-jdk
|
|
34
|
+
RUN apt-get update && \
|
|
35
|
+
apt-get install -y ca-certificates-java && \
|
|
36
|
+
update-ca-certificates -f && \
|
|
37
|
+
rm -rf /var/cache/oracle-jdk8-installer
|
|
38
|
+
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
|
|
39
|
+
ENV PATH $JAVA_HOME/bin:$PATH
|
|
40
|
+
RUN mkdir -p /usr/share/maven /usr/share/maven/ref && \
|
|
41
|
+
curl -fsSL -o /tmp/apache-maven.tar.gz https://www.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz && \
|
|
42
|
+
tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 && \
|
|
43
|
+
rm -f /tmp/apache-maven.tar.gz && \
|
|
44
|
+
ln -s /usr/share/maven/bin/mvn /usr/bin/mvn
|
|
45
|
+
RUN apt-get clean && \
|
|
46
|
+
rm -rf /var/lib/apt/lists/*
|
|
47
|
+
WORKDIR /home/iotedge
|
|
48
|
+
COPY install-dev.sh /scripts/install-dev.sh
|
|
49
|
+
RUN sed -i 's/\r//' /scripts/install-dev.sh
|
|
50
|
+
|
|
51
|
+
# Switch to a non-root user because Yeoman does not work with root users
|
|
52
|
+
# https://github.com/Azure/iotedgedev/issues/312
|
|
53
|
+
RUN useradd -m iotedgedev && \
|
|
54
|
+
echo 'iotedgedev ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \
|
|
55
|
+
chown -R iotedgedev:iotedgedev /home/iotedge
|
|
56
|
+
USER iotedgedev
|
|
57
|
+
# Azure CLI extensions are installed per user
|
|
58
|
+
RUN az extension add --name azure-iot && \
|
|
59
|
+
echo 'alias python=python3' >> ~/.bashrc && \
|
|
60
|
+
echo 'alias pip=pip3' >> ~/.bashrc
|
|
61
|
+
ENV DEBIAN_FRONTEND teletype
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# stop on error
|
|
4
|
+
set -e
|
|
5
|
+
|
|
6
|
+
function show_help
|
|
7
|
+
{
|
|
8
|
+
echo "Usage:"
|
|
9
|
+
echo "push-docker.sh [<version>]"
|
|
10
|
+
echo ""
|
|
11
|
+
echo "version: version to push. Automatically detected if not specified"
|
|
12
|
+
exit 1
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
# iotedgetoolscontainerregistry.azure.io is the ACR that has a webhook to publish to MCR
|
|
16
|
+
# only this ACR should be used
|
|
17
|
+
ACR_LOGIN_SERVER="iotedgetoolscontainerregistry.azurecr.io"
|
|
18
|
+
IMAGE_NAME="iotedgedev"
|
|
19
|
+
VERSION="$1"
|
|
20
|
+
|
|
21
|
+
if [ "$VERSION" = "--help" ]; then
|
|
22
|
+
show_help
|
|
23
|
+
fi
|
|
24
|
+
|
|
25
|
+
if [ -z "$VERSION" ]; then
|
|
26
|
+
echo -e "\n===== Detecting version"
|
|
27
|
+
VERSION=$(grep '__version__' ../../iotedgedev/__init__.py | grep -oP "'\K[^']+")
|
|
28
|
+
echo "Detected version $VERSION"
|
|
29
|
+
fi
|
|
30
|
+
|
|
31
|
+
echo -e "\n===== Pushing Docker images"
|
|
32
|
+
docker push $ACR_LOGIN_SERVER/public/iotedge/$IMAGE_NAME:$VERSION-amd64
|
|
33
|
+
docker push $ACR_LOGIN_SERVER/public/iotedge/$IMAGE_NAME:$VERSION
|
|
34
|
+
docker push $ACR_LOGIN_SERVER/public/iotedge/$IMAGE_NAME:latest-amd64
|
|
35
|
+
docker push $ACR_LOGIN_SERVER/public/iotedge/$IMAGE_NAME:latest
|