Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: remove CI job deploy-on-aks - migration to ArgoCD #3328

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 0 additions & 122 deletions .circleci/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -886,108 +886,6 @@ jobs:
paths:
- ./docker-tag.txt

deploy-on-aks:
docker:
- image: mcr.microsoft.com/azure-cli:2.42.0
resource_class: small
steps:
- attach_workspace:
at: /tmp
- run:
name: Install Helm
command: |
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
helm version
- run:
name: Install Kubectl
command: |
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
chmod +x ./kubectl
mv ./kubectl /usr/local/bin/kubectl
kubectl version --client=true
- add_ssh_keys:
fingerprints:
- "ac:88:23:8f:c6:0f:7d:f0:fc:df:73:20:34:56:02:6c"
- run:
name: Setup Git config and clone cloud-am repo
command: |
# For details see https://circleci.com/docs/2.0/gh-bb-integration/#establishing-the-authenticity-of-an-ssh-host
ssh-keyscan github.com >> ~/.ssh/known_hosts
# Add SSH Key
export LOCAL_SSH_PRVIKEY="${HOME}/.ssh/id_rsa_ac88238fc60f7df0fcdf73203456026c"
ssh-add -D
ssh-add "${LOCAL_SSH_PRVIKEY}"
git clone --branch devs-preprod [email protected]:gravitee-io/cloud-am.git
- run:
name: Helm upgrade and 🚀 Mongo and JDBC instances
command: |
export TAG=$(cat /tmp/docker-tag.txt)

az login --service-principal -u $AZURE_APPLICATION_ID --tenant $AZURE_TENANT -p $AZURE_APPLICATION_SECRET
az aks get-credentials --admin --resource-group Devs-Preprod-Hosted --name gravitee-devs-preprod-aks-cluster
if [ "${CIRCLE_BRANCH}" == "master" ]; then
helm upgrade --repo https://helm.gravitee.io \
--install am-master \
-n am-master-dev \
-f ./cloud-am/devs-preprod/values.yaml am \
--set "api.image.repository=graviteeio.azurecr.io/am-management-api" \
--set "api.image.tag=${TAG}" \
--set "gateway.image.repository=graviteeio.azurecr.io/am-gateway" \
--set "gateway.image.tag=${TAG}" \
--set "ui.image.repository=graviteeio.azurecr.io/am-management-ui" \
--set "ui.image.tag=${TAG}"

helm upgrade --repo https://helm.gravitee.io \
--install am-master-ce \
-n am-master-ce-dev \
-f ./cloud-am/devs-preprod/values-ce.yaml am \
--set "api.image.repository=graviteeio.azurecr.io/am-management-api" \
--set "api.image.tag=${TAG}" \
--set "gateway.image.repository=graviteeio.azurecr.io/am-gateway" \
--set "gateway.image.tag=${TAG}" \
--set "ui.image.repository=graviteeio.azurecr.io/am-management-ui" \
--set "ui.image.tag=${TAG}"

helm upgrade --repo https://helm.gravitee.io \
--install am-psql \
-n am-master-postgres-dev \
-f ./cloud-am/devs-preprod/values-psql.yaml am \
--set "api.image.repository=graviteeio.azurecr.io/am-management-api" \
--set "api.image.tag=${TAG}" \
--set "gateway.image.repository=graviteeio.azurecr.io/am-gateway" \
--set "gateway.image.tag=${TAG}" \
--set "ui.image.repository=graviteeio.azurecr.io/am-management-ui" \
--set "ui.image.tag=${TAG}"
else
# create namespace if not exist (dry-run will generate YAML manifest and apply will create or update the ns using the manifest)
kubectl create namespace am-${CIRCLE_BRANCH//./-}-dev --dry-run=client -o yaml | kubectl apply -f -
# replace verison Pattern into generic maint configuration
sed -i 's#__BRANCH_NAME_SANITIZED__#'${CIRCLE_BRANCH//./-}'#g' ./cloud-am/devs-preprod/values-maint.yaml
helm upgrade --repo https://helm.gravitee.io \
--install am-${CIRCLE_BRANCH//./-} \
-n am-${CIRCLE_BRANCH//./-}-dev \
-f ./cloud-am/devs-preprod/values-maint.yaml am \
--set "api.image.repository=graviteeio.azurecr.io/am-management-api" \
--set "api.image.tag=${TAG}" \
--set "gateway.image.repository=graviteeio.azurecr.io/am-gateway" \
--set "gateway.image.tag=${TAG}" \
--set "ui.image.repository=graviteeio.azurecr.io/am-management-ui" \
--set "ui.image.tag=${TAG}"

# same with ce version
kubectl create namespace am-${CIRCLE_BRANCH//./-}-ce-dev --dry-run=client -o yaml | kubectl apply -f -
sed -i 's#__BRANCH_NAME_SANITIZED__#'${CIRCLE_BRANCH//./-}'#g' ./cloud-am/devs-preprod/values-ce-maint.yaml
helm upgrade --repo https://helm.gravitee.io \
--install am-${CIRCLE_BRANCH//./-}-ce \
-n am-${CIRCLE_BRANCH//./-}-ce-dev \
-f ./cloud-am/devs-preprod/values-ce-maint.yaml am \
--set "api.image.repository=graviteeio.azurecr.io/am-management-api" \
--set "api.image.tag=${TAG}" \
--set "gateway.image.repository=graviteeio.azurecr.io/am-gateway" \
--set "gateway.image.tag=${TAG}" \
--set "ui.image.repository=graviteeio.azurecr.io/am-management-ui" \
--set "ui.image.tag=${TAG}"
fi
purge-azure-registry:
docker:
- image: mcr.microsoft.com/azure-cli:latest
Expand Down Expand Up @@ -1794,26 +1692,6 @@ workflows:
- master
- /^(\d|[1-9]\d*)\.(\d|[1-9]\d*)\.x$/

- deploy-on-aks:
context: cicd-orchestrator
pre-steps:
- keeper/env-export:
secret-url: keeper://UryantA7MvZe8fkWwcUt8g/field/login
var-name: AZURE_APPLICATION_ID
- keeper/env-export:
secret-url: keeper://UryantA7MvZe8fkWwcUt8g/custom_field/tenant
var-name: AZURE_TENANT
- keeper/env-export:
secret-url: keeper://UryantA7MvZe8fkWwcUt8g/field/password
var-name: AZURE_APPLICATION_SECRET
requires:
- publish-images-azure-registry
filters:
branches:
only:
- master
- /^(\d|[1-9]\d*)\.(\d|[1-9]\d*)\.x$/

release:
when:
and:
Expand Down