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

Restored deploy jobs in cicd pipeline #698

Merged
merged 5 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
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
176 changes: 88 additions & 88 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,79 +70,79 @@ jobs:
echo "This branch is not allowed to merge"
exit 1

# deploy-test:
# docker:
# - image: 'geekzone/infra'
# environment:
# TAG: 0.1.<< pipeline.number >>
# steps:
# - checkout
# - run:
# name: Create .terraformrc file locally
# command: >-
# echo "credentials \"app.terraform.io\" {token =
# \"$TERRAFORM_TOKEN\"}" > $HOME/.terraformrc
# - run:
# name: Connect to or create k8s cluster
# command: |
# cd /usr/src/infra
# { az login --service-principal -u $CLIENT_ID -p $CLIENT_PASSWORD --tenant $TENANT_ID
# } &&
# { az aks get-credentials --resource-group $RESOURCE_GROUP --name $CLUSTER_NAME --admin
# } ||
# { create-azure-infra
# }
# - run:
# name: Deploy k8s resources
# command: |
# cd /usr/src/infra
# az login --service-principal -u $CLIENT_ID -p $CLIENT_PASSWORD --tenant $TENANT_ID
# az aks get-credentials --resource-group $RESOURCE_GROUP --name $CLUSTER_NAME --admin
# deploy-test-in-azure
# - run:
# name: Plan cluster destruction
# command: |
# cd /usr/src/infra
# az login --service-principal -u $CLIENT_ID -p $CLIENT_PASSWORD --tenant $TENANT_ID
# az aks get-credentials --resource-group $RESOURCE_GROUP --name $CLUSTER_NAME --admin
# kubectl apply -f azure/k8s/cronjobs/destroy-infra-test.yaml
deploy-test:
docker:
- image: "geekzone/infra"
environment:
TAG: 0.1.<< pipeline.number >>
steps:
- checkout
- run:
name: Create .terraformrc file locally
command: >-
echo "credentials \"app.terraform.io\" {token =
\"$TERRAFORM_TOKEN\"}" > $HOME/.terraformrc
- run:
name: Connect to or create k8s cluster
command: |
cd /usr/src/infra
{ az login --service-principal -u $CLIENT_ID -p $CLIENT_PASSWORD --tenant $TENANT_ID
} &&
{ az aks get-credentials --resource-group $RESOURCE_GROUP --name $CLUSTER_NAME --admin
} ||
{ create-azure-infra
}
- run:
name: Deploy k8s resources
command: |
cd /usr/src/infra
az login --service-principal -u $CLIENT_ID -p $CLIENT_PASSWORD --tenant $TENANT_ID
az aks get-credentials --resource-group $RESOURCE_GROUP --name $CLUSTER_NAME --admin
deploy-test-in-azure
- run:
name: Plan cluster destruction
command: |
cd /usr/src/infra
az login --service-principal -u $CLIENT_ID -p $CLIENT_PASSWORD --tenant $TENANT_ID
az aks get-credentials --resource-group $RESOURCE_GROUP --name $CLUSTER_NAME --admin
kubectl apply -f azure/k8s/cronjobs/destroy-infra-test.yaml

