Skip to content

Commit

Permalink
VCST-87: Merge pull request #1 from VirtoCommerce/feat/VCST-87-net8-u…
Browse files Browse the repository at this point in the history
…pdate

feat: update to net8
  • Loading branch information
OlegoO committed Jan 18, 2024
2 parents c90762b + c6b400e commit 81b71ac
Show file tree
Hide file tree
Showing 13 changed files with 459 additions and 56 deletions.
6 changes: 6 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## Description

## References
### QA-test:
### Jira-link:
### Artifact URL:
44 changes: 44 additions & 0 deletions .github/workflows/deploy-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# v1.0

name: Deploy to environments
on:
pull_request:
paths-ignore:
- '.github/**'
- 'docs/**'
- 'build/**'
- 'README.md'
- 'LICENSE'
- '**/argoDeploy.json'
branches: [dev]
types: [labeled, closed]

jobs:
deploy:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}

steps:
- name: Read deployment config
if: contains(github.event.pull_request.labels.*.name, 'deploy-qa')
uses: VirtoCommerce/vc-github-actions/get-deploy-param@master
id: deployConfig

- name: Gets artifact link
if: contains(github.event.pull_request.labels.*.name, 'deploy-qa')
uses: VirtoCommerce/vc-github-actions/get-artifact-link@master
id: artifactLink
with:
downloadComment: 'Artifact URL:'

- name: Create deploy PR in QA
if: github.event.action != 'closed' && contains(github.event.pull_request.labels.*.name, 'deploy-qa')
uses: VirtoCommerce/vc-github-actions/create-deploy-pr@master
with:
deployRepo: ${{ steps.deployConfig.outputs.deployRepo }}
deployBranch: ${{ fromJSON(steps.deployConfig.outputs.deployConfig).qa.deployBranch }}
artifactKey: ${{ steps.deployConfig.outputs.artifactKey }}
artifactUrl: ${{ steps.artifactLink.outputs.artifactUrl }}
taskNumber: ${{ steps.artifactLink.outputs.qaTaskNumber }}
cmPath: ${{ steps.deployConfig.outputs.cmPath }}
78 changes: 78 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# v1.0

name: VC deployment
on:
workflow_dispatch:
inputs:
artifactUrl:
description: 'Full link to artifact docker image or artifact download url'
required: true
deployBranch:
description: 'ArgoCd branch name'
required: true
default: 'dev'

jobs:
cd:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}

steps:

- name: Read deployment config
uses: VirtoCommerce/vc-github-actions/get-deploy-param@master
id: deployConfig
with:
envName: ${{ github.event.inputs.deployBranch }}

- name: Start deployment
uses: bobheadxi/deployments@master
id: deployment
with:
step: start
token: ${{ secrets.GITHUB_TOKEN }}
env: Development
no_override: false

- name: Update deployment-cm
uses: VirtoCommerce/vc-github-actions/create-deploy-pr@master
with:
deployRepo: ${{ steps.deployConfig.outputs.deployRepo }}
deployBranch: ${{ steps.deployConfig.outputs.deployBranch }}
artifactKey: ${{ steps.deployConfig.outputs.artifactKey }}
artifactUrl: ${{ github.event.inputs.artifactUrl }}
taskNumber: "undefined"
forceCommit: "true"
cmPath: ${{ steps.deployConfig.outputs.cmPath }}

- 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)
- name: BUILD_STATE::successful
if: success()
run: echo "BUILD_STATE=successful" >> $GITHUB_ENV

- name: BUILD_STATE::failed
if: failure()
run: echo "BUILD_STATE=failed" >> $GITHUB_ENV

- name: Update GitHub deployment status
uses: bobheadxi/deployments@master
if: always()
with:
step: finish
token: ${{ secrets.GITHUB_TOKEN }}
status: ${{ job.status }}
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
133 changes: 103 additions & 30 deletions .github/workflows/module.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.36
name: Module CI

