Skip to content

Commit

Permalink
deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
FilipHarald committed Oct 10, 2024
1 parent 09a8a94 commit c1da6ef
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/chicmoz-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- production
- feat/websockets_in_production
pull_request:
branches:
- production
Expand Down Expand Up @@ -35,8 +36,7 @@ jobs:

- name: Cleanup old images
run: |
chmod +x ".github/workflows/cleanup-script.sh"
bash -x ".github/workflows/cleanup-script.sh"
bash -x "scripts/production/cleanup-registry.sh"
- name: Save DigitalOcean kubeconfig
run: doctl kubernetes cluster kubeconfig save "chicmoz-prod"
Expand All @@ -47,7 +47,7 @@ jobs:
RETRY_DELAY=10
for i in $(seq 1 $MAX_RETRIES); do
if skaffold run --filename "k8s/production/skaffold.production.light.yaml" --default-repo=registry.digitalocean.com/aztlan-containers; then
if bash -x scripts/production/deploy.sh; then
echo "Deployment successful"
exit 0
fi
Expand Down
24 changes: 13 additions & 11 deletions k8s/production/skaffold.production.light.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ kind: Config
metadata:
name: chicmoz-prod
build:
local:
push: false
artifacts:
- image: registry.digitalocean.com/aztlan-containers/chicmoz-base
- image: chicmoz-base
context: .
docker:
dockerfile: Dockerfile
- image: registry.digitalocean.com/aztlan-containers/explorer-ui
- image: explorer-ui
context: services/explorer-ui
docker:
dockerfile: Dockerfile
Expand All @@ -17,35 +19,35 @@ build:
VITE_API_URL: "https://api.chicmoz.info/v1/d1e2083a-660c-4314-a6f2-1d42f4b944f4" # TODO: change the api key
VITE_WS_URL: "wss://ws.chicmoz.info"
requires:
- image: registry.digitalocean.com/aztlan-containers/chicmoz-base
- image: chicmoz-base
alias: BASE
- image: registry.digitalocean.com/aztlan-containers/auth
- image: auth
context: services/auth
docker:
dockerfile: Dockerfile
requires:
- image: registry.digitalocean.com/aztlan-containers/chicmoz-base
- image: chicmoz-base
alias: BASE
- image: registry.digitalocean.com/aztlan-containers/aztec-listener
- image: aztec-listener
context: services/aztec-listener
docker:
dockerfile: Dockerfile
requires:
- image: registry.digitalocean.com/aztlan-containers/chicmoz-base
- image: chicmoz-base
alias: BASE
- image: registry.digitalocean.com/aztlan-containers/explorer-api
- image: explorer-api
context: services/explorer-api
docker:
dockerfile: Dockerfile
requires:
- image: registry.digitalocean.com/aztlan-containers/chicmoz-base
- image: chicmoz-base
alias: BASE
- image: registry.digitalocean.com/aztlan-containers/websocket-event-publisher
- image: websocket-event-publisher
context: services/websocket-event-publisher
docker:
dockerfile: Dockerfile
requires:
- image: registry.digitalocean.com/aztlan-containers/chicmoz-base
- image: chicmoz-base
alias: BASE
manifests:
rawYaml:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cleanup-script.sh → scripts/production/cleanup-registry.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ delete_old_tags() {
echo "Processing repository: $repo"

# List tags and filter for SHA-based tags, excluding the most recent 5
SHA_TAGS=$(doctl registry repository list-tags "$repo" --format "Manifest Digest" --no-header | grep -E '^sha' | sort -r | tail -n +2) || true
SHA_TAGS=$(doctl registry repository list-tags "$repo" --format "Manifest Digest" --no-header | grep -E '^sha' | sort -r | head -n +2) || true

if [ -z "$SHA_TAGS" ]; then
echo "No old SHA tags found for repository: $repo"
Expand Down
File renamed without changes.

0 comments on commit c1da6ef

Please sign in to comment.