forked from DefectDojo/django-DefectDojo
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (49 loc) · 1.97 KB
/
fetch-oas.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
name: Fetch OpenAPI Specifications
on:
workflow_call:
inputs:
version:
type: string
description: |
The version to be associated with the GitHub release that's created or updated.
This will override any version calculated by the release-drafter.
required: true
env:
release_version: ${{ github.event.inputs.version || github.event.inputs.release_number }}
jobs:
oas_fetch:
name: Fetch OpenAPI Specifications
runs-on: ubuntu-latest
strategy:
matrix:
file-type: [yaml, json]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: release/${{ env.release_version }}
- name: Load docker images
run: |-
docker pull defectdojo/defectdojo-django:${{ env.release_version }}-alpine
docker pull defectdojo/defectdojo-nginx:${{ env.release_version }}-alpine
docker images
- name: Start Dojo
run: docker-compose --profile postgres-redis --env-file ./docker/environments/postgres-redis.env up --no-deps -d postgres nginx uwsgi
env:
DJANGO_VERSION: ${{ env.release_version }}-alpine
NGINX_VERSION: ${{ env.release_version }}-alpine
- name: Download OpenAPI Specifications
run: |-
wget 'http://localhost:8080/api/v2/oa3/schema/?format=${{ matrix.file-type }}' -O oas.${{ matrix.file-type }} --tries=10 --retry-on-http-error=502
- name: Logs
if: always()
run: docker-compose --profile postgres-redis --env-file ./docker/environments/postgres-redis.env logs --tail="2500"
- name: Shutdown
if: always()
run: docker-compose --profile postgres-redis --env-file ./docker/environments/postgres-redis.env down
- name: Upload oas.${{ matrix.file-type }} as artifact
uses: actions/upload-artifact@v3
with:
name: oas-${{ matrix.file-type }}
path: oas.${{ matrix.file-type }}
retention-days: 1