-
Notifications
You must be signed in to change notification settings - Fork 1
133 lines (127 loc) · 5.75 KB
/
deploy_feature.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: Deploy feature
on:
push:
branches:
- '**'
- '!main'
- '!dependabot/**'
jobs:
build_and_deploy:
name: "Build and deploy to feature"
permissions:
contents: "read"
id-token: "write"
uses: navikt/bidrag-workflow/.github/workflows/deploy.yaml@main
secrets: inherit
with:
nais_variabler_filnavn: feature.yaml
nais_cluster: fss
run_cucumber:
runs-on: self-hosted
name: Run cucumber tests
needs: build_and_deploy
if: ${{ always() && needs.build_and_deploy.outputs.deploy_suksess == 'true' }}
env:
INGRESS_ARKIV: https://bidrag-dokument-arkiv-feature.dev.intern.nav.no
INGRESS_CUCUMBER: https://bidrag-cucumber-onprem-feature.dev.intern.nav.no
INGRESS_DOKARKIV: https://dokarkiv-q1.dev.intern.nav.no
INGRESS_DOKUMENT: https://bidrag-dokument-feature.dev.intern.nav.no
INGRESS_DOKUMENT_JOURNALPOST: https://bidrag-dokument-journalpost-feature.dev.intern.nav.no
INGRESS_TESTDATA: https://bidrag-testdata-feature.dev.intern.nav.no
INGRESS_OPPGAVE: https://oppgave-q1.dev.intern.nav.no
steps:
- name: "@bda-samt-bdj"
run: |
curl -X 'POST' '${{ env.INGRESS_CUCUMBER }}/bidrag-cucumber-onprem/run' -i \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{
"tags":["@bda-samt-bdj"],
"noContextPathForApps":["dokarkiv-api", "oppgave-api"],"ingressesForApps":[
"${{ env.INGRESS_ARKIV }}@bidrag-dokument-arkiv",
"${{ env.INGRESS_DOKARKIV }}@dokarkiv-api",
"${{ env.INGRESS_OPPGAVE }}@oppgave-api",
"${{ env.INGRESS_DOKUMENT }}@bidrag-dokument",
"${{ env.INGRESS_DOKUMENT_JOURNALPOST }}@bidrag-dokument-journalpost",
"${{ env.INGRESS_TESTDATA }}@bidrag-testdata"
]
}' | tee .cucumber-result
cat .cucumber-result | grep HTTP/1.1 | grep -c 200 > /dev/null # fails if count is 0 (http status is not ok, aka http status code is not 200)
- name: "@sakjournal"
run: |
curl -X 'POST' '${{ env.INGRESS_CUCUMBER }}/bidrag-cucumber-onprem/run' -i \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{
"tags":["@sakjournal"],
"ingressesForApps":["${{ env.INGRESS_DOKUMENT }}@bidrag-dokument"]
}' | tee .cucumber-result
cat .cucumber-result | grep HTTP/1.1 | grep -c 200 > /dev/null # fails if count is 0 (http status is not ok, aka http status code is not 200)
- name: "@avviksbehandling"
run: |
curl -X 'POST' '${{ env.INGRESS_CUCUMBER }}/bidrag-cucumber-onprem/run' -i \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{
"tags":["@avviksbehandling"],
"ingressesForApps":[
"${{ env.INGRESS_DOKUMENT }}@bidrag-dokument",
"${{ env.INGRESS_TESTDATA }}@bidrag-testdata"
]
}' | tee .cucumber-result
cat .cucumber-result | grep HTTP/1.1 | grep -c 200 > /dev/null # fails if count is 0 (http status is not ok, aka http status code is not 200)
- name: "@bdok-journalpost"
run: |
curl -X 'POST' '${{ env.INGRESS_CUCUMBER }}/bidrag-cucumber-onprem/run' -i \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{
"tags":["@bdok-journalpost"],
"ingressesForApps":[
"${{ env.INGRESS_DOKUMENT }}@bidrag-dokument",
"${{ env.INGRESS_TESTDATA }}@bidrag-testdata"
]
}' | tee .cucumber-result
cat .cucumber-result | grep HTTP/1.1 | grep -c 200 > /dev/null # fails if count is 0 (http status is not ok, aka http status code is not 200)
- name: "@bdok-mottaksregistrert"
run: |
curl -X 'POST' '${{ env.INGRESS_CUCUMBER }}/bidrag-cucumber-onprem/run' -i \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{
"tags":["@bdok-mottaksregistrert"],
"ingressesForApps":[
"${{ env.INGRESS_DOKUMENT }}@bidrag-dokument",
"${{ env.INGRESS_TESTDATA }}@bidrag-testdata"
]
}' | tee .cucumber-result
cat .cucumber-result | grep HTTP/1.1 | grep -c 200 > /dev/null # fails if count is 0 (http status is not ok, aka http status code is not 200)
- name: "@bdok-mot-avvik-*"
run: |
curl -X 'POST' '${{ env.INGRESS_CUCUMBER }}/bidrag-cucumber-onprem/run' -i \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{
"tags":[
"@bdok-mot-avvik-best-org", "@bdok-mot-avvik-best-reskan", "@bdok-mot-avvik-best-splitt",
"@bdok-mot-avvik-endre-fagomrade", "@bdok-mot-avvik-inn2ut"
],
"noContextPathForApps":["dokarkiv-api", "oppgave-api"], "ingressesForApps":[
"${{ env.INGRESS_DOKARKIV }}@dokarkiv-api",
"${{ env.INGRESS_OPPGAVE }}@oppgave-api",
"${{ env.INGRESS_DOKUMENT }}@bidrag-dokument",
"${{ env.INGRESS_TESTDATA }}@bidrag-testdata"
]
}' | tee .cucumber-result
cat .cucumber-result | grep HTTP/1.1 | grep -c 200 > /dev/null # fails if count is 0 (http status is not ok, aka http status code is not 200)
remove_files_from_workspace:
name: Remove files from workspace
runs-on: self-hosted
needs: run_cucumber
if: ${{ always() }}
steps:
- name: Remove files from workspace
run: |
cd $RUNNER_WORKSPACE
echo deleting files in $RUNNER_WORKSPACE
sudo rm -rf *