-
Notifications
You must be signed in to change notification settings - Fork 244
130 lines (119 loc) · 4.25 KB
/
helm-community.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
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
118
119
120
121
122
123
124
125
126
127
128
129
130
---
name: Helm (Community)
on:
pull_request:
branches:
- master
- release/**
- next/**
paths:
- helm/**
- test/postman/helm/**
- .github/workflows/helm*
- test/community-integration-test-values.yaml
push:
branches:
- master
- release/**
concurrency:
group: helm-com-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
jobs:
build_vars:
runs-on: ubuntu-latest
outputs:
ver_json: ${{ steps.app_versions.outputs.json }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Get charts
id: getcharts
uses: ./.github/actions/charts-as-json
with:
charts-root: helm
- name: Keep only ACS enterprise
id: app_versions
env:
JSON: ${{ toJSON(fromJSON(steps.getcharts.outputs.all)) }}
JQ_FILTER: >-
[inputs | .charts[] | {name: .name, values: .values[]}
| select(.values=="community_values.yaml" or .name=="acs-sso-example")]
run: |
echo "${JSON}" | jq -nc '${{ env.JQ_FILTER }}'
VERS=$(echo "${JSON}" | jq -nc '${{ env.JQ_FILTER }}')
echo "json=$VERS" >> $GITHUB_OUTPUT
community_charts:
runs-on: ubuntu-latest
timeout-minutes: 10
needs:
- build_vars
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(needs.build_vars.outputs.ver_json) }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0
with:
version: "3.12.1"
- name: Login to Docker Hub
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
if: ${{ ! github.event.repository.fork }}
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Setup cluster
uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
with:
ingress-nginx-ref: controller-v1.8.2
- name: Set nginx ingress config
run: |
kubectl -n ingress-nginx patch cm ingress-nginx-controller \
-p '{"data": {"allow-snippet-annotations":"true"}}'
- name: Create registries auth secret
if: ${{ ! github.event.repository.fork }}
run: |
kubectl create secret generic regcred \
--from-file=.dockerconfigjson=$HOME/.docker/config.json \
--type=kubernetes.io/dockerconfigjson
- name: Add dependency chart repos
run: |
helm repo add self https://alfresco.github.io/alfresco-helm-charts/
helm repo add codecentric https://codecentric.github.io/helm-charts/
helm repo add elastic https://helm.elastic.co/
- name: Helm install
run: |
helm dep build .
helm install ${{ matrix.name }} . \
--set global.search.sharedSecret="$(openssl rand -hex 24)" \
--set global.known_urls=http://localhost \
--set global.alfrescoRegistryPullSecrets=regcred \
--wait --timeout 6m0s \
--values ${{ matrix.values }} \
--values ../../test/community-integration-test-values.yaml
working-directory: helm/${{ matrix.name }}
- name: Spit cluster status
if: always()
run: |
helm ls --all-namespaces
kubectl get all --all-namespaces
kubectl describe pod
- uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v.3.0.0
id: newman
if: matrix.name == 'alfresco-content-services'
with:
timeout_minutes: 1
retry_wait_seconds: 30
max_attempts: 5
command: >-
docker run --network=host
-v $(pwd)/test/postman:/etc/postman
-t postman/newman run /etc/postman/helm/acs-test-helm-collection.json
--global-var protocol=http --global-var url=localhost
- name: Spit cluster status after tests
if: always() && steps.newman.outcome != 'skipped'
run: |
helm ls --all-namespaces
kubectl get all --all-namespaces
kubectl describe pod