Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stable into master #87

Merged
merged 41 commits into from
Aug 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
fd13ab6
Enable UWSGI HTTP KeepAlive
stevenbal Dec 20, 2019
6d25130
Updated documentation URL references in API schema
stevenbal Mar 30, 2020
6e97082
:green_heart: Fix Docker push in Travis
stevenbal Oct 26, 2020
e89777d
:wrench: Add GitHub workflows for API validation
stevenbal Oct 26, 2020
594d691
:memo: Add GitHub workflow badges to README
stevenbal Oct 26, 2020
9fea563
Merge pull request #55 from stevenbal/issue/timeouts
joeribekker Oct 27, 2020
69f64ab
Merge pull request #58 from stevenbal/issue/deprecated-links
joeribekker Oct 27, 2020
6f2b43f
Merge pull request #68 from VNG-Realisatie/feature/github-workflows
joeribekker Oct 27, 2020
0d47813
Merge pull request #67 from VNG-Realisatie/issue/fix-docker-travis
joeribekker Oct 27, 2020
02c8f0a
:pencil: Updated README.
joeribekker Oct 27, 2020
247517e
:memo: Change references to travis-ci.org -> travis-ci.com
stevenbal Dec 7, 2020
e3d2fc2
:memo: Add API spec version 1.0.x to README
stevenbal Dec 7, 2020
888eb1c
Merge branch 'master' into stable/1.0.x
stevenbal Dec 7, 2020
ee8df99
Revert "Merge branch 'master' into stable/1.0.x"
stevenbal Dec 7, 2020
c0bd5ed
:bug: Show API_VERSION and GIT_SHA on component dashboard
stevenbal Dec 11, 2020
de24f12
:arrow_up: Bump vng-api-common to 1.0.53
stevenbal Dec 11, 2020
694da67
:wrench: Add necessary settings for autorisaties/notificaties.md gene…
stevenbal Dec 11, 2020
02db155
:wrench: Add autorisaties.md and notificaties.md
stevenbal Dec 11, 2020
78eb39a
:memo: Link to autorisaties.md and notificaties.md in README
stevenbal Dec 11, 2020
0d8b7b5
Merge pull request #73 from VNG-Realisatie/issue/dashboard-github
stevenbal Dec 11, 2020
0474dce
Merge pull request #69 from VNG-Realisatie/issue/travis-ci-migration
stevenbal Dec 11, 2020
59c7915
:arrow_up: Bump isort to 5.6.4
stevenbal Dec 14, 2020
c4e9c7e
:construction_worker: Move CI to github actions
stevenbal Dec 14, 2020
e6502a1
Merge pull request #74 from VNG-Realisatie/feature/github-actions
joeribekker Dec 21, 2020
0a1ee51
Merge pull request #71 from VNG-Realisatie/feature/update-readme
joeribekker Dec 21, 2020
ad480ed
:arrow_up: Bump vng-api-common to 1.0.56
stevenbal Dec 22, 2020
6033609
:memo: Generate schema with vng-api-common==1.0.56
stevenbal Dec 22, 2020
cab0303
:pencil: Rename besluitregistratiecomponent -> Besluiten API
stevenbal Dec 23, 2020
58e3b91
:art: Sort imports
stevenbal Dec 23, 2020
83f6b87
:arrow_up: Bump pip-tools to 5.4.0 and add black to requirements
stevenbal Dec 23, 2020
b4b0322
:art: Format with black
stevenbal Dec 23, 2020
7aafc29
Merge pull request #79 from VNG-Realisatie/feature/bump-vng-api-common
joeribekker Dec 23, 2020
a29cdcf
:green_heart: Add DEPLOY_BOT_TOKEN to docker push workflow
stevenbal Jan 8, 2021
cf66d57
Merge pull request #82 from VNG-Realisatie/issue/fix-ci-push
stevenbal Jan 8, 2021
8d47e97
:memo: Display COMMIT_HASH on API dashboard
stevenbal Jan 8, 2021
bc35bb8
Merge pull request #83 from VNG-Realisatie/issue/dashboard-hash
stevenbal Jan 8, 2021
c2958f1
Merge remote-tracking branch 'origin/stable/1.0.x' into stable_into_m…
MatthijsBekendam Aug 11, 2022
a57eaf6
removed pip-tools dependency
MatthijsBekendam Aug 11, 2022
3631fc0
migrations and requirements
MatthijsBekendam Aug 11, 2022
80481d6
spectral
MatthijsBekendam Aug 11, 2022
0237afe
factory-boy to test.in
MatthijsBekendam Aug 15, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
149 changes: 149 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
name: ci-build

