-
Notifications
You must be signed in to change notification settings - Fork 4
62 lines (54 loc) · 2.03 KB
/
platform-simulated-data-producer.yml
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
---
name: Platform - Simulated Data Producer
on: # yamllint disable-line rule:truthy
push:
branches:
- main
paths:
- .github/workflows/platform-simulated-data-producer.yml
- scripts/simulated-data-producer/**
workflow_dispatch:
permissions: read-all
concurrency: platform-simulated-data-producer
jobs:
simulated-data-producer:
name: Simulated Data Producer
runs-on: ubuntu-latest
defaults:
run:
working-directory: scripts/simulated-data-producer
env:
KUBE_CLUSTER: ${{ secrets.CLOUD_PLATFORM_DATA_PLATFORM_DEVELOPMENT_KUBE_CLUSTER }}
KUBE_NAMESPACE: ${{ secrets.CLOUD_PLATFORM_DATA_PLATFORM_DEVELOPMENT_KUBE_NAMESPACE }}
KUBE_CERT: ${{ secrets.CLOUD_PLATFORM_DATA_PLATFORM_DEVELOPMENT_KUBE_CERT }}
KUBE_TOKEN: ${{ secrets.CLOUD_PLATFORM_DATA_PLATFORM_DEVELOPMENT_KUBE_TOKEN }}
steps:
- name: Checkout
id: checkout
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
- name: Configure Kubernetes CLI
id: configure_kubectl
run: |
echo "${KUBE_CERT}" > ca.crt
kubectl config set-cluster cloud-platform --server=https://${KUBE_CLUSTER} --certificate-authority=ca.crt
kubectl config set-credentials cloud-platform --token="${KUBE_TOKEN}"
kubectl config set-context cloud-platform --cluster=cloud-platform --namespace=${KUBE_NAMESPACE} --user=cloud-platform
kubectl config use-context cloud-platform
- name: Create Kubernetes configmap
id: create_manifests
run: |
kubectl \
delete \
configmap \
simulated-data-producer || true
kubectl \
create \
configmap \
simulated-data-producer \
--from-file=entrypoint.sh \
--from-file=main.py
- name: Run migration
id: run_migration
run: |
kubectl apply --filename job.yml
kubectl wait --for=condition=complete --timeout=300s job/simulated-data-producer