Skip to content

Commit

Permalink
PT-7847: Fix update subscription number in the order details (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
Leysan Nigmatullina committed Aug 30, 2022
1 parent 64d26f2 commit 0ee7944
Show file tree
Hide file tree
Showing 8 changed files with 239 additions and 107 deletions.
99 changes: 60 additions & 39 deletions .github/workflows/main.yml → .github/workflows/module-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# v1.1.10
# v3.200.15
name: Module CI

on:
Expand Down Expand Up @@ -27,8 +27,10 @@ on:

jobs:
ci:
if: ${{ github.actor != 'dependabot[bot]' && (github.event.pull_request.head.repo.full_name == github.repository || github.event.pull_request.head.repo.full_name == '') }} # Check that PR not from forked repo and not from Dependabot
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' &&
(github.event.pull_request.head.repo.full_name == github.repository ||
github.event.pull_request.head.repo.full_name == '') }} # Check that PR not from forked repo and not from Dependabot
runs-on: ubuntu-20.04
env:
CLOUD_INSTANCE_BASE_URL: ${{secrets.CLOUD_INSTANCE_BASE_URL}}
CLIENT_ID: ${{secrets.CLIENT_ID}}
Expand All @@ -42,8 +44,9 @@ jobs:
RELEASE_STATUS: 'false'

outputs:
artifactUrl: ${{ steps.blobRelease.outputs.packageUrl }}
artifactUrl: ${{ steps.artifactUrl.outputs.download_url }}
jira-keys: ${{ steps.jira_keys.outputs.jira-keys }}
moduleId: ${{ steps.artifact_ver.outputs.moduleId }}

steps:

Expand All @@ -52,39 +55,30 @@ jobs:
run: |
echo "RELEASE_STATUS=true" >> $GITHUB_ENV
- name: Set up JDK 11 for dotnet-sonarscanner #Sonar stop accepting Java versions less than 11
uses: actions/setup-java@v1
with:
java-version: 1.11

- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'

- name: Install VirtoCommerce.GlobalTool
run: dotnet tool install --global VirtoCommerce.GlobalTool --version 2.1.0-alpha.17
uses: VirtoCommerce/vc-github-actions/setup-vcbuild@master

- name: Install dotnet-sonarscanner
run: dotnet tool install --global dotnet-sonarscanner

- name: Get changelog
- name: Get Changelog
id: changelog
uses: VirtoCommerce/vc-github-actions/changelog-generator@master

- name: Get Image Version
- name: Get Artifact Version
uses: VirtoCommerce/vc-github-actions/get-image-version@master
id: image
id: artifact_ver

- name: Set VERSION_SUFFIX variable
run: |
if [ '${{ github.event_name }}' = 'workflow_dispatch' ]; then
echo "VERSION_SUFFIX=${{ steps.image.outputs.fullSuffix }}" >> $GITHUB_ENV
echo "VERSION_SUFFIX=${{ steps.artifact_ver.outputs.fullSuffix }}" >> $GITHUB_ENV
else
echo "VERSION_SUFFIX=${{ steps.image.outputs.suffix }}" >> $GITHUB_ENV
echo "VERSION_SUFFIX=${{ steps.artifact_ver.outputs.suffix }}" >> $GITHUB_ENV
fi;
- name: Add version suffix
if: ${{ github.ref != 'refs/heads/master' }}
Expand Down Expand Up @@ -140,9 +134,19 @@ jobs:

- name: Publish Github Release
if: ${{ github.ref == 'refs/heads/master' }}
id: githubRelease
with:
changelog: ${{ steps.changelog.outputs.changelog }}
uses: VirtoCommerce/vc-github-actions/publish-github-release@master