# Run this workflow every time a new commit pushed to your repository
on:
push:
branches:
- master
- stable/1.0.x
tags:
- '*'
pull_request:
workflow_dispatch:

env:
IMAGE_NAME: vngr/gemma-brc
DJANGO_SETTINGS_MODULE: brc.conf.jenkins
SECRET_KEY: dummy
DB_USER: postgres
DB_PASSWORD: ''
DEPLOYMENT: brc

jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
postgres: ['10', '11', '12']

name: Tests (PG ${{ matrix.postgres }})

services:
postgres:
image: postgres:${{ matrix.postgres }}
env:
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5432:5432

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.6'
- uses: actions/setup-node@v2-beta
with:
node-version: '12'

# - name: Install system packages
# run: sudo apt-get install libgdal-dev gdal-bin

- name: Install dependencies
run: pip install -r requirements/jenkins.txt codecov

- name: Build frontend
run: |
npm ci
npm run build
- name: Run tests
run: |
python src/manage.py collectstatic --noinput --link
coverage run src/manage.py test src

- name: Publish coverage report
uses: codecov/codecov-action@v1

docker:
runs-on: ubuntu-latest
name: Docker image build

steps:
- uses: actions/checkout@v2
- name: Determine tag/commit hash
id: vars
run: |
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name (if present at all)
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && VERSION=latest
echo ::set-output name=tag::${VERSION}
echo ::set-output name=git_hash::${GITHUB_SHA}
- name: Build the Docker image
run: |
docker build . \
--build-arg COMMIT_HASH=${{ steps.vars.outputs.git_hash }}
# - run: docker image save -o image.tar $IMAGE_NAME:${{ steps.vars.outputs.tag }}
# - name: Store image artifact
# uses: actions/upload-artifact@v2
# with:
# name: docker-image
# path: image.tar
# retention-days: 1

publish:
needs:
- tests
- docker

name: Push Docker image
runs-on: ubuntu-latest
if: github.event_name == 'push' # exclude PRs/forks

steps:
- uses: actions/checkout@v2
# - name: Download built image
# uses: actions/download-artifact@v2
# with:
# name: docker-image
- name: Publish latest image
env: # Or as an environment variable
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
DEPLOY_BOT_TOKEN: ${{ secrets.DEPLOY_BOT_TOKEN }}
run: |
BRANCH=$(git rev-parse --abbrev-ref HEAD)
if [ "$BRANCH" == "master" ]; then
bash bin/cicd.sh latest no
fi

- name: Publish tagged image
env: # Or as an environment variable
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
DEPLOY_BOT_TOKEN: ${{ secrets.DEPLOY_BOT_TOKEN }}
run: |
TAG=$(git name-rev --tags --name-only $(git rev-parse HEAD))
if [ "$TAG" != "undefined" ]; then
bash bin/cicd.sh $TAG yes
fi

# - name: Determine tag/commit hash
# id: vars
# run: |
# # Strip git ref prefix from version
# VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# # Strip "v" prefix from tag name (if present at all)
# [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# # Use Docker `latest` tag convention
# [ "$VERSION" == "develop" ] && VERSION=latest
# echo ::set-output name=tag::${VERSION}
# - name: Load image
# run: |
# docker image load -i image.tar
# - name: Log into registry
# run: echo "${{ secrets.DOCKER_TOKEN }}" | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin

# - name: Push the Docker image
# run: docker push $IMAGE_NAME:${{ steps.vars.outputs.tag }}
43 changes: 43 additions & 0 deletions .github/workflows/code_quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Code quality checks

# Run this workflow every time a new commit pushed to your repository
on:
push:
branches:
- master
- stable/1.0.x
paths:
- '**.py'
pull_request:
paths:
- '**.py'
workflow_dispatch:

