-
Notifications
You must be signed in to change notification settings - Fork 8
84 lines (70 loc) · 3.28 KB
/
lint-test_icm-integrationtest.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
name: "Integration test icm chart"
on:
pull_request:
paths:
- 'charts/icm/**'
branches:
- main
jobs:
lint-test-icm-integrationtest:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Base
uses: ./.github/template/base
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --config ct_icm.yaml)
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
fi
- name: Create kind cluster
if: steps.list-changed.outputs.changed == 'true'
uses: helm/[email protected]
with:
config: kind.yaml
- name: Log into registry docker.io
if: steps.list-changed.outputs.changed == 'true'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Run chart-testing (install)
if: steps.list-changed.outputs.changed == 'true'
run: |
set -x
random_value=`tr -dc 'a-z0-9' < /dev/urandom | head -c10`
export NAMESPACE=ct-icm-$random_value
echo "NAMESPACE=$NAMESPACE" >> $GITHUB_ENV
kubectl create namespace icm-system
kubectl create namespace $NAMESPACE
kubectl create secret docker-registry dockerhub --namespace=icm-system --docker-username=${{ secrets.DOCKER_USERNAME }} --docker-password=${{ secrets.DOCKER_PASSWORD }} [email protected]
kubectl create secret docker-registry dockerhub --namespace=$NAMESPACE --docker-username=${{ secrets.DOCKER_USERNAME }} --docker-password=${{ secrets.DOCKER_PASSWORD }} [email protected]
sed -i 's/runAsNonRoot: true/runAsNonRoot: false/' charts/icm/values.yaml
sudo mkdir -p /data/icm/sites
sed -i 's/<local sites folder>/\/data\/icm\/sites/' charts/icm/values.yaml
sudo mkdir -p /data/icm/encryption
sed -i 's/<local encryption folder>/\/data\/icm\/encryption/' charts/icm/values.yaml
sudo mkdir -p /data/icm/mssql/data
sudo mkdir -p /data/icm/mssql/backup
sed -i 's/<local mssql data folder>/\/data\/icm\/mssql\/data/' charts/icm/values.yaml
sed -i 's/<local mssql backup folder>/\/data\/icm\/mssql\/backup/' charts/icm/values.yaml
sed -i '/^ mssql:/{n;s/.*/ enabled: true/}' charts/icm/values.yaml
ct install --namespace=$NAMESPACE --config ct_icm.yaml
- name: Debug failure
if: failure() && steps.list-changed.outputs.changed == 'true'
run: |
echo "=Describe nodes================================\n"
kubectl describe node -A
echo "=Describe pods================================\n"
kubectl describe pod -n $NAMESPACE
echo "=Describe services================================\n"
kubectl describe service -n $NAMESPACE
echo "=Logs icm-as-msql================================\n"
kubectl logs -n $NAMESPACE $(kubectl get pods -l app=icm-as-mssql -n $NAMESPACE -o jsonpath="{.items[0].metadata.name}")
echo "=Logs icm-as================================\n"
kubectl logs -n $NAMESPACE $(kubectl get pods -l app=icm-as -n $NAMESPACE -o jsonpath="{.items[0].metadata.name}")