- name: Set artifactUrl value
id: artifactUrl
run: |
if [ '${{ github.ref }}' = 'refs/heads/master' ]; then
echo ::set-output name=download_url::${{ steps.githubRelease.outputs.downloadUrl }}
else
echo ::set-output name=download_url::${{ steps.blobRelease.outputs.packageUrl }}
fi;
- name: Setup Git Credentials
if: ${{ (github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/master') && github.event_name != 'workflow_dispatch' }}
Expand All @@ -163,10 +167,10 @@ jobs:
githubToken: ${{ secrets.REPO_TOKEN }}
login: ${{ secrets.VIRTOCOMMERCE_APP_ID }}
password: ${{ secrets.VIRTOCOMMERCE_SECRET }}
moduleId: ${{ steps.image.outputs.moduleId }}
moduleDescription: ${{ steps.image.outputs.moduleDescription }}
projectUrl: ${{ steps.image.outputs.projectUrl }}
iconUrl: ${{ steps.image.outputs.iconUrl }}
moduleId: ${{ steps.artifact_ver.outputs.moduleId }}
moduleDescription: ${{ steps.artifact_ver.outputs.moduleDescription }}
projectUrl: ${{ steps.artifact_ver.outputs.projectUrl }}
iconUrl: ${{ steps.artifact_ver.outputs.iconUrl }}

- name: Parse Jira Keys from All Commits
uses: VirtoCommerce/vc-github-actions/get-jira-keys@master
Expand Down Expand Up @@ -203,15 +207,17 @@ jobs:
echo "Jira Upload Build Info response: ${{ steps.push_build_info_to_jira.outputs.response }}"
deploy:
if: ${{ github.event_name != 'pull_request' && github.event_name != 'workflow_dispatch' }}
if: ${{ (github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/master') && github.event_name == 'push' }}
needs: ci
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
env:
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
CLOUD_INSTANCE_BASE_URL: ${{secrets.CLOUD_INSTANCE_BASE_URL}}
CLIENT_ID: ${{secrets.CLIENT_ID}}
CLIENT_SECRET: ${{secrets.CLIENT_SECRET}}
DEPLOYMENT_ENV: 'dev'
SLEEP_TIME: '5m'
ARGO_SERVER: 'argo.govirto.com'

steps:
- name: Set DEPLOYMENT_ENV variable
Expand Down Expand Up @@ -245,20 +251,19 @@ jobs:
forceCommit: 'true'
cmPath: ${{ steps.deployConfig.outputs.cmPath }}

- name: Sleep for ${{ env.SLEEP_TIME }}
run: sleep ${{ env.SLEEP_TIME }}
shell: bash

- name: Wait for environment is up
shell: pwsh
timeout-minutes: 15
run: |
do {
Start-Sleep -s 15
$statusBage = (Invoke-WebRequest -Uri "https://argo.govirto.com/api/badge?name=${{ steps.deployConfig.outputs.deployAppName }}").Content
$syncedAndHealthy = $statusBage.Contains('>Healthy<') -and $statusBage.Contains('>Synced<')
if (-not $syncedAndHealthy) {
Write-Host "Sync pending..."
}
}
while (-not $syncedAndHealthy)
uses: VirtoCommerce/vc-github-actions/vc-argocd-cli@master
timeout-minutes: 10
id: argocd-cli
with:
server: ${{env.ARGO_SERVER}}
username: ${{ secrets.ARGOCD_LOGIN }}
password: ${{ secrets.ARGOCD_PASSWORD }}
command: app wait ${{ steps.deployConfig.outputs.deployAppName }}

- name: DEPLOY_STATE::successful
if: success()
Expand Down Expand Up @@ -303,3 +308,19 @@ jobs:
environment-id: ${{ steps.deployConfig.outputs.environmentId }}
environment-display-name: ${{ steps.deployConfig.outputs.environmentName }}
environment-type: ${{ steps.deployConfig.outputs.environmentType }}

module-katalon-tests:
if: ${{ github.event_name == 'pull_request' }}
needs: 'ci'
uses: VirtoCommerce/.github/.github/workflows/e2e.yml@main
with:
katalonRepo: 'VirtoCommerce/vc-quality-gate-katalon'
katalonRepoBranch: 'dev'
testSuite: 'Test Suites/Modules/Platform_collection'
installModules: 'true'
installCustomModule: 'true'
customModuleId: ${{ needs.ci.outputs.moduleId }}
customModuleUrl: ${{ needs.ci.outputs.artifactUrl }}
secrets:
envPAT: ${{ secrets.REPO_TOKEN }}
katalonApiKey: ${{ secrets.KATALON_API_KEY }}
78 changes: 78 additions & 0 deletions .github/workflows/module-release-hotfix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# v3.200.15
name: Release hotfix

on:
workflow_dispatch:
inputs:
incrementPatch:
description: 'Increment patch version.'
required: true
default: true
type: boolean

jobs:
test:
uses: VirtoCommerce/.github/.github/workflows/[email protected]
secrets:
sonarToken: ${{ secrets.SONAR_TOKEN }}

build:
uses: VirtoCommerce/.github/.github/workflows/[email protected]
with:
uploadPackage: 'true'
uploadDocker: 'false'
forceVersionSuffix: 'false'
incrementPatch: ${{ github.event.inputs.incrementPatch }}
secrets:
envPAT: ${{ secrets.REPO_TOKEN }}

get-metadata:
runs-on: ubuntu-20.04
outputs:
changelog: ${{ steps.changelog.outputs.changelog }}
steps:

- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Get Changelog
id: changelog
uses: VirtoCommerce/vc-github-actions/changelog-generator@master

publish-github-release:
needs:
[build, test, get-metadata]
uses: VirtoCommerce/.github/.github/workflows/[email protected]
with:
fullKey: ${{ needs.build.outputs.packageFullKey }}
changeLog: '${{ needs.get-metadata.outputs.changeLog }}'
incrementPatch: ${{ github.event.inputs.incrementPatch }}

secrets:
envPAT: ${{ secrets.GITHUB_TOKEN }}
nugetKey: ${{ secrets.NUGET_KEY }}

increment-version:
needs:
[publish-github-release]
if: ${{ github.event.inputs.incrementPatch == 'true' }}
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install VirtoCommerce.GlobalTool
uses: VirtoCommerce/vc-github-actions/setup-vcbuild@master

- name: Setup Git Credentials
uses: VirtoCommerce/vc-github-actions/setup-git-credentials-github@master
with:
githubToken: ${{ secrets.REPO_TOKEN }}

- name: Increment Version
run: |
vc-build IncrementPatch
git add Directory.Build.props *module.manifest
git commit -m "ci: Auto IncrementPatch"
git push
37 changes: 37 additions & 0 deletions .github/workflows/publish-nugets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# v3.200.15
name: Publish nuget

on:
workflow_dispatch:
inputs:
publishAlpha:
description: 'Publish nuget as alpha version.'
required: true
default: true
type: boolean

jobs:
test:
uses: VirtoCommerce/.github/.github/workflows/[email protected]
secrets:
sonarToken: ${{ secrets.SONAR_TOKEN }}

build:
uses: VirtoCommerce/.github/.github/workflows/[email protected]
with:
uploadPackage: 'true'
uploadDocker: 'false'
forceVersionSuffix: ${{ github.event.inputs.publishAlpha }}
secrets:
envPAT: ${{ secrets.REPO_TOKEN }}

publish-nuget:
needs:
[build, test]
uses: VirtoCommerce/.github/.github/workflows/[email protected]
with:
fullKey: ${{ needs.build.outputs.packageFullKey }}
forceGithub: false
secrets:
envPAT: ${{ secrets.GITHUB_TOKEN }}
nugetKey: ${{ secrets.NUGET_KEY }}
61 changes: 0 additions & 61 deletions .github/workflows/publish_nugets.yml

This file was deleted.

11 changes: 11 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# v3.200.15
name: Release

on:
workflow_dispatch:

jobs:
release:
uses: VirtoCommerce/.github/.github/workflows/[email protected]
secrets:
envPAT: ${{ secrets.REPO_TOKEN }}
Loading

0 comments on commit 0ee7944

Please sign in to comment.