# deploy-prod:
# docker:
# - image: 'geekzone/infra'
# environment:
# TAG: 0.1.<< pipeline.number >>
# steps:
# - checkout
# - run:
# name: Create .terraformrc file locally
# command: >-
# echo "credentials \"app.terraform.io\" {token =
# \"$TERRAFORM_TOKEN\"}" > $HOME/.terraformrc
# - run:
# name: Connect to or create k8s cluster
# command: |
# cd /usr/src/infra
# { az login --service-principal -u $CLIENT_ID -p $CLIENT_PASSWORD --tenant $TENANT_ID
# } &&
# { az aks get-credentials --resource-group $RESOURCE_GROUP --name $CLUSTER_NAME --admin
# } ||
# { create-azure-infra
# }
# - run:
# name: Deploy k8s resources
# command: |
# cd /usr/src/infra
# az login --service-principal -u $CLIENT_ID -p $CLIENT_PASSWORD --tenant $TENANT_ID
# az aks get-credentials --resource-group $RESOURCE_GROUP --name $CLUSTER_NAME --admin
# deploy-prod-in-azure
# - run:
# name: Plan cluster destruction
# command: |
# cd /usr/src/infra
# az login --service-principal -u $CLIENT_ID -p $CLIENT_PASSWORD --tenant $TENANT_ID
# az aks get-credentials --resource-group $RESOURCE_GROUP --name $CLUSTER_NAME --admin
# kubectl apply -f azure/k8s/cronjobs/destroy-infra-prod.yaml
deploy-prod:
docker:
- image: "geekzone/infra"
environment:
TAG: 0.1.<< pipeline.number >>
steps:
- checkout
- run:
name: Create .terraformrc file locally
command: >-
echo "credentials \"app.terraform.io\" {token =
\"$TERRAFORM_TOKEN\"}" > $HOME/.terraformrc
- run:
name: Connect to or create k8s cluster
command: |
cd /usr/src/infra
{ az login --service-principal -u $CLIENT_ID -p $CLIENT_PASSWORD --tenant $TENANT_ID
} &&
{ az aks get-credentials --resource-group $RESOURCE_GROUP --name $CLUSTER_NAME --admin
} ||
{ create-azure-infra
}
- run:
name: Deploy k8s resources
command: |
cd /usr/src/infra
az login --service-principal -u $CLIENT_ID -p $CLIENT_PASSWORD --tenant $TENANT_ID
az aks get-credentials --resource-group $RESOURCE_GROUP --name $CLUSTER_NAME --admin
deploy-prod-in-azure
- run:
name: Plan cluster destruction
command: |
cd /usr/src/infra
az login --service-principal -u $CLIENT_ID -p $CLIENT_PASSWORD --tenant $TENANT_ID
az aks get-credentials --resource-group $RESOURCE_GROUP --name $CLUSTER_NAME --admin
kubectl apply -f azure/k8s/cronjobs/destroy-infra-prod.yaml

workflows:
version: 2
Expand All @@ -156,19 +156,19 @@ workflows:
branches:
only:
- /^junk-.*/
# - deploy-test:
# requires:
# - build-test-publish
# filters:
# branches:
# only: /feature-.*/
# context:
# - org-global
# - deploy-prod:
# requires:
# - build-test-publish
# filters:
# branches:
# only: main
# context:
# - org-global
- deploy-test:
requires:
- build-test-publish
filters:
branches:
only: /feature-.*/
context:
- org-global
- deploy-prod:
requires:
- build-test-publish
filters:
branches:
only: main
context:
- org-global
4 changes: 2 additions & 2 deletions docker/proxy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ RUN ["python", "manage.py", "collectstatic"]

CMD [ "gunicorn", "web.wsgi", "-b 0.0.0.0:8000" ]

FROM nginx:1.25.2-alpine3.18
FROM nginx:1.25.3-alpine3.18

RUN apk update && apk upgrade

# Install the fixed versions of libwebp and curl
RUN apk add libwebp=1.3.2-r0 curl=8.3.0-r0
RUN apk add --no-cache libwebp=1.3.2-r0 curl=8.4.0-r0

COPY docker/proxy/default.conf /etc/nginx/conf.d/
COPY docker/proxy/nginx.conf /etc/nginx/
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ soupsieve~=2.2
sqlparse==0.4.4
stripe==5.4.0
tornado==6.3.3
urllib3>=2.0.6
urllib3>=2.0.7
celery==5.2.2
django-clacks>=0.1.0
cookiecutter==2.1.1 # not directly required, pinned by Snyk to avoid a vulnerability
Expand Down
Loading