From 12565a6aaac6008f6beb6ea4b0f2ccca14bc149a Mon Sep 17 00:00:00 2001 From: Nolan Arnold Date: Tue, 31 Mar 2020 11:34:11 -0500 Subject: [PATCH 01/26] build(daffio): moved daffio release pipeline into yaml --- .azure/azure-pipelines.yml | 150 +++++++++++++++++++++---------------- 1 file changed, 84 insertions(+), 66 deletions(-) diff --git a/.azure/azure-pipelines.yml b/.azure/azure-pipelines.yml index 4025994e06..0d30d9a0e9 100644 --- a/.azure/azure-pipelines.yml +++ b/.azure/azure-pipelines.yml @@ -12,83 +12,101 @@ pr: - develop variables: npm_config_cache: $(Pipeline.Workspace)/.npm -jobs: - - job: Lint - displayName: Lint - pool: - vmImage: "Ubuntu 16.04" - strategy: - matrix: - node_10_x: - node_version: 10.x - steps: - - task: NodeTool@0 - inputs: - versionSpec: $(node_version) - displayName: Set Node Version +stages: +- stage: Daffodil_CI + displayName: Daffodil CI + jobs: + - job: Lint + displayName: Lint + pool: + vmImage: "Ubuntu 16.04" + strategy: + matrix: + node_10_x: + node_version: 10.x + steps: + - task: NodeTool@0 + inputs: + versionSpec: $(node_version) + displayName: Set Node Version - - task: CacheBeta@0 - inputs: - key: $(Build.SourcesDirectory)/package-lock.json - path: $(npm_config_cache) - displayName: Cache npm + - task: CacheBeta@0 + inputs: + key: $(Build.SourcesDirectory)/package-lock.json + path: $(npm_config_cache) + displayName: Cache npm - - script: npx npm ci - displayName: Install Dependencies + - script: npx npm ci + displayName: Install Dependencies - - script: npx lerna run lint - displayName: Lint + - script: npx lerna run lint + displayName: Lint - - job: Build_And_Test - displayName: Build And Test - pool: - vmImage: "Ubuntu 16.04" - strategy: - matrix: - node_10_x: - node_version: 10.x - steps: - - task: NodeTool@0 - inputs: - versionSpec: $(node_version) - displayName: Set Node Version + - job: Build_And_Test + displayName: Build And Test + pool: + vmImage: "Ubuntu 16.04" + strategy: + matrix: + node_10_x: + node_version: 10.x + steps: + - task: NodeTool@0 + inputs: + versionSpec: $(node_version) + displayName: Set Node Version - - task: CacheBeta@0 - inputs: - key: $(Build.SourcesDirectory)/package-lock.json - path: $(npm_config_cache) - displayName: Cache npm + - task: CacheBeta@0 + inputs: + key: $(Build.SourcesDirectory)/package-lock.json + path: $(npm_config_cache) + displayName: Cache npm - - script: npm ci - displayName: Install Dependencies + - script: npm ci + displayName: Install Dependencies - - script: npx lerna run build && npx lerna run test - displayName: Build & Test + - script: npx lerna run build && npx lerna run test + displayName: Build & Test - - template: ./templates/codeclimate.yml + - template: ./templates/codeclimate.yml - - script: npx lerna run reportcoverage - displayName: Generate Coverage Report + - script: npx lerna run reportcoverage + displayName: Generate Coverage Report - - script: | - ./cc-test-reporter sum-coverage coverage/cc.*.json - ./cc-test-reporter -r $token upload-coverage - displayName: Report Code Climate - env: - token: $(CODECLIMATE_TOKEN_DAFFODIL) + - script: | + ./cc-test-reporter sum-coverage coverage/cc.*.json + ./cc-test-reporter -r $token upload-coverage + displayName: Report Code Climate + env: + token: $(CODECLIMATE_TOKEN_DAFFODIL) - - task: CopyFiles@2 - displayName: Prepare Artifact Staging Directory - inputs: - sourceFolder: dist - contents: '**/*' - targetFolder: $(Build.ArtifactStagingDirectory) + - task: CopyFiles@2 + displayName: Prepare Artifact Staging Directory + inputs: + sourceFolder: dist + contents: '**/*' + targetFolder: $(Build.ArtifactStagingDirectory) - - task: PublishBuildArtifacts@1 - displayName: "Publish Daff.io Serverless Artifact" + - task: PublishBuildArtifacts@1 + displayName: "Publish Daff.io Serverless Artifact" + inputs: + pathtoPublish: '$(Build.ArtifactStagingDirectory)/apps/daffio' + artifactName: 'daffio-serverless' + parallel: true + parallelCount: 8 +- stage: Deploy release + jobs: + - job: Deploy + steps: + - task: Npm@1 + displayName: 'Install Build Tools' inputs: - pathtoPublish: '$(Build.ArtifactStagingDirectory)/apps/daffio' - artifactName: 'daffio-serverless' - parallel: true - parallelCount: 8 + command: custom + verbose: false + customCommand: 'install now' + + - bash: 'npx now --scope="graycoreio" --token=$(NOW_DEPLOYMENT_TOKEN)' + workingDirectory: '$(System.DefaultWorkingDirectory)/_daff-ci/daffio-serverless' + displayName: 'Bash Script' + From e7921071e404a7bd3258c041c19b3ebf15535d60 Mon Sep 17 00:00:00 2001 From: Nolan Arnold Date: Tue, 31 Mar 2020 11:37:59 -0500 Subject: [PATCH 02/26] WIP --- .azure/azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure/azure-pipelines.yml b/.azure/azure-pipelines.yml index 0d30d9a0e9..aca188c0e4 100644 --- a/.azure/azure-pipelines.yml +++ b/.azure/azure-pipelines.yml @@ -94,7 +94,7 @@ stages: artifactName: 'daffio-serverless' parallel: true parallelCount: 8 -- stage: Deploy release +- stage: deploy_release jobs: - job: Deploy steps: From 8135d5c62a2aa5fa1a40f36d5fee498ec1990bc2 Mon Sep 17 00:00:00 2001 From: Nolan Arnold Date: Tue, 31 Mar 2020 11:53:13 -0500 Subject: [PATCH 03/26] WIP --- .azure/azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure/azure-pipelines.yml b/.azure/azure-pipelines.yml index aca188c0e4..46ae07a57f 100644 --- a/.azure/azure-pipelines.yml +++ b/.azure/azure-pipelines.yml @@ -106,7 +106,7 @@ stages: customCommand: 'install now' - bash: 'npx now --scope="graycoreio" --token=$(NOW_DEPLOYMENT_TOKEN)' - workingDirectory: '$(System.DefaultWorkingDirectory)/_daff-ci/daffio-serverless' + workingDirectory: '$(Build.ArtifactStagingDirectory)/apps/daffio' displayName: 'Bash Script' From 693a8847402f52156c7b3ca032c7ee043021fa5e Mon Sep 17 00:00:00 2001 From: Nolan Arnold Date: Tue, 31 Mar 2020 12:26:48 -0500 Subject: [PATCH 04/26] WIP --- .azure/azure-pipelines.yml | 37 ++++----------------------------- .azure/templates/setup-node.yml | 14 +++++++++++++ package-lock.json | 26 ++++++++++++++--------- package.json | 1 + 4 files changed, 35 insertions(+), 43 deletions(-) create mode 100644 .azure/templates/setup-node.yml diff --git a/.azure/azure-pipelines.yml b/.azure/azure-pipelines.yml index 46ae07a57f..52c1f829a6 100644 --- a/.azure/azure-pipelines.yml +++ b/.azure/azure-pipelines.yml @@ -25,19 +25,7 @@ stages: node_10_x: node_version: 10.x steps: - - task: NodeTool@0 - inputs: - versionSpec: $(node_version) - displayName: Set Node Version - - - task: CacheBeta@0 - inputs: - key: $(Build.SourcesDirectory)/package-lock.json - path: $(npm_config_cache) - displayName: Cache npm - - - script: npx npm ci - displayName: Install Dependencies + - template: ./templates/setup-node.yml - script: npx lerna run lint displayName: Lint @@ -51,19 +39,7 @@ stages: node_10_x: node_version: 10.x steps: - - task: NodeTool@0 - inputs: - versionSpec: $(node_version) - displayName: Set Node Version - - - task: CacheBeta@0 - inputs: - key: $(Build.SourcesDirectory)/package-lock.json - path: $(npm_config_cache) - displayName: Cache npm - - - script: npm ci - displayName: Install Dependencies + - template: ./templates/setup-node.yml - script: npx lerna run build && npx lerna run test displayName: Build & Test @@ -98,15 +74,10 @@ stages: jobs: - job: Deploy steps: - - task: Npm@1 - displayName: 'Install Build Tools' - inputs: - command: custom - verbose: false - customCommand: 'install now' + - template: ./templates/setup-node.yml - bash: 'npx now --scope="graycoreio" --token=$(NOW_DEPLOYMENT_TOKEN)' - workingDirectory: '$(Build.ArtifactStagingDirectory)/apps/daffio' + workingDirectory: '$()' displayName: 'Bash Script' diff --git a/.azure/templates/setup-node.yml b/.azure/templates/setup-node.yml new file mode 100644 index 0000000000..e5db02b770 --- /dev/null +++ b/.azure/templates/setup-node.yml @@ -0,0 +1,14 @@ +steps: + - task: NodeTool@0 + inputs: + versionSpec: $(node_version) + displayName: Set Node Version + + - task: Cache@2 + inputs: + key: $(Build.SourcesDirectory)/package-lock.json + path: $(npm_config_cache) + displayName: Cache npm + + - script: npx npm ci + displayName: Install Dependencies \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 78081fc4f1..645b967921 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8411,7 +8411,7 @@ }, "engine.io-client": { "version": "3.2.1", - "resolved": "http://registry.npmjs.org/engine.io-client/-/engine.io-client-3.2.1.tgz", + "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.2.1.tgz", "integrity": "sha512-y5AbkytWeM4jQr7m/koQLc5AxpRKC1hEVUb/s1FUAWEJq5AzJJ4NLvzuKPuxtDi5Mq755WuDvZ6Iv2rXj4PTzw==", "dev": true, "requires": { @@ -14656,6 +14656,12 @@ "sort-keys": "^1.0.0" } }, + "now": { + "version": "17.1.1", + "resolved": "https://registry.npmjs.org/now/-/now-17.1.1.tgz", + "integrity": "sha512-Hmh8eMSt4FxS1YBwaLrdJuzEVm6ZtS4JCY0AZE+JTnTtDGHVaQMUI85FaPvasSIhKLa+7xf6v7lmTgM39VW/8w==", + "dev": true + }, "now-and-later": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/now-and-later/-/now-and-later-2.0.1.tgz", @@ -17587,7 +17593,7 @@ "dependencies": { "jsesc": { "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "resolved": "http://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", "dev": true } @@ -19789,7 +19795,7 @@ }, "socket.io-parser": { "version": "3.2.0", - "resolved": "http://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.2.0.tgz", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.2.0.tgz", "integrity": "sha512-FYiBx7rc/KORMJlgsXysflWx/RIvtqZbyGLlHZvjfmPTPeuD/I8MaW7cfFrj5tRltICJdgwflhfZ3NVVbVLFQA==", "dev": true, "requires": { @@ -20182,19 +20188,19 @@ "dev": true, "requires": { "chalk": "2.4.2", - "conventional-changelog": "3.1.10", - "conventional-changelog-config-spec": "2.0.0", - "conventional-recommended-bump": "6.0.0", + "conventional-changelog": "3.1.15", + "conventional-changelog-config-spec": "2.1.0", + "conventional-recommended-bump": "6.0.5", "detect-indent": "6.0.0", "detect-newline": "3.0.0", "dotgitignore": "2.1.0", - "figures": "3.0.0", + "figures": "3.1.0", "find-up": "4.1.0", "fs-access": "1.0.1", - "git-semver-tags": "3.0.0", + "git-semver-tags": "3.0.1", "semver": "6.3.0", - "stringify-package": "1.0.0", - "yargs": "14.0.0" + "stringify-package": "1.0.1", + "yargs": "14.2.2" }, "dependencies": { "ansi-regex": { diff --git a/package.json b/package.json index e5323ca3a6..0512312bdd 100644 --- a/package.json +++ b/package.json @@ -81,6 +81,7 @@ "karma-jasmine-html-reporter": "^1.4.0", "lerna": "^3.14.1", "ng-packagr": "^5.2.0", + "now": "^17.1.1", "plugin-error": "^1.0.1", "prettier": "1.18.2", "protractor": "^5.4.2", From 8fcde5502a6718bf22004169a5f909b73a263730 Mon Sep 17 00:00:00 2001 From: Nolan Arnold Date: Tue, 31 Mar 2020 12:30:42 -0500 Subject: [PATCH 05/26] WIP --- .azure/azure-pipelines.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.azure/azure-pipelines.yml b/.azure/azure-pipelines.yml index 52c1f829a6..000c39bd1b 100644 --- a/.azure/azure-pipelines.yml +++ b/.azure/azure-pipelines.yml @@ -74,10 +74,13 @@ stages: jobs: - job: Deploy steps: + - task: DownloadBuildArtifacts@0 + artifactName: 'daffio-serverless' + - template: ./templates/setup-node.yml - bash: 'npx now --scope="graycoreio" --token=$(NOW_DEPLOYMENT_TOKEN)' - workingDirectory: '$()' + workingDirectory: '$(System.ArtifactsDirectory)/daffio-serverless' displayName: 'Bash Script' From 076384c5462653378d5ca9ecc85ca32fad30c8d3 Mon Sep 17 00:00:00 2001 From: Nolan Arnold Date: Tue, 31 Mar 2020 13:58:37 -0500 Subject: [PATCH 06/26] WIP --- .azure/azure-pipelines.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.azure/azure-pipelines.yml b/.azure/azure-pipelines.yml index 000c39bd1b..d53fa21db1 100644 --- a/.azure/azure-pipelines.yml +++ b/.azure/azure-pipelines.yml @@ -75,7 +75,6 @@ stages: - job: Deploy steps: - task: DownloadBuildArtifacts@0 - artifactName: 'daffio-serverless' - template: ./templates/setup-node.yml From 7226e4aa7fbb21e62efbcc9c2129e5cadee05120 Mon Sep 17 00:00:00 2001 From: Nolan Arnold Date: Tue, 31 Mar 2020 20:24:10 -0500 Subject: [PATCH 07/26] TMP --- .azure/azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.azure/azure-pipelines.yml b/.azure/azure-pipelines.yml index d53fa21db1..000c39bd1b 100644 --- a/.azure/azure-pipelines.yml +++ b/.azure/azure-pipelines.yml @@ -75,6 +75,7 @@ stages: - job: Deploy steps: - task: DownloadBuildArtifacts@0 + artifactName: 'daffio-serverless' - template: ./templates/setup-node.yml From 984a25386299621cca9be8b2a8cee69d1046e563 Mon Sep 17 00:00:00 2001 From: Nolan Arnold Date: Tue, 31 Mar 2020 20:26:14 -0500 Subject: [PATCH 08/26] TMP --- .azure/azure-pipelines.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.azure/azure-pipelines.yml b/.azure/azure-pipelines.yml index 000c39bd1b..372d685578 100644 --- a/.azure/azure-pipelines.yml +++ b/.azure/azure-pipelines.yml @@ -75,7 +75,8 @@ stages: - job: Deploy steps: - task: DownloadBuildArtifacts@0 - artifactName: 'daffio-serverless' + inputs: + artifactName: 'daffio-serverless' - template: ./templates/setup-node.yml From ef6df7ca360e34a5e6d70da479aab8c18c1bd670 Mon Sep 17 00:00:00 2001 From: Nolan Arnold Date: Tue, 31 Mar 2020 20:45:31 -0500 Subject: [PATCH 09/26] TMP --- .azure/azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure/azure-pipelines.yml b/.azure/azure-pipelines.yml index 372d685578..c6c7c93fef 100644 --- a/.azure/azure-pipelines.yml +++ b/.azure/azure-pipelines.yml @@ -41,7 +41,7 @@ stages: steps: - template: ./templates/setup-node.yml - - script: npx lerna run build && npx lerna run test + - script: npx lerna run build displayName: Build & Test - template: ./templates/codeclimate.yml From 70a6a2f914f9f09705c08773b470e72e41d3c484 Mon Sep 17 00:00:00 2001 From: Nolan Arnold Date: Tue, 31 Mar 2020 20:53:09 -0500 Subject: [PATCH 10/26] TMP --- .azure/azure-pipelines.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.azure/azure-pipelines.yml b/.azure/azure-pipelines.yml index c6c7c93fef..aab9eb2f5b 100644 --- a/.azure/azure-pipelines.yml +++ b/.azure/azure-pipelines.yml @@ -41,7 +41,7 @@ stages: steps: - template: ./templates/setup-node.yml - - script: npx lerna run build + - script: npx lerna run build && npx lerna run test displayName: Build & Test - template: ./templates/codeclimate.yml @@ -74,12 +74,12 @@ stages: jobs: - job: Deploy steps: + - template: ./templates/setup-node.yml + - task: DownloadBuildArtifacts@0 inputs: artifactName: 'daffio-serverless' - - template: ./templates/setup-node.yml - - bash: 'npx now --scope="graycoreio" --token=$(NOW_DEPLOYMENT_TOKEN)' workingDirectory: '$(System.ArtifactsDirectory)/daffio-serverless' displayName: 'Bash Script' From 0e0a5e09bd5615586166b125aa27c19d5ef340a4 Mon Sep 17 00:00:00 2001 From: Nolan Arnold Date: Tue, 31 Mar 2020 21:06:50 -0500 Subject: [PATCH 11/26] TMP --- .azure/azure-pipelines.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.azure/azure-pipelines.yml b/.azure/azure-pipelines.yml index aab9eb2f5b..b5b64f5157 100644 --- a/.azure/azure-pipelines.yml +++ b/.azure/azure-pipelines.yml @@ -73,6 +73,12 @@ stages: - stage: deploy_release jobs: - job: Deploy + pool: + vmImage: "Ubuntu 16.04" + strategy: + matrix: + node_10_x: + node_version: 10.x steps: - template: ./templates/setup-node.yml From e902026a15112dafe990e945276a4751b36eaba0 Mon Sep 17 00:00:00 2001 From: Nolan Arnold Date: Wed, 1 Apr 2020 14:16:25 -0500 Subject: [PATCH 12/26] WIP --- .azure/azure-pipelines.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.azure/azure-pipelines.yml b/.azure/azure-pipelines.yml index b5b64f5157..e99189afb7 100644 --- a/.azure/azure-pipelines.yml +++ b/.azure/azure-pipelines.yml @@ -12,6 +12,7 @@ pr: - develop variables: npm_config_cache: $(Pipeline.Workspace)/.npm + stages: - stage: Daffodil_CI displayName: Daffodil CI @@ -86,7 +87,7 @@ stages: inputs: artifactName: 'daffio-serverless' - - bash: 'npx now --scope="graycoreio" --token=$(NOW_DEPLOYMENT_TOKEN)' + - bash: 'npx now --scope="graycoreio" --token=$NOW_DEPLOYMENT_TOKEN' workingDirectory: '$(System.ArtifactsDirectory)/daffio-serverless' displayName: 'Bash Script' From fdeb36fc55de32fbc58d27945104a941647f9926 Mon Sep 17 00:00:00 2001 From: Nolan Arnold Date: Wed, 1 Apr 2020 14:36:30 -0500 Subject: [PATCH 13/26] WIP --- .azure/azure-pipelines.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.azure/azure-pipelines.yml b/.azure/azure-pipelines.yml index e99189afb7..b37cdf58b3 100644 --- a/.azure/azure-pipelines.yml +++ b/.azure/azure-pipelines.yml @@ -87,8 +87,18 @@ stages: inputs: artifactName: 'daffio-serverless' - - bash: 'npx now --scope="graycoreio" --token=$NOW_DEPLOYMENT_TOKEN' + - bash: 'npx now --scope="graycoreio" --token=$token' workingDirectory: '$(System.ArtifactsDirectory)/daffio-serverless' displayName: 'Bash Script' - + env: + token: $(NOW_DEPLOYMENT_TOKEN) + steps: + - script: | + mkdir -p ~/.composer + touch ~/.composer/auth.json + echo "{\"http-basic\":{\"repo.magento.com\":{\"username\":\"$username\",\"password\":\"$password\"}}}" > ~/.composer/auth.json + displayName: Setup Magento 2 Composer Authentication + env: + username: $(MAGENTO_REPO_USERNAME) + password: $(MAGENTO_REPO_PASSWORD) From 3e926692e9f0acee21d590de76ba3e877fc1c053 Mon Sep 17 00:00:00 2001 From: Nolan Arnold Date: Wed, 1 Apr 2020 14:36:45 -0500 Subject: [PATCH 14/26] WIP --- .azure/azure-pipelines.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.azure/azure-pipelines.yml b/.azure/azure-pipelines.yml index b37cdf58b3..8556f65267 100644 --- a/.azure/azure-pipelines.yml +++ b/.azure/azure-pipelines.yml @@ -92,13 +92,5 @@ stages: displayName: 'Bash Script' env: token: $(NOW_DEPLOYMENT_TOKEN) - steps: - - script: | - mkdir -p ~/.composer - touch ~/.composer/auth.json - echo "{\"http-basic\":{\"repo.magento.com\":{\"username\":\"$username\",\"password\":\"$password\"}}}" > ~/.composer/auth.json - displayName: Setup Magento 2 Composer Authentication - env: - username: $(MAGENTO_REPO_USERNAME) - password: $(MAGENTO_REPO_PASSWORD) + From 42e7a7ef5a1e5902b33d69bd777bf4af9b41781b Mon Sep 17 00:00:00 2001 From: Nolan Arnold Date: Wed, 1 Apr 2020 14:55:35 -0500 Subject: [PATCH 15/26] WIP --- .azure/azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure/azure-pipelines.yml b/.azure/azure-pipelines.yml index 8556f65267..3242bed73f 100644 --- a/.azure/azure-pipelines.yml +++ b/.azure/azure-pipelines.yml @@ -87,7 +87,7 @@ stages: inputs: artifactName: 'daffio-serverless' - - bash: 'npx now --scope="graycoreio" --token=$token' + - bash: 'npx now --scope="graycoreio" --token=$env:token' workingDirectory: '$(System.ArtifactsDirectory)/daffio-serverless' displayName: 'Bash Script' env: From 07f79de62d361c8d2498dc7be8779d27236bb6e4 Mon Sep 17 00:00:00 2001 From: Nolan Arnold Date: Wed, 1 Apr 2020 15:11:05 -0500 Subject: [PATCH 16/26] WIP --- .azure/azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure/azure-pipelines.yml b/.azure/azure-pipelines.yml index 3242bed73f..cca2c49796 100644 --- a/.azure/azure-pipelines.yml +++ b/.azure/azure-pipelines.yml @@ -87,7 +87,7 @@ stages: inputs: artifactName: 'daffio-serverless' - - bash: 'npx now --scope="graycoreio" --token=$env:token' + - bash: 'npx now --scope="graycoreio" --token=$(token)' workingDirectory: '$(System.ArtifactsDirectory)/daffio-serverless' displayName: 'Bash Script' env: From 0110f7c8a42a5febc083e2f40e424957f7c6e382 Mon Sep 17 00:00:00 2001 From: Nolan Arnold Date: Wed, 1 Apr 2020 17:38:16 -0500 Subject: [PATCH 17/26] WIP --- .azure/azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.azure/azure-pipelines.yml b/.azure/azure-pipelines.yml index cca2c49796..b31fe54941 100644 --- a/.azure/azure-pipelines.yml +++ b/.azure/azure-pipelines.yml @@ -11,6 +11,7 @@ pr: - master - develop variables: + - group: now-deployment-token npm_config_cache: $(Pipeline.Workspace)/.npm stages: From c2ef4e61089c4a999f154d35655462f9bf75d96f Mon Sep 17 00:00:00 2001 From: Nolan Arnold Date: Wed, 1 Apr 2020 17:46:03 -0500 Subject: [PATCH 18/26] WIP --- .azure/azure-pipelines.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.azure/azure-pipelines.yml b/.azure/azure-pipelines.yml index b31fe54941..e85bf9c48c 100644 --- a/.azure/azure-pipelines.yml +++ b/.azure/azure-pipelines.yml @@ -11,7 +11,6 @@ pr: - master - develop variables: - - group: now-deployment-token npm_config_cache: $(Pipeline.Workspace)/.npm stages: @@ -74,6 +73,8 @@ stages: parallelCount: 8 - stage: deploy_release jobs: + variables: + - group: now-deployment-token - job: Deploy pool: vmImage: "Ubuntu 16.04" From b9f26a931b1acbe117b3b8d5ee2c7c3eb04eff6f Mon Sep 17 00:00:00 2001 From: Nolan Arnold Date: Wed, 1 Apr 2020 17:48:55 -0500 Subject: [PATCH 19/26] WIP --- .azure/azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure/azure-pipelines.yml b/.azure/azure-pipelines.yml index e85bf9c48c..083a8b88ca 100644 --- a/.azure/azure-pipelines.yml +++ b/.azure/azure-pipelines.yml @@ -73,9 +73,9 @@ stages: parallelCount: 8 - stage: deploy_release jobs: - variables: - - group: now-deployment-token - job: Deploy + variables: + - group: now-deployment-token pool: vmImage: "Ubuntu 16.04" strategy: From 7ff6e2150f4d77a992c0616bb5fa7e0f2b5c63d0 Mon Sep 17 00:00:00 2001 From: Damien Retzinger Date: Thu, 2 Apr 2020 09:26:58 -0400 Subject: [PATCH 20/26] tmp --- .azure/azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure/azure-pipelines.yml b/.azure/azure-pipelines.yml index 083a8b88ca..bf8affb5b1 100644 --- a/.azure/azure-pipelines.yml +++ b/.azure/azure-pipelines.yml @@ -89,9 +89,9 @@ stages: inputs: artifactName: 'daffio-serverless' - - bash: 'npx now --scope="graycoreio" --token=$(token)' + - script: npx now --scope="graycoreio" --token=$(token) workingDirectory: '$(System.ArtifactsDirectory)/daffio-serverless' - displayName: 'Bash Script' + displayName: 'Deploy to Now' env: token: $(NOW_DEPLOYMENT_TOKEN) From 039ee62b00140b6ecb4dc08a80c3bbc2c187e791 Mon Sep 17 00:00:00 2001 From: Damien Retzinger Date: Thu, 2 Apr 2020 09:43:56 -0400 Subject: [PATCH 21/26] tmp --- .azure/azure-pipelines.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.azure/azure-pipelines.yml b/.azure/azure-pipelines.yml index bf8affb5b1..395bb93879 100644 --- a/.azure/azure-pipelines.yml +++ b/.azure/azure-pipelines.yml @@ -72,8 +72,10 @@ stages: parallel: true parallelCount: 8 - stage: deploy_release + displayName: Preview Environment jobs: - - job: Deploy + - job: deploy_preview + displayName: Deploy Serverless Preview variables: - group: now-deployment-token pool: @@ -89,7 +91,7 @@ stages: inputs: artifactName: 'daffio-serverless' - - script: npx now --scope="graycoreio" --token=$(token) + - script: npx now --scope="graycoreio" --token=$token workingDirectory: '$(System.ArtifactsDirectory)/daffio-serverless' displayName: 'Deploy to Now' env: From 67ea4a224fc01b5691fb210ba61cba4333452bcb Mon Sep 17 00:00:00 2001 From: Damien Retzinger Date: Fri, 3 Apr 2020 11:31:46 -0400 Subject: [PATCH 22/26] ci(daffio): adds preview deployments via now --- .azure/azure-pipelines.yml | 24 +++++++++--------------- .azure/templates/now-deployment.yml | 29 +++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 15 deletions(-) create mode 100644 .azure/templates/now-deployment.yml diff --git a/.azure/azure-pipelines.yml b/.azure/azure-pipelines.yml index 395bb93879..71df9b67b5 100644 --- a/.azure/azure-pipelines.yml +++ b/.azure/azure-pipelines.yml @@ -71,30 +71,24 @@ stages: artifactName: 'daffio-serverless' parallel: true parallelCount: 8 -- stage: deploy_release - displayName: Preview Environment +- stage: preview + displayName: Daff.io Preview Environment jobs: - job: deploy_preview - displayName: Deploy Serverless Preview + displayName: Deploy + condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest')) variables: - group: now-deployment-token - pool: - vmImage: "Ubuntu 16.04" strategy: matrix: node_10_x: node_version: 10.x steps: - - template: ./templates/setup-node.yml - - - task: DownloadBuildArtifacts@0 - inputs: - artifactName: 'daffio-serverless' - - - script: npx now --scope="graycoreio" --token=$token - workingDirectory: '$(System.ArtifactsDirectory)/daffio-serverless' - displayName: 'Deploy to Now' - env: + - template: ./templates/now-deployment.yml + parameters: + artifactName: daffio-serverless token: $(NOW_DEPLOYMENT_TOKEN) + nowOrg: $(NOW_PREVIEW_ORG) + nowProjectId: $(NOW_PREVIEW_PROJECT_ID) diff --git a/.azure/templates/now-deployment.yml b/.azure/templates/now-deployment.yml new file mode 100644 index 0000000000..0785d67cbb --- /dev/null +++ b/.azure/templates/now-deployment.yml @@ -0,0 +1,29 @@ +# File: simple-param.yml +parameters: +- name: 'artifactName' + type: string + default: false +- name: 'token' + type: string + default: false +- name: 'nowOrg' + type: string + default: false +- name: 'nowProjectId' + type: string + default: false + +steps: + - template: ./setup-node.yml + + - task: DownloadBuildArtifacts@0 + inputs: + artifactName: '${{ parameters.artifactName }}' + + - script: NOW_ORG_ID=$org NOW_PROJECT_ID=$projectId npx now --token=$token + workingDirectory: '$(System.ArtifactsDirectory)/${{ parameters.artifactName }}' + displayName: 'Deploy ${{ parameters.artifactName }} to Now' + env: + token: ${{ parameters.token }} + org: ${{ parameters.nowOrg }} + projectId: ${{ parameters.nowProjectId }} \ No newline at end of file From d48cacdc307ca29047ef0c09bf7a492ecc0e547c Mon Sep 17 00:00:00 2001 From: Damien Retzinger Date: Mon, 6 Apr 2020 11:48:11 -0400 Subject: [PATCH 23/26] tmp --- .azure/azure-pipelines.yml | 56 ++++++++++++++++++++++++++------------ 1 file changed, 39 insertions(+), 17 deletions(-) diff --git a/.azure/azure-pipelines.yml b/.azure/azure-pipelines.yml index 71df9b67b5..fb5dd75ce2 100644 --- a/.azure/azure-pipelines.yml +++ b/.azure/azure-pipelines.yml @@ -72,23 +72,45 @@ stages: parallel: true parallelCount: 8 - stage: preview - displayName: Daff.io Preview Environment + displayName: Preview Environment jobs: - - job: deploy_preview - displayName: Deploy - condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest')) - variables: - - group: now-deployment-token - strategy: - matrix: - node_10_x: - node_version: 10.x - steps: - - template: ./templates/now-deployment.yml - parameters: - artifactName: daffio-serverless - token: $(NOW_DEPLOYMENT_TOKEN) - nowOrg: $(NOW_PREVIEW_ORG) - nowProjectId: $(NOW_PREVIEW_PROJECT_ID) + - job: deploy_daffio_preview + displayName: Deploy Daff.io + condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest')) + variables: + - group: daffio-now + - group: daffio-preview-now + strategy: + matrix: + node_10_x: + node_version: 10.x + steps: + - template: ./templates/now-deployment.yml + parameters: + artifactName: daffio-serverless + token: $(NOW_DEPLOYMENT_TOKEN) + nowOrg: $(NOW_ORG) + nowProjectId: $(DAFFIO_PREVIEW_NOW_PROJECTID) +- stage: next + displayName: Daff.io Next Environment + jobs: + - job: deploy_next + displayName: Deploy + condition: and(succeeded(), eq(variables['build.sourceBranch'], 'refs/heads/develop')) + variables: + - group: daffio-now + - group: daffio-next-now + strategy: + matrix: + node_10_x: + node_version: 10.x + steps: + - template: ./templates/now-deployment.yml + parameters: + artifactName: daffio-serverless + token: $(NOW_DEPLOYMENT_TOKEN) + nowOrg: $(NOW_ORG) + nowProjectId: $(DAFFIO_NEXT_NOW_PROJECTID) + From 96c07fa7eddca6780d36c0cc187b0a4cdd693496 Mon Sep 17 00:00:00 2001 From: Damien Retzinger Date: Wed, 8 Apr 2020 15:24:10 -0400 Subject: [PATCH 24/26] tmp --- .azure/azure-pipelines.yml | 10 ++-------- .azure/templates/now-deployment.yml | 2 -- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/.azure/azure-pipelines.yml b/.azure/azure-pipelines.yml index fb5dd75ce2..742e3b74c7 100644 --- a/.azure/azure-pipelines.yml +++ b/.azure/azure-pipelines.yml @@ -80,11 +80,8 @@ stages: variables: - group: daffio-now - group: daffio-preview-now - strategy: - matrix: - node_10_x: - node_version: 10.x steps: + - template: ./setup-node.yml - template: ./templates/now-deployment.yml parameters: artifactName: daffio-serverless @@ -100,11 +97,8 @@ stages: variables: - group: daffio-now - group: daffio-next-now - strategy: - matrix: - node_10_x: - node_version: 10.x steps: + - template: ./setup-node.yml - template: ./templates/now-deployment.yml parameters: artifactName: daffio-serverless diff --git a/.azure/templates/now-deployment.yml b/.azure/templates/now-deployment.yml index 0785d67cbb..fa658e9922 100644 --- a/.azure/templates/now-deployment.yml +++ b/.azure/templates/now-deployment.yml @@ -14,8 +14,6 @@ parameters: default: false steps: - - template: ./setup-node.yml - - task: DownloadBuildArtifacts@0 inputs: artifactName: '${{ parameters.artifactName }}' From 107757f8204dc0578db75a61eb5cb98a41ec4210 Mon Sep 17 00:00:00 2001 From: Damien Retzinger Date: Wed, 8 Apr 2020 15:25:27 -0400 Subject: [PATCH 25/26] tmp --- .azure/azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure/azure-pipelines.yml b/.azure/azure-pipelines.yml index 742e3b74c7..1c24397bc1 100644 --- a/.azure/azure-pipelines.yml +++ b/.azure/azure-pipelines.yml @@ -81,7 +81,7 @@ stages: - group: daffio-now - group: daffio-preview-now steps: - - template: ./setup-node.yml + - template: ./templates/setup-node.yml - template: ./templates/now-deployment.yml parameters: artifactName: daffio-serverless @@ -98,7 +98,7 @@ stages: - group: daffio-now - group: daffio-next-now steps: - - template: ./setup-node.yml + - template: ./templates/setup-node.yml - template: ./templates/now-deployment.yml parameters: artifactName: daffio-serverless From f6aa6d5ad62b22eb0587393e22b8043863eb1248 Mon Sep 17 00:00:00 2001 From: Damien Retzinger Date: Wed, 8 Apr 2020 15:43:36 -0400 Subject: [PATCH 26/26] set global node version --- .azure/azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.azure/azure-pipelines.yml b/.azure/azure-pipelines.yml index 1c24397bc1..ae9e0bc019 100644 --- a/.azure/azure-pipelines.yml +++ b/.azure/azure-pipelines.yml @@ -12,6 +12,7 @@ pr: - develop variables: npm_config_cache: $(Pipeline.Workspace)/.npm + node_version: 10.x stages: - stage: Daffodil_CI