Skip to content

Commit

Permalink
Merge pull request #9 from decentralized-cloud/updated-pipeline
Browse files Browse the repository at this point in the history
Updated pipelines
  • Loading branch information
mortezaalizadeh committed Feb 26, 2021
2 parents debbbe1 + 9acfb36 commit 8e092e7
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 15 deletions.
4 changes: 2 additions & 2 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
mode: ContinuousDeployment
branches:
master:
regex: (^master$|^origin\/master$|^main$|^origin\/main$)
main: {}
release: {}
feature: {}
hotfix: {}
ignore:
sha: []
merge-message-formats: {}

14 changes: 9 additions & 5 deletions azure-pipelines-helm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,21 @@ pool:

variables:
${{ if eq(variables['Build.SourceBranch'], 'refs/heads/main') }}:
version: latest
artifact_version: latest
${{ if not(eq(variables['Build.SourceBranch'], 'refs/heads/main')) }}:
version: $(GitVersion.SemVer)
artifact_version: $(GitVersion.SemVer)
isMainTriggered: $[eq(variables['Build.SourceBranch'], 'refs/heads/main')]
isTagTriggered: $[startsWith(variables['Build.SourceBranch'], 'refs/tags/v')]

steps:
- task: GitVersion@5
- task: gitversion/setup@0
displayName: "Setting up GitVersion"
inputs:
versionSpec: "5.x"

- task: gitversion/execute@0
displayName: "Figure out GitVersion"
inputs:
runtime: "core"
configFilePath: "./GitVersion.yml"

- task: Docker@2
Expand All @@ -37,4 +41,4 @@ steps:
command: "build"
Dockerfile: "$(system.defaultWorkingDirectory)/docker/Dockerfile.buildAndPushHelmChart"
buildContext: "$(system.defaultWorkingDirectory)"
arguments: "--build-arg GITHUB_ACCESS_CREDENTIAL=$(GITHUB_ACCESS_CREDENTIAL) --build-arg VERSION=${{variables.version}}"
arguments: "--build-arg GITHUB_ACCESS_CREDENTIAL=$(GITHUB_ACCESS_CREDENTIAL) --build-arg VERSION=${{variables.artifact_version}}"
20 changes: 12 additions & 8 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,19 @@ variables:
DOCKER_CONTAINER_REGISTRY: "Decentralized Cloud Docker Hub"
DOCKER_REPOSITORY_NAME: "decentralizedcloud/user"
${{ if eq(variables['Build.SourceBranch'], 'refs/heads/main') }}:
version: latest
artifact_version: latest
${{ if not(eq(variables['Build.SourceBranch'], 'refs/heads/main')) }}:
version: $(GitVersion.SemVer)
artifact_version: $(GitVersion.SemVer)

steps:
- task: GitVersion@5
- task: gitversion/setup@0
displayName: "Setting up GitVersion"
inputs:
versionSpec: "5.x"

- task: gitversion/execute@0
displayName: "Figure out GitVersion"
inputs:
runtime: "core"
configFilePath: "./GitVersion.yml"

- task: Bash@3
Expand All @@ -43,8 +47,8 @@ steps:
command: "build"
Dockerfile: "$(system.defaultWorkingDirectory)/docker/Dockerfile.build"
buildContext: "$(system.defaultWorkingDirectory)"
arguments: "--build-arg VERSION=${{variables.version}}"
tags: ${{variables.version}}
arguments: "--build-arg VERSION=${{variables.artifact_version}}"
tags: ${{variables.artifact_version}}

- task: Bash@3
displayName: "Test and coverage"
Expand All @@ -65,7 +69,7 @@ steps:
repository: $(DOCKER_REPOSITORY_NAME)
command: "push"
buildContext: "$(system.defaultWorkingDirectory)"
tags: ${{variables.version}}
tags: ${{variables.artifact_version}}

- task: Docker@2
displayName: "Docker logout"
Expand All @@ -84,7 +88,7 @@ steps:
inputs:
targetType: "inline"
script: |
helm package --destination "$(system.defaultWorkingDirectory)/chart-output" --app-version ${{variables.version}} "$(system.defaultWorkingDirectory)/helm-charts"
helm package --destination "$(system.defaultWorkingDirectory)/chart-output" --app-version ${{variables.artifact_version}} "$(system.defaultWorkingDirectory)/helm-charts"
- task: PublishPipelineArtifact@1
displayName: "Publish helm artifact"
Expand Down

0 comments on commit 8e092e7

Please sign in to comment.