-
Notifications
You must be signed in to change notification settings - Fork 2
117 lines (109 loc) · 6.89 KB
/
publish-app-catalogue.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Publish inframold to S3
on:
push:
branches:
- main
paths:
- '.github/workflows/publish-app-catalogue.yaml'
- 'charts/tfy-k8s-aws-eks-inframold/**'
- 'charts/tfy-k8s-azure-aks-inframold/**'
- 'charts/tfy-k8s-civo-talos-inframold/**'
- 'charts/tfy-k8s-gcp-gke-standard-inframold/**'
- 'charts/tfy-k8s-generic-inframold/**'
env:
AWS_S3_BUCKET: 'tfy-argo-application-catalogue'
RELEASES_SERVER_URL: ${{ secrets.RELEASES_SERVER_URL }}
RELEASES_SERVER_API_KEY: ${{ secrets.RELEASES_SERVER_API_KEY }}
jobs:
publish_release_and_sync_to_s3:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r scripts/release-updater/requirements.txt
- name: Run release-updater script
run: |
python scripts/release-updater/release-updater.py --url ${{ env.RELEASES_SERVER_URL }} --api-key ${{ env.RELEASES_SERVER_API_KEY }}
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.APP_CATALOGUE_S3_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.APP_CATALOGUE_S3_SECRET_KEY }}
aws-region: 'eu-west-1' # optional: defaults to us-east-1
- name: Set up Helm
uses: azure/[email protected]
with:
version: v3.9.2
- name: Set up Python 3.10 (needed for cookiecutter cli)
uses: actions/setup-python@v5
with:
python-version: '3.10'
- run: |
echo "Installing cookiecutter"
python -m pip install --upgrade pip
pip install cookiecutter==2.1.1
cookiecutter --version
- run: |
echo "Render AWS-EKS manifests"
helm template inframold -n argocd -f ./charts/tfy-k8s-aws-eks-inframold/values-helm.yaml -f ./charts/tfy-k8s-aws-eks-inframold/values-ocli.yaml ./charts/tfy-k8s-aws-eks-inframold --set aws.karpenter.defaultZones={""} --output-dir catalogues
# Get the version of the truefoundry helm chart
cp_chart_version=$(yq e '.spec.source.targetRevision' ./catalogues/tfy-k8s-aws-eks-inframold/templates/truefoundry.yaml)
# Sync to S3
aws s3 sync ./catalogues/tfy-k8s-aws-eks-inframold/templates s3://tfy-argo-application-catalogue/aws-eks/templates --delete
# Sync to S3 chart version folder
aws s3 sync ./catalogues/tfy-k8s-aws-eks-inframold/templates s3://tfy-argo-application-catalogue/aws-eks/$cp_chart_version/templates --delete
echo "Synced catalogue for aws-eks successfully"
- run: |
echo "Render GCP standard k8s manifests"
helm template inframold -n argocd -f ./charts/tfy-k8s-gcp-gke-standard-inframold/values-helm.yaml -f ./charts/tfy-k8s-gcp-gke-standard-inframold/values-ocli.yaml ./charts/tfy-k8s-gcp-gke-standard-inframold --output-dir catalogues
# Get the version of the truefoundry helm chart
cp_chart_version=$(yq e '.spec.source.targetRevision' ./catalogues/tfy-k8s-gcp-gke-standard-inframold/templates/truefoundry.yaml)
# Sync to S3
aws s3 sync ./catalogues/tfy-k8s-gcp-gke-standard-inframold/templates s3://tfy-argo-application-catalogue/gcp-gke-standard/templates --delete
# Sync to S3 chart version folder
aws s3 sync ./catalogues/tfy-k8s-gcp-gke-standard-inframold/templates s3://tfy-argo-application-catalogue/gcp-gke-standard/$cp_chart_version/templates --delete
echo "Synced catalogue for gcp-standard successfully"
- run: |
echo "Render Azure-AKS manifests"
helm template inframold -n argocd -f ./charts/tfy-k8s-azure-aks-inframold/values-helm.yaml -f ./charts/tfy-k8s-azure-aks-inframold/values-ocli.yaml ./charts/tfy-k8s-azure-aks-inframold --output-dir catalogues
# Get the version of the truefoundry helm chart
cp_chart_version=$(yq e '.spec.source.targetRevision' ./catalogues/tfy-k8s-azure-aks-inframold/templates/truefoundry.yaml)
# Sync to S3
aws s3 sync ./catalogues/tfy-k8s-azure-aks-inframold/templates s3://tfy-argo-application-catalogue/azure-aks/templates --delete
# Sync to S3 chart version folder
aws s3 sync ./catalogues/tfy-k8s-azure-aks-inframold/templates s3://tfy-argo-application-catalogue/azure-aks/$cp_chart_version/templates --delete
echo "Synced catalogue for azure-aks successfully"
- run: |
echo "Render Generic k8s manifests"
helm template inframold -n argocd -f ./charts/tfy-k8s-generic-inframold/values-helm.yaml -f ./charts/tfy-k8s-generic-inframold/values-ocli.yaml ./charts/tfy-k8s-generic-inframold --output-dir catalogues
# Get the version of the truefoundry helm chart
cp_chart_version=$(yq e '.spec.source.targetRevision' ./catalogues/tfy-k8s-generic-inframold/templates/truefoundry.yaml)
# Sync to S3
aws s3 sync ./catalogues/tfy-k8s-generic-inframold/templates s3://tfy-argo-application-catalogue/generic/templates --delete
# Sync to S3 chart version folder
aws s3 sync ./catalogues/tfy-k8s-generic-inframold/templates s3://tfy-argo-application-catalogue/generic/$cp_chart_version/templates --delete
echo "Synced catalogue for generic k8s successfully"
- run: |
echo "Render Civo-Talos k8s manifests"
helm template inframold -n argocd -f ./charts/tfy-k8s-civo-talos-inframold/values-helm.yaml -f ./charts/tfy-k8s-civo-talos-inframold/values-ocli.yaml ./charts/tfy-k8s-civo-talos-inframold --output-dir catalogues
# Get the version of the truefoundry helm chart
cp_chart_version=$(yq e '.spec.source.targetRevision' ./catalogues/tfy-k8s-civo-talos-inframold/templates/truefoundry.yaml)
# Sync to S3
aws s3 sync ./catalogues/tfy-k8s-civo-talos-inframold/templates s3://tfy-argo-application-catalogue/civo-talos/templates --delete
# Sync to S3 chart version folder
aws s3 sync ./catalogues/tfy-k8s-civo-talos-inframold/templates s3://tfy-argo-application-catalogue/civo-talos/$cp_chart_version/templates --delete
echo "Synced catalogue for civo-talos k8s successfully"
- run: |
# Invalidate cloudfront
aws configure set preview.cloudfront true && aws cloudfront create-invalidation --distribution-id EYFSW3BXDVFP0 --paths '/*'
- run: echo "🍏 This job's status is ${{ job.status }}."