From f6bb21694bc445daae7fdfc95ad98596fb92d048 Mon Sep 17 00:00:00 2001 From: zues23 Date: Thu, 4 Apr 2019 09:42:31 +0300 Subject: [PATCH 1/9] Set up CI with Azure Pipelines [skip ci] --- azure-pipelines.yml | 58 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..cfe1e30 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,58 @@ +# Python package +# Create and test a Python package on multiple Python versions. +# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more: +# https://docs.microsoft.com/azure/devops/pipelines/languages/python + +trigger: +- master + +jobs: + +- job: 'Test' + pool: + vmImage: 'Ubuntu-16.04' + strategy: + matrix: + Python27: + python.version: '2.7' + Python35: + python.version: '3.5' + Python36: + python.version: '3.6' + Python37: + python.version: '3.7' + maxParallel: 4 + + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: '$(python.version)' + architecture: 'x64' + + - script: python -m pip install --upgrade pip && pip install -r requirements.txt + displayName: 'Install dependencies' + + - script: | + pip install pytest + pytest tests --doctest-modules --junitxml=junit/test-results.xml + displayName: 'pytest' + + - task: PublishTestResults@2 + inputs: + testResultsFiles: '**/test-results.xml' + testRunTitle: 'Python $(python.version)' + condition: succeededOrFailed() + +- job: 'Publish' + dependsOn: 'Test' + pool: + vmImage: 'Ubuntu-16.04' + + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: '3.x' + architecture: 'x64' + + - script: python setup.py sdist + displayName: 'Build sdist' From 4f335c7f8d361eff50edffe23f36f7969c954a52 Mon Sep 17 00:00:00 2001 From: zues23 Date: Sun, 7 Apr 2019 13:32:10 +0300 Subject: [PATCH 2/9] Update azure-pipelines.yml for Azure Pipelines [skip ci] --- azure-pipelines.yml | 131 +++++++++++++++++++++++++++++--------------- 1 file changed, 86 insertions(+), 45 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index cfe1e30..73f5d97 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,58 +1,99 @@ -# Python package -# Create and test a Python package on multiple Python versions. -# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more: -# https://docs.microsoft.com/azure/devops/pipelines/languages/python - -trigger: -- master jobs: - -- job: 'Test' +- job: Dependencies 1 pool: - vmImage: 'Ubuntu-16.04' - strategy: - matrix: - Python27: - python.version: '2.7' - Python35: - python.version: '3.5' - Python36: - python.version: '3.6' - Python37: - python.version: '3.7' - maxParallel: 4 - - steps: - - task: UsePythonVersion@0 + vmImage: 'ubuntu-16.04' + steps: + - task: NodeTool@0 + inputs: + versionSpec: '8.x' + displayName: 'Install Node.js' + - task: Npm@1 inputs: - versionSpec: '$(python.version)' - architecture: 'x64' + command: 'install' + - script: | + npm run build + displayName: 'UI build' - - script: python -m pip install --upgrade pip && pip install -r requirements.txt +- job: Dependencies 2 + - script: | + chmod +x .devops/scripts/*.sh + ./.devops/scripts/install-dependencies1.sh displayName: 'Install dependencies' +##################################################### +# Run test +########################################################### + +- job: Run Test + steps: - script: | - pip install pytest - pytest tests --doctest-modules --junitxml=junit/test-results.xml - displayName: 'pytest' + chmod +x .devops/scripts/*.sh + ./.devops/scripts/test2.sh + displayName: 'Test App' - - task: PublishTestResults@2 - inputs: - testResultsFiles: '**/test-results.xml' - testRunTitle: 'Python $(python.version)' - condition: succeededOrFailed() +##################################################### +# Create Artifacts +########################################################### -- job: 'Publish' - dependsOn: 'Test' - pool: - vmImage: 'Ubuntu-16.04' +- job: Create Artifacts + steps: + - script: | + chmod +x .devops/scripts/*.sh + ./.devops/scripts/artifacts3.sh + displayName: 'Create Artifacts' +##################################################### +# Copy severless config files to artifacts folder +########################################################### + +- job: Copy the serverless config steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.x' - architecture: 'x64' + - script: | + chmod +x .devops/scripts/*.sh + ./.devops/scripts/slconfig4.sh + displayName: 'Copy the serverless config files into the artifacts folder' - - script: python setup.py sdist - displayName: 'Build sdist' +##################################################### +#Build React App +########################################################### + +- job: Build the React App + steps: + - script: | + chmod +x .devops/scripts/*.sh + ./.devops/scripts/build-reactapp7.sh + displayName: 'Build the React App' + +##################################################### +#Deploy PIT2 API +########################################################### + +- job: Deploy PIT2 API + steps: + - script: | + chmod +x .devops/scripts/*.sh + ./.devops/scripts/deploy-api.sh + displayName: 'Deploy pit2-api' + +##################################################### +#Deploy PIT2 IMPORT +########################################################### + +- job: Deploy PIT IMPORT + steps: + - script: | + chmod +x .devops/scripts/*.sh + ./.devops/scripts/deploy-import.sh + displayName: 'Deploy pit2-import' + +##################################################### +#Deploy React App +########################################################### + +- job: Deploy React App + steps: + - script: | + chmod +x .devops/scripts/*.sh + ./.devops/scripts/deploy-reactapp7.sh + displayName: 'Deploy React App' From adf6a54a2078da47819dbc27ccee71a735cc450d Mon Sep 17 00:00:00 2001 From: zues23 Date: Sun, 7 Apr 2019 14:53:52 +0300 Subject: [PATCH 3/9] Update azure-pipelines.yml for Azure Pipelines [skip ci] --- azure-pipelines.yml | 116 +++++++------------------------------------- 1 file changed, 17 insertions(+), 99 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 73f5d97..00d5e94 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,99 +1,17 @@ - -jobs: -- job: Dependencies 1 - pool: - vmImage: 'ubuntu-16.04' - steps: - - task: NodeTool@0 - inputs: - versionSpec: '8.x' - displayName: 'Install Node.js' - - task: Npm@1 - inputs: - command: 'install' - - script: | - npm run build - displayName: 'UI build' - -- job: Dependencies 2 - - script: | - chmod +x .devops/scripts/*.sh - ./.devops/scripts/install-dependencies1.sh - displayName: 'Install dependencies' - -##################################################### -# Run test -########################################################### - -- job: Run Test - steps: - - script: | - chmod +x .devops/scripts/*.sh - ./.devops/scripts/test2.sh - displayName: 'Test App' - -##################################################### -# Create Artifacts -########################################################### - -- job: Create Artifacts - steps: - - script: | - chmod +x .devops/scripts/*.sh - ./.devops/scripts/artifacts3.sh - displayName: 'Create Artifacts' - -##################################################### -# Copy severless config files to artifacts folder -########################################################### - -- job: Copy the serverless config - steps: - - script: | - chmod +x .devops/scripts/*.sh - ./.devops/scripts/slconfig4.sh - displayName: 'Copy the serverless config files into the artifacts folder' - -##################################################### -#Build React App -########################################################### - -- job: Build the React App - steps: - - script: | - chmod +x .devops/scripts/*.sh - ./.devops/scripts/build-reactapp7.sh - displayName: 'Build the React App' - -##################################################### -#Deploy PIT2 API -########################################################### - -- job: Deploy PIT2 API - steps: - - script: | - chmod +x .devops/scripts/*.sh - ./.devops/scripts/deploy-api.sh - displayName: 'Deploy pit2-api' - -##################################################### -#Deploy PIT2 IMPORT -########################################################### - -- job: Deploy PIT IMPORT - steps: - - script: | - chmod +x .devops/scripts/*.sh - ./.devops/scripts/deploy-import.sh - displayName: 'Deploy pit2-import' - -##################################################### -#Deploy React App -########################################################### - -- job: Deploy React App - steps: - - script: | - chmod +x .devops/scripts/*.sh - ./.devops/scripts/deploy-reactapp7.sh - displayName: 'Deploy React App' +pool: + vmImage: 'Ubuntu 16.04' + +steps: +- task: NodeTool@0 + inputs: + versionSpec: '8.x' + displayName: 'Install Node.js' + +- script: | + npm install + npm install node-lambda -g + displayName: 'npm install' + +- script: | + node-lambda deploy -a $(AWS_ACCESS_KEY) -s $(AWS_SECRET_KEY) -o $(AWS_ROLE) -r $(AWS_REGION) -n $(AWS_LAMBDA_FUNCTION_NAME) --excludeGlobs "azure-pipelines.yml" + displayName: 'Deploy to AWS' \ No newline at end of file From 54fb696fd3c7f556da56d13d8162031fc36126bc Mon Sep 17 00:00:00 2001 From: zues23 Date: Sun, 7 Apr 2019 14:57:21 +0300 Subject: [PATCH 4/9] Update azure-pipelines.yml for Azure Pipelines [skip ci] --- azure-pipelines.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 00d5e94..e981e3c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -11,7 +11,13 @@ steps: npm install npm install node-lambda -g displayName: 'npm install' - + +- steps: + - script: | + chmod +x .devops/scripts/*.sh + zubes/.devops/scripts/test2.sh + displayName: 'Test App' + - script: | node-lambda deploy -a $(AWS_ACCESS_KEY) -s $(AWS_SECRET_KEY) -o $(AWS_ROLE) -r $(AWS_REGION) -n $(AWS_LAMBDA_FUNCTION_NAME) --excludeGlobs "azure-pipelines.yml" displayName: 'Deploy to AWS' \ No newline at end of file From d671d978eb071ae7b5c3bd824322db626262c819 Mon Sep 17 00:00:00 2001 From: zues23 Date: Sun, 7 Apr 2019 14:57:46 +0300 Subject: [PATCH 5/9] Update azure-pipelines.yml for Azure Pipelines [skip ci] --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e981e3c..2c99a94 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -12,8 +12,8 @@ steps: npm install node-lambda -g displayName: 'npm install' -- steps: - - script: | + +- script: | chmod +x .devops/scripts/*.sh zubes/.devops/scripts/test2.sh displayName: 'Test App' From 3086f364f8a5c09f86b290247bac3fd6493abf11 Mon Sep 17 00:00:00 2001 From: zues23 Date: Sun, 7 Apr 2019 14:58:18 +0300 Subject: [PATCH 6/9] Update azure-pipelines.yml for Azure Pipelines [skip ci] --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 2c99a94..8661344 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -16,7 +16,7 @@ steps: - script: | chmod +x .devops/scripts/*.sh zubes/.devops/scripts/test2.sh - displayName: 'Test App' + displayName: 'Test App' - script: | node-lambda deploy -a $(AWS_ACCESS_KEY) -s $(AWS_SECRET_KEY) -o $(AWS_ROLE) -r $(AWS_REGION) -n $(AWS_LAMBDA_FUNCTION_NAME) --excludeGlobs "azure-pipelines.yml" From 1b2b2bb4ed6b680bc383114ec72831c646c37234 Mon Sep 17 00:00:00 2001 From: zues23 Date: Sun, 7 Apr 2019 15:04:10 +0300 Subject: [PATCH 7/9] Update azure-pipelines.yml for Azure Pipelines [skip ci] --- azure-pipelines.yml | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8661344..854b3d2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -11,13 +11,44 @@ steps: npm install npm install node-lambda -g displayName: 'npm install' +#install dependencies +- script: | + chmod +x .devops/scripts/*.sh + ./.devops/scripts/install-dependencies1.sh + displayName: 'Install dependencies' - +#Test the build - script: | chmod +x .devops/scripts/*.sh zubes/.devops/scripts/test2.sh displayName: 'Test App' +#Create artifacts + +- script: | + chmod +x .devops/scripts/*.sh + ./.devops/scripts/artifacts3.sh + displayName: 'Create Artifacts' + +#Copy the serverless config files into the artifacts folder +- script: | + chmod +x .devops/scripts/*.sh + ./.devops/scripts/slconfig4.sh + displayName: 'Copy the serverless config files into the artifacts folder' + +#Build the React App +- script: | + chmod +x .devops/scripts/*.sh + ./.devops/scripts/build-reactapp7.sh + displayName: 'Build the React App' + + +#Deploy PIT2 API + +#Deploy PIT IMPORT + + +#Deploy React App - script: | node-lambda deploy -a $(AWS_ACCESS_KEY) -s $(AWS_SECRET_KEY) -o $(AWS_ROLE) -r $(AWS_REGION) -n $(AWS_LAMBDA_FUNCTION_NAME) --excludeGlobs "azure-pipelines.yml" displayName: 'Deploy to AWS' \ No newline at end of file From 6f6e65796cdf156b1d11838437d58029494fa962 Mon Sep 17 00:00:00 2001 From: zues23 Date: Sun, 7 Apr 2019 15:07:15 +0300 Subject: [PATCH 8/9] Update azure-pipelines.yml for Azure Pipelines [skip ci] --- azure-pipelines.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 854b3d2..8709e88 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -6,7 +6,13 @@ steps: inputs: versionSpec: '8.x' displayName: 'Install Node.js' - + +# install AWS CLI +- script: | + python -m pip install --upgrade pip==9.0.3 setuptools wheel + pip install awscli --user + displayName: 'Install tools' + - script: | npm install npm install node-lambda -g From ebd1aad46e1f38e472733df249013c58f11cef52 Mon Sep 17 00:00:00 2001 From: zues23 Date: Sun, 7 Apr 2019 15:20:20 +0300 Subject: [PATCH 9/9] Update azure-pipelines.yml for Azure Pipelines [skip ci] --- azure-pipelines.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8709e88..a473a0f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -17,6 +17,10 @@ steps: npm install npm install node-lambda -g displayName: 'npm install' +- script: | + cd install + ls -la + displayName: 'cd' #install dependencies - script: | chmod +x .devops/scripts/*.sh