This repository has been archived by the owner on Jul 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
81 lines (60 loc) · 2.48 KB
/
deploy.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
name: Deploy into existing namespace
on:
push:
branches:
- 'deploy/**'
concurrency:
group: ${{ github.ref }}
cancel-in-progress: false
env:
# Repo containing participant connector values file in respective namespace folder
GITOPS_REPO: https://raw.githubusercontent.com/FIWARE-Ops/fiware-gitops/master/aws
# Directory for each participant containing connector values file
VALUES_DIR: data-space-connector
jobs:
deploy:
runs-on: ubuntu-latest
# Deployment for participants, <GITOPS_REPO> must contain folder for each participant
# Will look for values.yaml file at: <GITOPS_REPO>/<NAMESPACE>/<PARTICIPANT>/<VALUES_DIR>/values.yaml
strategy:
matrix:
participant: ["packet-delivery"]
steps:
- name: Git checkout
uses: actions/checkout@v1
- name: Authenticate and set context
uses: redhat-actions/oc-login@v1
with:
# URL to your OpenShift cluster.
# Refer to Step 2.
openshift_server_url: ${{ secrets.OPENSHIFT_SERVER }}
# Authentication Token. Can use username and password instead.
# Refer to Step 3.
openshift_token: ${{ secrets.OPENSHIFT_TOKEN }}
# Disables SSL cert checking. Use this if you don't have the certificate authority data.
insecure_skip_tls_verify: true
# extract the current branch name and provide it as a var for easier integration into sed-commands
- name: Get branch name
id: branch-name
uses: tj-actions/[email protected]
- name: Log the branch name used as namespace
run: |
echo ${{ steps.branch-name.outputs.current_branch }}
- name: Get namespace from branch name
run: |
echo "NAMESPACE=$(echo ${{ steps.branch-name.outputs.current_branch }} | cut -d "/" -f 2)" >> "$GITHUB_ENV"
- name: Log the namespace
run: |
echo ${{ env.NAMESPACE }}
- name: Log the participant
run: |
echo ${{ matrix.participant }}
- name: Download values for participant
run: |
cd data-space-connector/
wget -O values-participant.yaml ${{ env.GITOPS_REPO }}/${{ env.NAMESPACE }}/${{ matrix.participant }}/${{ env.VALUES_DIR }}/values.yaml
cat values-participant.yaml
- name: Deploy applications
run: |
cd data-space-connector/
helm template ${{ secrets.OVERWRITE_VALUES }} -f values-participant.yaml . | oc -n argocd apply -f -