From 918b16319a6e18424684e9bf3dbe45e8c85ee715 Mon Sep 17 00:00:00 2001 From: alfredo-pozo <47230272+alfredo-pozo@users.noreply.github.com> Date: Sun, 4 Oct 2020 18:54:53 -0500 Subject: [PATCH] Addition of files to have CI7CD piepline for prod environment (#35) --- Jenkinsfile | 4 +++ cicd/DownloadCICDResources.ps1 | 29 +++++++++++++++++++ pipeline.yml | 52 ++++++++++++++++++++++++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 Jenkinsfile create mode 100644 cicd/DownloadCICDResources.ps1 create mode 100644 pipeline.yml diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..3aa45e9 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,4 @@ +@Library('PSL@master') +@Library('CILibrary@CBP/stable') _ + +StartPipeline() diff --git a/cicd/DownloadCICDResources.ps1 b/cicd/DownloadCICDResources.ps1 new file mode 100644 index 0000000..74418d1 --- /dev/null +++ b/cicd/DownloadCICDResources.ps1 @@ -0,0 +1,29 @@ +<# + Purpose: Pull of the source from git +#> +$ErrorActionPreference = "Stop" + +try { + + #Redirecting GIT output + $env:GIT_REDIRECT_STDERR = '2>&1' + + if ([string]::IsNullOrWhiteSpace($env:URL_REPO_TOOLS) -or [string]::IsNullOrWhiteSpace($env:BRANCH_TOOLS)) + { + throw "The tool repository parameters had not been set properly" + } + else + { + git clone -b $env:BRANCH_TOOLS "$env:URL_REPO_TOOLS" "$env:WORKSPACE\$env:COMMON_RESOURCES_DIR" + + if($LASTEXITCODE -ne 0) + { + throw "The download of the resources failed" + } + } + +} +catch { + Write-Host $error[0] + throw $LASTEXITCODE +} diff --git a/pipeline.yml b/pipeline.yml new file mode 100644 index 0000000..0cfed1c --- /dev/null +++ b/pipeline.yml @@ -0,0 +1,52 @@ +version: 0.1.1 +env: + - JENKINS_NODE_WIN: "Dynamo_Win_003" + - SLACK_QUANTUM_BUILD_CHANNEL : "#dynamo-jenkinsbuild" + - SLACK_QUANTUM_BUILD_CREDENTIAL_ID : "slack-notify-token" + - MAIL_QUANTUM_BUILD_RECIPIENT : "dynamo.plaid.dev@autodesk.com" + - DOCKER_IMAGE_VERSION : "1.0.7" + - BUCKETNAME : "dictionary.dynamobim.com" + - DISTRIBUTIONID : "E29G935QNLRDFJ" + - DOCKER_WORKSPACE : "C:\\Workspace" + - COMMON_RESOURCES_DIR : "cicdresources" + - DOCKER_CONTAINER : "build-dictionary" + - URL_REPO_TOOLS : "https://github.com/DynamoDS/DynamoDictionary.git" + - BRANCH_TOOLS : "cicdresources" + +timeout: 420 +check_changelog_updated_on_pr: false +pipeline_os: "Windows" +force_slack_notification : true + +schedule: + cron_schedule: "once_a_month" + +build: + - + scripts: + - "pwsh.exe -ExecutionPolicy ByPass -File .\\cicd\\DownloadCICDResources.ps1" + - "pwsh.exe -ExecutionPolicy ByPass -File .\\%COMMON_RESOURCES_DIR%\\scripts\\SetupHost.ps1" + - "pwsh.exe -ExecutionPolicy ByPass -File .\\%COMMON_RESOURCES_DIR%\\scripts\\StartContainer.ps1" + - "pwsh.exe -ExecutionPolicy ByPass -File .\\%COMMON_RESOURCES_DIR%\\scripts\\DockerBuild.ps1" + +code_analysis: + sonarqube: + skip: true +soc2: + run_on_any_branch : true + white_source: + skip: false + fail_on_audit_failure: true + team: Dynamo + project_name: "DynamoDictionary" + hidden_email_list: dynamo_ws_access + third_party_lib_paths: + - "node_modules" + +deployment: + - + type: customized + scripts: + - "pwsh.exe -ExecutionPolicy ByPass -File .\\%COMMON_RESOURCES_DIR%\\scripts\\DockerVaultLogin.ps1" + - "pwsh.exe -ExecutionPolicy ByPass -File .\\%COMMON_RESOURCES_DIR%\\scripts\\DockerDeploy.ps1" + - "pwsh.exe -ExecutionPolicy ByPass -File .\\%COMMON_RESOURCES_DIR%\\scripts\\PostDeploy.ps1" \ No newline at end of file