Skip to content

Commit

Permalink
init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard87 committed Oct 31, 2023
1 parent 6cffb8d commit eda8b7c
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/clean-cache-registry.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *' # Daily

permissions:
id-token: write
contents: read

jobs:
purge:
runs-on: ubuntu-latest
environment: s941

steps:
- uses: actions/checkout@v3 #Clone Repo
- name: 'Az CLI login'
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Purge old cache
run: RADIX_ZONE_ENV=./scripts/radix-zone/radix_zone_dev.env .github/workflows/scripts/dailytasks.sh
37 changes: 37 additions & 0 deletions .github/workflows/scripts/purge_old_cache.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env bash

#######################################################################################
### PURPOSE
###

# Starting/stopping clusters in subscription

#######################################################################################
### INPUTS
###

# Required:
# - RADIX_ZONE_ENV : Path to *.env file
# - TASK : Ex: "start", "stop"

#######################################################################################
### Read inputs and configs
###
echo ""
printf "Check for neccesary executables... "
hash acr 2>/dev/null || {
echo -e "\nERROR: Azure ACR CLI not found in PATH. Exiting... " >&2
exit 1
}

if [[ -z "$RADIX_ZONE_ENV" ]]; then
echo "ERROR: Please provide RADIX_ZONE_ENV" >&2
exit 1
else
if [[ ! -f "$RADIX_ZONE_ENV" ]]; then
echo "ERROR: RADIX_ZONE_ENV=$RADIX_ZONE_ENV is invalid, the file does not exist." >&2
exit 1
fi
source "$RADIX_ZONE_ENV"
fi

0 comments on commit eda8b7c

Please sign in to comment.