Skip to content

Commit

Permalink
Readme update (badges + description)
Browse files Browse the repository at this point in the history
  • Loading branch information
rjzondervan committed Jun 23, 2021
1 parent 03082d9 commit ef12c51
Show file tree
Hide file tree
Showing 42 changed files with 5,198 additions and 1,636 deletions.
8 changes: 4 additions & 4 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
# The shortcode for this component, should be a small set of letters reprecentint the application (use only letters, capitals and spaces)
APP_NAME=verzoekregistratiecomponent

APP_NAME_TECHNICAL=verzoekregistratiecomponent
APP_NAME_TECHNCICAL=verzoekregistratiecomponent


# The description for this api
APP_DESCRIPTION=Het Verzoek Registratie Component bevat zowel het eind- als tussenresultaat van een proces. Of om het iets simpeler te zeggen een proces schrijft bij iedere stap zijn variabelen weg naar een verzoek. Daarmee is het proces stateless en het verzoek stateful. In deze zin is een verzoek vergelijkbaar met een proces token in bijvoorbeeld BPMN- engines. Hierdoor is het mogelijk om verzoeken uit te wisselen tussen processen. Het is bijvoorbeeld mogelijk om via een chatbot een proces te draaien dat het verzoektype verhuizen gebruikt om een verzoek aan te maken, maar het ondertekenen van dit verzoek te laten doen via het webformulier.
BADGES=[![StyleCI](https://github.styleci.io/repos/198549754/shield?branch=master)](https://github.styleci.io/repos/198549754?branch=master),[![Docker Image CI](https://github.com/ConductionNL/verzoekregistratiecomponent/workflows/Docker%20Image%20CI/badge.svg?branch=master)](https://github.com/ConductionNL/verzoekregistratiecomponent/actions?query=workflow%3A"Docker+Image+CI"),[![Artifacthub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/verzoekregistratiecomponent)](https://artifacthub.io/packages/helm/verzoekregistratiecomponent/verzoekregistratiecomponent),[![BCH compliance](https://bettercodehub.com/edge/badge/ConductionNL/verzoekregistratiecomponent?branch=master)](https://bettercodehub.com/),[![Status badge](https://shields.api-test.nl/endpoint.svg?style=for-the-badge&url=https%3A//api-test.nl/api/v1/provider-latest-badge/5065b0a6-0b20-4d75-bc9a-8275daa80092/)](https://api-test.nl/server/4/f33528be-acdc-445b-90d9-78c0c502c7c5/5065b0a6-0b20-4d75-bc9a-8275daa80092/latest/)

# The current version of the application
APP_VERSION=V1.0
APP_MAJOR_VERSION=v1
Expand Down Expand Up @@ -81,10 +82,9 @@ APP_REPRO=https://github.com/ConductionNL/verzoekregistratiecomponent
# Docker settings
##################################################

CONTAINER_REGISTRY_BASE=docker.io/conduction
CONTAINER_REGISTRY_BASE=ghcr.io/conductionnl
HELM_REPOSITORY=https://raw.githubusercontent.com/ConductionNL/verzoekregistratiecomponent/master/api/helm/
CONTAINER_PROJECT_NAME=verzoekregistratiecomponent

##################################################
# Notifcation settings
##################################################
Expand Down
71 changes: 47 additions & 24 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,41 +70,52 @@ jobs:
#- name: Database Check
# run: docker-compose exec -T php bin/console doctrine:schema:validate
- name: Security Checks
run: docker-compose exec -T php composer req sensiolabs/security-checker
run: |
curl -L -sS --output local-php-security-checker https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_amd64
chmod +x ./local-php-security-checker
./local-php-security-checker --path ./api/composer.lock
- uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
name: codecov-umbrella
fail_ci_if_error: true
verbose: true
#- name: Run Postman Tests
# if: contains( github.ref, 'master' ) == false && contains( github.base_ref, 'master' ) == false
# run: newman run api/public/schema/*.postman_collection.json
- name: Add docker tags
if: github.ref == 'refs/heads/master'
run: |
images=$(docker-compose images -q | xargs docker inspect --format='{{ index .RepoTags 0}}' | cut -d':' -f1 | grep $APP_NAME_TECHNICAL)
for image in $images
do
docker tag "${image}":latest "${image}":"${APP_BUILD}"
done
echo 'IMAGES=$images' >> $GITHUB_ENV
images=$(docker-compose images -q | xargs docker inspect --format='{{ index .RepoTags 0}}' | cut -d':' -f1 | grep $APP_NAME)
for image in $images
do
docker tag "${image}":latest "${image}":"${APP_BUILD}"
done
echo 'IMAGES=$images' >> $GITHUB_ENV
- name: Show all images
run: docker images
- name: Login to DockerHub Registry
id: dockerhub-login
- name: Login to Container Registry
id: containerregistry-login
run: |
if [ "${{ secrets.DOCKERHUB_PASSWORD }}" != "" ] && [ "${{ secrets.DOCKERHUB_USERNAME }}" != "" ]; then
echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
echo "##[set-output name=success;]true"
else
echo "##[set-output name=success;]false"
fi
- if: steps.dockerhub-login.outputs.success == 'true' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/development')
name: Push to docker hub
if [ "${{ secrets.GITHUB_TOKEN }}" != "" ]; then
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $(cut -d'/' -f1 <<< $GITHUB_REPOSITORY) --password-stdin
echo "##[set-output name=success;]true"
else
echo "##[set-output name=success;]false"
fi
- if: steps.containerregistry-login.outputs.success == 'true' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/development')
name: Push to Container Registry
run: docker-compose push
- if: steps.dockerhub-login.outputs.success == 'true' && github.ref == 'refs/heads/master'
name: Push versioned containers to Docker Hub

- if: steps.containerregistry-login.outputs.success == 'true' && github.ref == 'refs/heads/master'
name: Push versioned containers to Container Registry
run: |
images=$(docker-compose images -q | xargs docker inspect --format='{{ index .RepoTags 0}}' | cut -d':' -f1 | grep $APP_NAME)
for image in $images
do
docker push "${image}":"${APP_BUILD}"
done
images=$(docker-compose images -q | xargs docker inspect --format='{{ index .RepoTags 0}}' | cut -d':' -f1 | grep $APP_NAME)
for image in $images
do
docker push "${image}":"${APP_BUILD}"
done
- name: Create kube config
id: kubeconfig
if: contains( github.ref, 'development' )
Expand All @@ -115,6 +126,18 @@ jobs:
else
echo "##[set-output name=success]false"
fi
- name: Rollout new containers
if: (contains( github.ref, 'development' )) && steps.kubeconfig.outputs.success == 'true' && success()
run: |
kubectl rollout restart deployment/$APP_NAME-php --kubeconfig="kubeconfig.yaml" --namespace=$APP_ENV
kubectl rollout restart deployment/$APP_NAME-nginx --kubeconfig="kubeconfig.yaml" --namespace=$APP_ENV
kubectl rollout restart deployment/$APP_NAME-varnish --kubeconfig="kubeconfig.yaml" --namespace=$APP_ENV
# - name: Export release code
# if: (success() || failure())
# id: releasecode
# run: |
# export RELEASE=$APP_BUILD-$(git rev-parse --short $GITHUB_SHA)
# echo "##[set-output name=releasename]$RELEASE"
- name: Print release name
if: (success() || failure())
run: echo $RELEASENAME
Expand Down
25 changes: 25 additions & 0 deletions api/.bettercodehub.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
component_depth: 3
languages:
- php
exclude:
- /nlx-setup/.*
- /resources/.*
- /api/bin/.*
- /api/config/.*
- /api/docker/.*
- /api/docs/.*
- /api/helm/.*
- /api/migrations/.*
- /api/nlx-setup/.*
- /api/public/.*
- /api/templates/.*
- /api/translations/.*
- /api/var/.*
- /api/vendor/.*
- /api/src/Entity/.*
- /api/src/DataFixtures/.*
- /api/src/Repository/.*
- /api/src/Kernel.php
test:
include:
- /api/tests/TrouwServiceTest.php
6 changes: 6 additions & 0 deletions api/.env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# define your env variables for the test env here
KERNEL_CLASS='App\Kernel'
APP_SECRET='$ecretf0rt3st'
SYMFONY_DEPRECATIONS_HELPER=999999
PANTHER_APP_ENV=panther
PANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots
10 changes: 10 additions & 0 deletions api/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,13 @@
/.php_cs
/.php_cs.cache
###< friendsofphp/php-cs-fixer ###

###> phpunit/phpunit ###
/phpunit.xml
.phpunit.result.cache
###< phpunit/phpunit ###

###> symfony/phpunit-bridge ###
.phpunit.result.cache
/phpunit.xml
###< symfony/phpunit-bridge ###
22 changes: 5 additions & 17 deletions api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ COPY src src/
COPY templates templates/
COPY translations translations/

RUN apk add --no-cache $PHPIZE_DEPS \
&& pecl install xdebug-2.9.2 \
&& docker-php-ext-enable xdebug;\
echo -e "xdebug.overload_var_dump=off" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini

RUN set -eux; \
mkdir -p var/cache var/log; \
composer dump-autoload --classmap-authoritative --no-dev; \
Expand All @@ -55,23 +60,6 @@ CMD ["php-fpm"]



#############################
# "varnish" stage #
#############################
# does not depend on any of the above stages, but placed here to keep everything in one Dockerfile
#FROM conduction/pc-varnish:prod AS api_platform_varnish
#
#COPY docker/varnish/conf/default.vcl /etc/varnish/conf.d/
# Lets install envsubst
#RUN apk --no-cache add gettext

#COPY docker/varnish/conf /usr/local/etc/varnish/

#RUN envsubst '$PHP_SERVICE' < /usr/local/etc/varnish/default.vcl.template > /usr/local/etc/varnish/default.vcl

# Lets parse the toml file
# RUN envsubst < /usr/local/etc/varnish/default.vcl.template > /usr/local/etc/varnish/default.vcl

#############################
# NLX Outway #
#############################
Expand Down
3 changes: 3 additions & 0 deletions api/Dockerfile-nginx
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ FROM nginx:latest AS api_platform_nginx
COPY docker/nginx/conf.d/default.conf.template /etc/nginx/templates/default.conf.template
WORKDIR /srv/api
COPY public public/

RUN apt update; \
apt upgrade -y
19 changes: 19 additions & 0 deletions api/bin/phpunit
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php

if (!ini_get('date.timezone')) {
ini_set('date.timezone', 'UTC');
}

if (is_file(dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit')) {
define('PHPUNIT_COMPOSER_INSTALL', dirname(__DIR__).'/vendor/autoload.php');
require PHPUNIT_COMPOSER_INSTALL;
PHPUnit\TextUI\Command::main();
} else {
if (!is_file(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php')) {
echo "Unable to find the `simple-phpunit.php` script in `vendor/symfony/phpunit-bridge/bin/`.\n";
exit(1);
}

require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php';
}
25 changes: 16 additions & 9 deletions api/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,32 @@
"ext-ctype": "*",
"ext-iconv": "*",
"api-platform/api-pack": "^1.1",
"conduction/commongroundbundle": "dev-symfony51",
"phpdocumentor/reflection-docblock": "^4.3",
"conduction/commongroundbundle": "^2.*-dev",
"phpdocumentor/reflection-docblock": "^5.1",
"sensio/framework-extra-bundle": "^5.5",
"sensiolabs/security-checker": "^6.0",
"symfony/asset": "5.1.*",
"symfony/console": "5.1.*",
"symfony/dotenv": "5.1.*",
"symfony/asset": "^5.1",
"symfony/console": "5.1",
"symfony/dotenv": "^5.1",
"symfony/flex": "^1.1",
"symfony/framework-bundle": "5.1.*",
"symfony/framework-bundle": "^5.1",
"symfony/mercure-bundle": "*",
"symfony/property-access": "5.1.*",
"symfony/translation": "5.1.*",
"symfony/yaml": "5.1.*",
"symfony/property-access": "^5.1",
"symfony/translation": "^5.1",
"symfony/yaml": "^5.1",
"tbbc/money-bundle": "^4.0",
"webonyx/graphql-php": "^0.13.8"
},
"require-dev" : {
"api-platform/schema-generator": "^2.1",
"phar-io/manifest": "^2.0.1",
"phar-io/version": "^3.0.1",
"phpspec/prophecy": "^1.11.1",
"phpunit/php-code-coverage": "^9",
"phpunit/phpunit": "^9.3",
"sebastian/global-state": "^5.0",
"symfony/maker-bundle": "^1.11",
"symfony/phpunit-bridge": "^5.1",
"symfony/profiler-pack": "^1.0"
},
"config" : {
Expand Down
Loading

0 comments on commit ef12c51

Please sign in to comment.