Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

Commit

Permalink
Merge branch 'release/1.12.0' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
pushnitsa committed Apr 29, 2021
2 parents e5d0dd4 + 6f225c5 commit 9b6ba2d
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 26 deletions.
10 changes: 10 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Description:


--

QA-test:

Demo-test:

Download artifact URL:
55 changes: 55 additions & 0 deletions .github/workflows/deploy-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# v1.0

name: Deploy Storefront 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 }}
ARTIFACT_KEY: "docker.pkg.github.com/virtocommerce/vc-storefront/storefront"

steps:
- name: Gets artifact link
id: artifactLink
uses: VirtoCommerce/vc-github-actions/get-artifact-link@master

- name: Create deploy PR in QA
if: github.event.action != 'closed' && contains(github.event.pull_request.labels.*.name, 'deploy-qa') && !contains(github.event.pull_request.labels.*.name, 'deploy-demo')
uses: VirtoCommerce/vc-github-actions/create-deploy-pr@master
with:
deployRepo: "vc-webstore-deploy"
deployBranch: "qa"
artifactKey: ${{ env.ARTIFACT_KEY}}
artifactUrl: "${{ steps.artifactLink.outputs.artifactUrl }}"
taskNumber: "${{ steps.artifactLink.outputs.qaTaskNumber }}"
cmPath: "webstore-app/resources/kustomization.yaml"

- name: Create deploy PR in Demo
if: github.event.action == 'closed' && github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'deploy-demo')
uses: VirtoCommerce/vc-github-actions/create-deploy-pr@master
with:
deployRepo: "vc-webstore-deploy"
deployBranch: "master"
artifactKey: ${{ env.ARTIFACT_KEY}}
artifactUrl: "${{ steps.artifactLink.outputs.artifactUrl }}"
taskNumber: "${{ steps.artifactLink.outputs.demoTaskNumber }}"
cmPath: "webstore-app/resources/kustomization.yaml"

# - name: Deploy to dev
# if: github.event.action == 'closed' && github.event.pull_request.merged == true
# uses: benc-uk/workflow-dispatch@v1
# with:
# workflow: VC image deployment
# token: ${{ secrets.REPO_TOKEN }}
# inputs: '{ "baseImageName": "docker.pkg.github.com/virtocommerce/vc-storefront/storefront", "artifactLink": "${{ steps.artifactLink.outputs.artifactUrl }}" }'
20 changes: 9 additions & 11 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
# v0.1
# v0.2

name: VC image deployment
on:
workflow_dispatch:
inputs:
baseImageName:
description: 'Base kustomize image name'
required: true
imageName:
description: 'Deploying image name'
required: true
artifactVersion:
description: 'Full artifact build number'
artifactLink:
description: 'Full link to artifact docker image'
required: true
appDescriptionRepo:
description: 'ArgoCd repository'
Expand All @@ -21,7 +19,6 @@ on:
required: true
default: 'dev'


jobs:
cd:
runs-on: ubuntu-latest
Expand All @@ -46,18 +43,19 @@ jobs:
- name: Update kustomize
shell: pwsh
run: |
$REPOSITORY = "docker.pkg.github.com/$('${{ github.repository }}'.ToLower())"
cd ${{ github.workspace }}
cd ./webstore-app/resources
kustomize edit set image ${{ github.event.inputs.baseImageName }}=$REPOSITORY/${{ github.event.inputs.imageName }}:${{ github.event.inputs.artifactVersion }}
kustomize edit set image ${{ github.event.inputs.baseImageName }}=${{ github.event.inputs.artifactLink }}
- uses: VirtoCommerce/vc-github-actions/setup-git-credentials-github@master
with:
githubToken: ${{ secrets.REPO_TOKEN }}

- name: Commit kustomize change
shell: pwsh
run: |
if(git status --porcelain |Where {$_ -notmatch '^\?\?'}) # uncommitted changes exist
{
git config --global user.name 'vc-ci'
git config user.email --global 'ci@virtocommerce.com'
git commit -am 'Automated update ${{ github.repository }} to ${{ github.event.inputs.artifactVersion }}'
git push
}
Expand Down
36 changes: 22 additions & 14 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# v1.1.2.vc-demo-storefront
# v1.1.4.vc-demo-storefront
name: Storefront CI