jobs:
isort:
name: Code imports
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.6'
- name: Install dependencies
run: pip install -r requirements/jenkins.txt
- name: Run isort
run: isort --check-only --diff .

black:
name: Code format
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.6'
- name: Install dependencies
run: pip install -r requirements/jenkins.txt
- name: Run black
run: black --check --diff src docs
26 changes: 26 additions & 0 deletions .github/workflows/generate-postman-collection.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: generate-postman-collection

on:
push:
paths:
- "src/openapi.yaml"
- ".github/workflows/generate-postman-collection.yml"
branches:
- '**'
workflow_dispatch:

jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '12'
- name: Install dependencies
run: npm install -g openapi-to-postmanv2
- name: Create tests folder
run: mkdir -p ./tests/postman
- name: Generate Postman collection
run: openapi2postmanv2 -s ./src/openapi.yaml -o ./tests/postman/collection.json --pretty
36 changes: 36 additions & 0 deletions .github/workflows/generate-sdks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: generate-sdks

on:
push:
paths:
- "src/openapi.yaml"
- ".github/workflows/generate-sdks.yml"
branches:
- '**'
workflow_dispatch:

jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '12'
- name: Install dependencies
run: npm install -g @openapitools/openapi-generator-cli
- name: Validate schema
run: openapi-generator-cli validate -i ./src/openapi.yaml
- name: Generate Java client
run: openapi-generator-cli generate -i ./src/openapi.yaml --global-property=modelTests=false,apiTests=false,modelDocs=false,apiDocs=false \
-o ./sdks/java -g java --additional-properties=dateLibrary=java8,java8=true,optionalProjectFile=false,optionalAssemblyInfo=false
- name: Generate .NET Core client
run: openapi-generator-cli generate -i ./src/openapi.yaml --global-property=modelTests=false,apiTests=false,modelDocs=false,apiDocs=false \
-o ./sdks/netcore -g csharp-netcore --additional-properties=optionalProjectFile=false,optionalAssemblyInfo=false
- name: Generate .NET Full Framework client
run: openapi-generator-cli generate -i ./src/openapi.yaml --global-property=modelTests=false,apiTests=false,modelDocs=false,apiDocs=false \
-o ./sdks/net -g csharp --additional-properties=optionalProjectFile=false,optionalAssemblyInfo=false
- name: Generate Python client
run: openapi-generator-cli generate -i ./src/openapi.yaml --global-property=modelTests=false,apiTests=false,modelDocs=false,apiDocs=false \
-o ./sdks/python -g python --additional-properties=optionalProjectFile=false,optionalAssemblyInfo=false+
24 changes: 24 additions & 0 deletions .github/workflows/lint-oas.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: lint-oas

on:
push:
paths:
- src/openapi.yaml
- .github/workflows/lint-oas.yml
branches:
- '**'
workflow_dispatch:

jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '12'
- name: Install spectral
run: npm install -g @stoplight/spectral
- name: Run OAS linter
run: spectral lint ./src/openapi.yaml
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,8 @@ local.py
.env

docs/_build

# Statics generated by Workflows
/tests/postman
/sdks/
openapitools.json
1 change: 1 addition & 0 deletions .spectral.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extends: spectral:oas
55 changes: 0 additions & 55 deletions .travis.yml

This file was deleted.

5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ COPY ./bin/runtests.sh /runtests.sh
COPY --from=frontend-build /app/src/brc/static/fonts /app/src/brc/static/fonts
COPY --from=frontend-build /app/src/brc/static/css /app/src/brc/static/css
COPY ./src /app/src
ARG COMMIT_HASH
ENV GIT_SHA=${COMMIT_HASH}

RUN mkdir /app/log && rm /app/src/brc/conf/test.py
CMD ["/runtests.sh"]

Expand Down Expand Up @@ -94,6 +97,8 @@ COPY --from=frontend-build /app/src/brc/static/fonts /app/src/brc/static/fonts
COPY --from=frontend-build /app/src/brc/static/css /app/src/brc/static/css
COPY ./src /app/src
COPY ./docs /app/docs
ARG COMMIT_HASH
ENV GIT_SHA=${COMMIT_HASH}

ENV DJANGO_SETTINGS_MODULE=brc.conf.docker

Expand Down
Loading