on:
Expand All @@ -11,6 +11,7 @@ on:
- 'README.md'
- 'LICENSE'
- '**/argoDeploy.json'
- '**/cloudDeploy.json'
- samples/**
branches:
[master, dev]
Expand All @@ -23,12 +24,15 @@ on:
- 'README.md'
- 'LICENSE'
- '**/argoDeploy.json'
- '**/cloudDeploy.json'
- samples/**

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,22 +46,33 @@ jobs:
RELEASE_STATUS: 'false'

outputs:
artifactUrl: ${{ steps.blobRelease.outputs.packageUrl }}
artifactUrl: ${{ steps.artifactUrl.outputs.download_url }}
blobId: ${{ steps.blobRelease.outputs.blobId }}
jira-keys: ${{ steps.jira_keys.outputs.jira-keys }}
version: ${{ steps.artifact_ver.outputs.shortVersion }}
moduleId: ${{ steps.artifact_ver.outputs.moduleId }}
matrix: ${{ steps.deployment-matrix.outputs.matrix }}
run-e2e: ${{ steps.run-e2e.outputs.result }}

steps:

- name: Set up Node 18
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Set up Java 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'

- name: Set RELEASE_STATUS
if: ${{ github.ref == 'refs/heads/master' && github.event_name == 'push' }}
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

Expand All @@ -67,20 +82,20 @@ jobs:
- 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 All @@ -90,6 +105,9 @@ jobs:

- name: SonarCloud Begin
uses: VirtoCommerce/vc-github-actions/sonar-scanner-begin@master
with:
repoOrg: ${{ github.repository_owner }}
sonarOrg: ${{secrets.SONAR_ORG_KEY}}

- name: Build
run: vc-build Compile
Expand All @@ -113,17 +131,19 @@ jobs:
uses: VirtoCommerce/vc-github-actions/publish-nuget@master

- name: Publish to Blob
if: ${{ github.ref == 'refs/heads/dev' || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/master') }}
if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev' || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/master') }}
id: blobRelease
uses: VirtoCommerce/vc-github-actions/publish-blob-release@master
with:
blobSAS: ${{ secrets.BLOB_TOKEN }}
blobUrl: ${{ vars.BLOB_URL }}

- name: Add Jira link
if: ${{ github.event_name == 'pull_request' }}
uses: VirtoCommerce/vc-github-actions/publish-jira-link@master
with:
branchName: ${{ github.head_ref }}
repoOrg: ${{ github.repository_owner }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -132,13 +152,43 @@ jobs:
uses: VirtoCommerce/vc-github-actions/publish-artifact-link@master
with:
artifactUrl: ${{ steps.blobRelease.outputs.packageUrl }}
repoOrg: ${{ github.repository_owner }}
downloadComment: 'Artifact URL:'

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

- name: Set artifactUrl value
id: artifactUrl
run: |
if [ '${{ github.ref }}' = 'refs/heads/master' ]; then
echo "download_url=${{ steps.githubRelease.outputs.downloadUrl }}" >> $GITHUB_OUTPUT
else
echo "download_url=${{ steps.blobRelease.outputs.packageUrl }}" >> $GITHUB_OUTPUT
fi;
- name: Create deployment matrix
if: ${{ github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/master'}}
uses: VirtoCommerce/vc-github-actions/cloud-create-deploy-matrix@master
id: deployment-matrix
with:
deployConfigPath: '.deployment/module/cloudDeploy.json'
releaseBranch: 'master'

- name: Check commit message for version number
id: run-e2e
run: |
if [[ "${{ github.event.head_commit.message }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]];
then
echo "result=false" >> $GITHUB_OUTPUT
else
echo "result=true" >> $GITHUB_OUTPUT
fi
- name: Setup Git Credentials
if: ${{ (github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/master') && github.event_name != 'workflow_dispatch' }}
Expand All @@ -150,19 +200,7 @@ jobs:
if: ${{ (github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/master') && github.event_name != 'workflow_dispatch' }}
uses: VirtoCommerce/vc-github-actions/publish-manifest@master
with:
packageUrl: ${{ steps.blobRelease.outputs.packageUrl }}

- name: Update virtocommerce.com
if: ${{ github.ref == 'refs/heads/master' }}
uses: VirtoCommerce/vc-github-actions/update-virtocommercecom@master
with:
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 }}
packageUrl: ${{ steps.artifactUrl.outputs.download_url }}

- name: Parse Jira Keys from All Commits
uses: VirtoCommerce/vc-github-actions/get-jira-keys@master
Expand All @@ -176,7 +214,7 @@ jobs:
- name: Push Build Info to Jira
if: ${{ env.CLOUD_INSTANCE_BASE_URL != 0 && env.CLIENT_ID != 0 && env.CLIENT_SECRET != 0 && steps.jira_keys.outputs.jira-keys != '' && always() }}
id: push_build_info_to_jira
uses: HighwayThree/jira-upload-build-info@master
uses: VirtoCommerce/jira-upload-build-info@master
with:
cloud-instance-base-url: '${{ secrets.CLOUD_INSTANCE_BASE_URL }}'
client-id: '${{ secrets.CLIENT_ID }}'
Expand All @@ -197,3 +235,38 @@ jobs:
if: success()
run: |
echo "Jira Upload Build Info response: ${{ steps.push_build_info_to_jira.outputs.response }}"
module-katalon-tests:
if: ${{ ((github.ref == 'refs/heads/dev') && (github.event_name == 'push') && (needs.ci.outputs.run-e2e == 'true')) ||
(github.event_name == 'workflow_dispatch')}}
needs: 'ci'
uses: VirtoCommerce/.github/.github/workflows/e2e.yml@v3.200.36
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 }}
platformDockerTag: 'dev-linux-latest'
storefrontDockerTag: 'dev-linux-latest'
secrets:
envPAT: ${{ secrets.REPO_TOKEN }}
katalonApiKey: ${{ secrets.KATALON_API_KEY }}

deploy-cloud:
if: ${{ ((github.ref == 'refs/heads/master') ||
(github.ref == 'refs/heads/dev')) &&
github.event_name == 'push' }}
needs: ci
uses: VirtoCommerce/.github/.github/workflows/deploy-cloud.yml@v3.200.36
with:
releaseSource: module
moduleId: ${{ needs.ci.outputs.moduleId }}
moduleVer: ${{ needs.ci.outputs.version }}
moduleBlob: ${{ needs.ci.outputs.blobId }}
jiraKeys: ${{ needs.ci.outputs.jira-keys }}
argoServer: 'argo.virtocommerce.cloud'
matrix: '{"include":${{ needs.ci.outputs.matrix }}}'
secrets: inherit

0 comments on commit 81b71ac

Please sign in to comment.