# Controls when the action will run. Triggers the workflow on push or pull request
Expand Down Expand Up @@ -30,17 +30,19 @@ jobs:
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
NUGET_KEY: ${{ secrets.NUGET_KEY }}
BLOB_SAS: ${{ secrets.BLOB_TOKEN }}
IMAGE_NAME: "demo-storefront"
PUBLISH_TO_DOCKER: "false"
UPDATE_LATEST_TAG: "true"
VERSION_SUFFIX: ""

steps:

- name: Set variables
if: ${{ github.event_name == 'workflow_dispatch' }}
if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request' }}
run: |
echo "PUBLISH_TO_DOCKER=false" >> $GITHUB_ENV
echo "UPDATE_LATEST_TAG=false" >> $GITHUB_ENV
# echo "PUBLISH_TO_DOCKER=false" >> $GITHUB_ENV


- name: Set up JDK 11 for dotnet-sonarscanner #Sonar stop accepting Java versions less than 11
uses: actions/setup-java@v1
Expand Down Expand Up @@ -106,20 +108,20 @@ jobs:
run: vc-build Compress -skip Clean+Restore+Compile+Test

- name: Build Docker Image
if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev' || (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: dockerBuild
uses: VirtoCommerce/vc-github-actions/build-docker-image@master
with:
tag: ${{ steps.image.outputs.taggedVersion }}
imageName: "demo-storefront"
imageName: ${{ env.IMAGE_NAME }}
dockerFiles: "https://raw.githubusercontent.com/VirtoCommerce/vc-docker/master/linux/storefront/Dockerfile"

- name: Publish to Blob
if: ${{ github.ref == 'refs/heads/dev' || (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 }}
# - name: Publish to Blob
# if: ${{ github.ref == 'refs/heads/dev' || (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 }}

- name: Publish Github Release
if: ${{ github.ref == 'refs/heads/master' }}
Expand All @@ -128,15 +130,15 @@ jobs:
uses: VirtoCommerce/vc-github-actions/publish-github-release@master

- name: Docker Login
if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev' || (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') }}
uses: azure/docker-login@v1
with:
login-server: docker.pkg.github.com
username: $GITHUB_ACTOR
password: ${{ secrets.GITHUB_TOKEN }}

- name: Publish Docker Image
if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev' || (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') }}
uses: VirtoCommerce/vc-github-actions/publish-docker-image@master
with:
image: ${{ steps.dockerBuild.outputs.imageName }}
Expand All @@ -146,10 +148,16 @@ jobs:
docker_hub: ${{ env.PUBLISH_TO_DOCKER }}
update_latest: ${{ env.UPDATE_LATEST_TAG }}

- name: Add link to PR
if: ${{ github.event_name == 'pull_request' }}
uses: VirtoCommerce/vc-github-actions/publish-artifact-link@master
with:
artifactUrl: "docker.pkg.github.com/${{ github.repository }}/${{ env.IMAGE_NAME }}:${{ steps.image.outputs.taggedVersion }}"

- name: Invoke VC image deployment workflow
if: ${{ github.ref == 'refs/heads/dev' || (github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/master')}}
uses: benc-uk/workflow-dispatch@v1
with:
workflow: VC image deployment
token: ${{ secrets.REPO_TOKEN }}
inputs: '{ "baseImageName": "docker.pkg.github.com/virtocommerce/vc-storefront/storefront", "imageName": "demo-storefront", "artifactVersion": "${{ steps.image.outputs.taggedVersion }}"}'
inputs: '{ "baseImageName": "docker.pkg.github.com/virtocommerce/vc-storefront/storefront", "artifactLink": ""docker.pkg.github.com/${{ github.repository }}/${{ env.IMAGE_NAME }}:${{ steps.image.outputs.taggedVersion }}"}" }'
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<Authors>VirtoCommerce</Authors>
</PropertyGroup>
<PropertyGroup>
<VersionPrefix>1.11.0</VersionPrefix>
<VersionPrefix>1.12.0</VersionPrefix>
<VersionSuffix></VersionSuffix>
<VersionSuffix Condition=" '$(VersionSuffix)' != '' AND '$(BuildNumber)' != '' ">$(VersionSuffix)-$(BuildNumber)</VersionSuffix>
</PropertyGroup>
Expand Down

0 comments on commit 9b6ba2d

Please sign in to comment.