Skip to content

Commit

Permalink
Merge branch 'release/3.18.0' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Vectorfield4 committed Jun 30, 2021
2 parents aa89da2 + 7485b5a commit 6560dd7
Show file tree
Hide file tree
Showing 10 changed files with 549 additions and 337 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/deploy-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# v1.0

name: Deploy to environments
on:
pull_request:
paths-ignore:
- '.github/**'
- 'docs/**'
- 'build/**'
- 'README.md'
- 'LICENSE'
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-dev')
uses: VirtoCommerce/vc-github-actions/get-deploy-param@master
id: deployConfig

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

- name: Create deploy PR in DEV
if: github.event.action != 'closed' && contains(github.event.pull_request.labels.*.name, 'deploy-dev')
uses: VirtoCommerce/vc-github-actions/create-deploy-pr@master
with:
deployRepo: ${{ steps.deployConfig.outputs.deployRepo }}
deployBranch: ${{ fromJSON(steps.deployConfig.outputs.deployConfig).dev.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 }}
13 changes: 10 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# v1.1.3
# v1.1.4
name: Module CI

on:
Expand Down Expand Up @@ -68,7 +68,6 @@ jobs:
else
echo "VERSION_SUFFIX=${{ steps.image.outputs.suffix }}" >> $GITHUB_ENV
fi;
- name: Add version suffix
if: ${{ github.ref != 'refs/heads/master' }}
uses: VirtoCommerce/vc-github-actions/add-version-suffix@master
Expand Down Expand Up @@ -134,4 +133,12 @@ jobs:
moduleId: ${{ steps.image.outputs.moduleId }}
moduleDescription: ${{ steps.image.outputs.moduleDescription }}
projectUrl: ${{ steps.image.outputs.projectUrl }}
iconUrl: ${{ steps.image.outputs.iconUrl }}
iconUrl: ${{ steps.image.outputs.iconUrl }}

- name: Invoke Module deployment workflow
if: ${{ github.ref == 'refs/heads/master' }}
uses: benc-uk/workflow-dispatch@v1
with:
workflow: VC deployment
token: ${{ secrets.REPO_TOKEN }}
inputs: '{ "artifactUrl": "https://github.com/${{ github.repository }}/releases/download/${{ steps.image.outputs.shortVersion }}/${{ steps.image.outputs.moduleId }}_${{ steps.image.outputs.shortVersion }}.zip", "deployBranch": "dev" }'
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?><Project>
<!-- These properties will be shared for all projects -->
<PropertyGroup>
<VersionPrefix>3.17.0</VersionPrefix>
<VersionPrefix>3.18.0</VersionPrefix>
<VersionSuffix>
</VersionSuffix>
<VersionSuffix Condition=" '$(VersionSuffix)' != '' AND '$(BuildNumber)' != '' ">$(VersionSuffix)-$(BuildNumber)</VersionSuffix>
Expand Down
Loading

0 comments on commit 6560dd7

Please sign in to comment.