This repository has been archived by the owner on May 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Nacho Gonzalez-Garilleti
committed
May 12, 2023
1 parent
b09be32
commit 1a9f8a6
Showing
36 changed files
with
2,805 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Changelog: | ||
In order to help the product-team to compose better changelogs for our customers, please take your time and try to compose a changelog item. Try to describe your change from a customer perspective. Thanks! | ||
|
||
- [ ] Improved by ... | ||
- [ ] [internal] Improved by ... | ||
- [ ] Fixed a bug where... | ||
- [ ] [internal] Fixed a bug where ... | ||
- [ ] Fixed security vulnerabilities in ... | ||
|
||
# How to test | ||
Please describe the individual steps on how a peer can test your change. | ||
|
||
1. A | ||
2. B | ||
3. C | ||
|
||
# Additional considerations | ||
- [ ] This PR might have performance implications |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,248 @@ | ||
trigger: | ||
branches: | ||
include: | ||
- release/* | ||
|
||
resources: | ||
repositories: | ||
- repository: AgentAssistBackend | ||
type: git | ||
name: agent-assist-backend | ||
- repository: AgentAssistFrontend | ||
type: git | ||
name: agent-assist-frontend | ||
- repository: FluxFleetNonProd | ||
type: git | ||
name: Cognigy.AI/flux-fleet-non-prod | ||
# - repository: GitHubLiveAgent | ||
# type: github | ||
# endpoint: github.com_mayrbenjamin92 | ||
# name: Cognigy/cognigy-live-agent-helm-chart | ||
|
||
variables: | ||
- group: acr-prod | ||
- name: DOCKER_BUILDKIT | ||
value: 1 | ||
|
||
name: agent-assist-app-cd-$(BuildId) | ||
|
||
pool: | ||
vmImage: ubuntu-20.04 | ||
|
||
stages: | ||
- stage: createOrUpdateRelease | ||
displayName: Create or Update Release | ||
jobs: | ||
- job: setOrUpdateReleaseVersion | ||
displayName: Set or Update Release Version | ||
steps: | ||
- checkout: self | ||
persistCredentials: "true" | ||
clean: "true" | ||
|
||
- bash: | | ||
version="$(echo "$(Build.SourceBranch)" | sed "s/^.*release\/\(.*\)$/\1/")" | ||
echo "Setting as release version: $version" | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Live Agent CI" | ||
git fetch origin release/$version | ||
git checkout release/$version | ||
# set version with buildId to make Flux detect the change | ||
versionWithBuildId="$version-$(Build.BuildId)" | ||
chartFile="./Chart.yaml" | ||
echo "Setting as app version: $versionWithBuildId and version: $versionWithBuildId" | ||
yq e "(.version = \"$versionWithBuildId\") | (.appVersion = \"$versionWithBuildId\")" $chartFile > Chart-updated.yaml | ||
diff -U0 -w -b --ignore-blank-lines $chartFile Chart-updated.yaml > Chart.diff | ||
patch $chartFile < Chart.diff | ||
rm Chart.diff Chart-updated.yaml | ||
git add . | ||
git commit -m "[skip ci] Update Chart.yaml - appVersion: $versionWithBuildId | version: $versionWithBuildId" | ||
git -c http.extraheader="AUTHORIZATION: bearer $(System.AccessToken)" push -u origin HEAD | ||
echo "##vso[task.setvariable variable=releaseVersion;isOutput=true]$version" | ||
name: setReleaseVersionAndUpdateChart | ||
displayName: "Set Release Version And Update Chart.yaml" | ||
- job: createAgentAssistBackendReleaseBranch | ||
displayName: Create agent-assist-backend Release Branch | ||
dependsOn: setOrUpdateReleaseVersion | ||
variables: | ||
releaseVersion: $[ dependencies.setOrUpdateReleaseVersion.outputs['setReleaseVersionAndUpdateChart.releaseVersion'] ] | ||
steps: | ||
- checkout: AgentAssistBackend | ||
persistCredentials: "true" | ||
clean: "true" | ||
|
||
- bash: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Live Agent CI" | ||
releaseBranch="release/$(releaseVersion)" | ||
git fetch --all | ||
git checkout "$releaseBranch" 2>/dev/null || (git checkout -b "$releaseBranch" && git push -u origin $releaseBranch) | ||
displayName: "Create Release Branch" | ||
- job: createAgentAssistFrontendReleaseBranch | ||
displayName: Create agent-assist-frontend Release Branch | ||
dependsOn: setOrUpdateReleaseVersion | ||
variables: | ||
releaseVersion: $[ dependencies.setOrUpdateReleaseVersion.outputs['setReleaseVersionAndUpdateChart.releaseVersion'] ] | ||
steps: | ||
- checkout: AgentAssistFrontend | ||
persistCredentials: "true" | ||
clean: "true" | ||
|
||
- bash: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Live Agent CI" | ||
releaseBranch="release/$(releaseVersion)" | ||
git fetch --all | ||
git checkout "$releaseBranch" 2>/dev/null || (git checkout -b "$releaseBranch" && git push -u origin $releaseBranch) | ||
displayName: "Create Release Branch" | ||
- stage: stagingDeployment | ||
displayName: Staging Deployment | ||
dependsOn: | ||
- createOrUpdateRelease | ||
variables: | ||
releaseVersion: $[stageDependencies.createOrUpdateRelease.setOrUpdateReleaseVersion.outputs['setReleaseVersionAndUpdateChart.releaseVersion']] | ||
jobs: | ||
- job: updateFluxFleetNonProdStagingV4 | ||
displayName: Update flux-fleet-non-prod staging-v4 | ||
steps: | ||
- checkout: FluxFleetNonProd | ||
persistCredentials: "true" | ||
clean: "true" | ||
|
||
- bash: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Live Agent CI" | ||
git fetch --all | ||
git checkout master | ||
echo "release: $(releaseVersion)" | ||
agentAssistSyncPath="./aws/eu-central-1/staging-v4/agent-assist" | ||
yq e -i 'select(.kind == "GitRepository").spec.ref.branch |= "release/$(releaseVersion)"' $agentAssistSyncPath/sync.yaml | ||
git add . | ||
if [[ `git status --porcelain` ]]; then | ||
commitMessage="Updated staging-v4 agent-assist to release $(releaseVersion)" | ||
echo "$commitMessage" | ||
git commit -m "$commitMessage" | ||
git -c http.extraheader="AUTHORIZATION: bearer $(System.AccessToken)" push | ||
else | ||
echo "staging-v4 agent-assist already references this release, no changes pushed" | ||
fi | ||
displayName: "Update release branch reference" | ||
- stage: publishRelease | ||
displayName: Publish Release | ||
dependsOn: | ||
- createOrUpdateRelease | ||
- stagingDeployment | ||
variables: | ||
releaseVersion: $[stageDependencies.createOrUpdateRelease.setOrUpdateReleaseVersion.outputs['setReleaseVersionAndUpdateChart.releaseVersion']] | ||
jobs: | ||
- deployment: performPublishRelease | ||
displayName: Perform Publish Release | ||
environment: production | ||
variables: | ||
ACRPath: helm | ||
chartName: "agent-assist" | ||
strategy: | ||
runOnce: | ||
deploy: | ||
steps: | ||
- checkout: self | ||
persistCredentials: "true" | ||
clean: "true" | ||
|
||
# - checkout: GitHubLiveAgent | ||
# persistCredentials: "true" | ||
# clean: "true" | ||
|
||
- task: HelmInstaller@0 | ||
displayName: Install Helm 3.8.2 | ||
inputs: | ||
helmVersion: 3.8.2 | ||
checkLatestHelmVersion: false | ||
|
||
- task: Docker@2 | ||
displayName: Login into container registry | ||
inputs: | ||
command: "login" | ||
containerRegistry: $(containerProductionRegistryReference) | ||
|
||
- bash: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Live Agent CI" | ||
git fetch --all | ||
git checkout release/$(releaseVersion) && git pull | ||
chartFile="./Chart.yaml" | ||
echo "Setting as version: $(releaseVersion)" | ||
# Remove buildId from version as it is not necessary for Trial and App deployments | ||
yq e '.version = "$(releaseVersion)"' $chartFile > Chart-updated.yaml | ||
diff -U0 -w -b --ignore-blank-lines $chartFile Chart-updated.yaml > Chart.diff | ||
patch $chartFile < Chart.diff | ||
rm Chart.diff Chart-updated.yaml | ||
git add . | ||
git commit -m "[skip ci] remove buildId from Chart.yaml version: $(releaseVersion)" | ||
# Create new release tag | ||
git tag -a "v$(releaseVersion)" -m "version $(releaseVersion)" | ||
git -c http.extraheader="AUTHORIZATION: bearer $(System.AccessToken)" push --follow-tags -u origin HEAD | ||
helm version | ||
helmChartVersion="$(yq e '.version' Chart.yaml)" | ||
echo "Helm Chart" $(chartName) "version:" $helmChartVersion | ||
helm package . | ||
helm push ./$(chartName)-$helmChartVersion.tgz oci://$(containerProductionRegistry)/$(ACRPath) | ||
# COMMENTED OUT FOR NOW AS WE ARE NOT PUBLISHING THE HELM CHART TO GITHUB | ||
# # Change to the GitHub repository for Cognigy Live Agent Helm charts | ||
# cd ../../cognigy-live-agent-helm-chart | ||
# git checkout main | ||
# # Copy Helm chart package and add it to the root folder | ||
# mv ../live-agent-app/cognigy-live-agent/$(chartName)-$helmChartVersion.tgz ./ | ||
# git add . | ||
# git commit -m "$(releaseVersion) Helm chart" | ||
# # Create new release tag | ||
# git tag -a "v$(releaseVersion)" -m "$(releaseVersion) Helm chart" | ||
# git -c http.extraheader="AUTHORIZATION: bearer $(System.AccessToken)" push --follow-tags -u origin HEAD | ||
displayName: "Create release tag and publish Helm chart" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
*agent-assist*.tgz | ||
|
||
# OSX leaves these everywhere on SMB shares | ||
._* | ||
|
||
# OSX trash | ||
.DS_Store | ||
|
||
# Files generated by JetBrains IDEs, e.g. IntelliJ IDEA | ||
.idea/ | ||
*.iml | ||
|
||
# Vscode files | ||
.vscode | ||
|
||
# Emacs save files | ||
*~ | ||
\#*\# | ||
.\#* | ||
|
||
# Vim-related files | ||
[._]*.s[a-w][a-z] | ||
[._]s[a-w][a-z] | ||
*.un~ | ||
Session.vim | ||
.netrwhist | ||
|
||
# Chart dependencies | ||
**/charts/*.tgz | ||
values-local.yaml | ||
values-local.out.yaml | ||
Chart.lock | ||
|
||
.history | ||
|
||
# ignore files we might create for local development | ||
ui.test/ | ||
minica-key.pem | ||
minica.pem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
dependencies: | ||
- name: redis | ||
repository: https://charts.bitnami.com/bitnami | ||
version: 15.7.6 | ||
digest: sha256:9844c7f437a25a400c8c4b9b76bd84a950820eb15c432f52f805767bc55e1cc5 | ||
generated: "2022-10-09T14:05:10.390477+02:00" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: v2 | ||
name: agent-assist | ||
description: A Helm chart to deploy Cognigy Agent Assist | ||
|
||
type: application | ||
version: "4.51.0-82336" | ||
appVersion: "4.51.0-82336" | ||
icon: https://liveagent-trial.cognigy.ai/apple-icon-180x180.png | ||
dependencies: | ||
- name: redis | ||
version: "15.7.6" | ||
repository: https://charts.bitnami.com/bitnami | ||
condition: redis.enabled |
Oops, something went wrong.