Skip to content

Commit

Permalink
Merge pull request #8 from ConductionNL/dev-barry
Browse files Browse the repository at this point in the history
Updated with pc, datamodel and postman tests added.
  • Loading branch information
rubenvdlinde authored Jan 7, 2020
2 parents 38719e7 + b1ba5f7 commit 6795406
Show file tree
Hide file tree
Showing 41 changed files with 9,679 additions and 1,840 deletions.
18 changes: 11 additions & 7 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@ APP_BUILD=dev
# The description for this api
APP_DESCRIPTION='Naast deze JSON rest API is er ook een [graphql](/graphql) interface beschikbaar.'


APP_LOGO=pc.zaakonline.nl
APP_HOME=pc.zaakonline.nl

# The urls on wich this api is available
TRUSTED_PROXIES=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
TRUSTED_HOSTS=^(.+\.)?conduction\.nl$|^(.+\.)?vng\.cloud$|^(.+\.)?huwelijksplanner\.online$|^(.+\.)?larping\.eu$|^(.+\.)?common-ground\.dev$|^(.+\.)?trouwplanner\.online$|^(.+\.)?zaakonline\.nl$|localhost
TRUSTED_HOSTS=^(.+\.)?conduction\.nl$|^(.+\.)?huwelijksplanner\.online$|^(.+\.)?larping\.eu$|^(.+\.)?common-ground\.dev$|^(.+\.)?trouwplanner\.online$|^(.+\.)?zaakonline\.nl$|localhost

##################################################
# Orgization details
Expand All @@ -44,12 +48,12 @@ ORGANIZATION_UNIT_NAME=Common-Ground
# Documentation settings
##################################################

# The primary domain for this API @depracticed
APP_DOMAIN=conduction.nl
# The subdomain for this component (should be www for applications)
APP_SUBDOMAIN=pc
# he domains on wich you want to provide this component, the first wil be used as primary (or common in cert-manger terms)
APP_DOMAINS=["conduction.nl","vng.cloud","zaakonline.nl","larping.eu","common-ground.dev","trouwplanner.online","huwelijksplanner.online"]
# If set to true wil provide the component on an {APP_NAME}.{APP_DOMAIN} basis for production enviroment, and {APP_NAME}.{APP_ENV}.{APP_DOMAIN} basis for other enviroments. Wil skipp the {APP_NAME}. on both if set to false
APP_USE_NAME_AS_SUBDOMAIN=true
APP_DOMAINS=["conduction.nl","zaakonline.nl","huwelijksplanner.online","common-ground.dev"]


# The demo enviroment for this component @depracticed
APP_DEMO=pc.zaakonline.nl
# he Repository for this component
Expand Down Expand Up @@ -77,7 +81,7 @@ NOTIFICATION_ENABLED_AUTHORIZATION=sasd
##################################################

AUTH_ENABLED=false
AUTH_PROVIDER=sasd
AUTH_PROVIDER=sasdadad
AUTH_AUTHORIZATION=sasd

##################################################
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Pulling old images, if any
run: docker-compose pull --ignore-pull-failures
- name: Setting APP_NAME
run: |
export NAME=$(grep APP_NAME= .env | cut -d '=' -f2)
Expand All @@ -36,6 +34,7 @@ jobs:
if: contains( github.ref, 'master' ) || contains( github.base_ref, 'master' )
run: |
echo ::set-env name=APP_ENV::prod
echo ::set-env name=APP_BUILD::prod
echo "set APP_ENV to $APP_ENV"
- name: Set APP_BUILD to APP_VERSION
if: contains( github.ref, 'master' )
Expand All @@ -55,18 +54,21 @@ jobs:
run: docker-compose build --pull --build-arg APP_ENV=$APP_ENV --build-arg APP_BUILD=$APP_BUILD
- name: Run the docker image
run: docker-compose up -d
- name: Taking some sleep
run: sleep 100
- name: Taking some sleep (for containers to come up)
run: sleep 200
- name: Check if all containers are running
run: docker ps
- name: Dumping the logs
run: docker-compose logs
- name: Security Checks
run: docker-compose exec -T php composer req sensiolabs/security-checker
- name: Database Update
run: docker-compose exec -T php bin/console doctrine:schema:update --force
- name: Database Check
run: docker-compose exec -T php bin/console doctrine:schema:validate
#- name: Taking some more sleep (for database to be updated)
# run: sleep 20
#- 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

- name: Chores
run: docker-compose down
- name: Login to DockerHub Registry
Expand Down
375 changes: 0 additions & 375 deletions .idea/workspace.xml

This file was deleted.

1 change: 1 addition & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# AUTHORS
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Het "betalen" component is ontwikkeld voor de gemeente Utrecht en heeft als doel
- [contributing](https://github.com/ConductionNL/betalencomponent/blob/master/CONTRIBUTING.md) for tips tricks and general rules concerning contributing to this component.
- [codebase](https://github.com/ConductionNL/betalencomponent) on github.
- [codebase](https://github.com/ConductionNL/betalencomponent/archive/master.zip) as a download.
- [Datamodel of this component](api/public/schema/datamodel.pdf)
- [Postman tests of this component](api/public/schema/bc.postman_collection.json)

Getting started
-------
Expand Down
1 change: 1 addition & 0 deletions ROADMAP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Roadmap
10 changes: 2 additions & 8 deletions TUTORIAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,15 +307,9 @@ More information on using data fixtures can be found at the [symfony website](ht
## Sharing your work
A vital part of te common ground community is sharing your work, and telling other people what you are working. This way people can help you with problems that you run into. And keep tabs on any (security) updates that you make to you code. Sounds like a lot of work right?

Wel it actually isn't, there is a specific common ground platform over at common-ground.dev that reads repositories and updates user. So the only thing we need to do is tell this platform that we have started a new common ground repository. And tell it when we have updates ours. We can do all that by simply adding a webhook to our component.
Wel it actually isn't, there is a specific common ground platform over at common-ground.dev that reads repositories and updates user. So the only thing we need to do is tell this platform that we have started a new common ground repository. How do we do that? Simple we use the name common ground (or commonground) in the discription of our repository. common-ground.dev should then pick up our repository within the hour.

When using Github. To set up a webhook, go to the settings page of your repository or organization. From there, click Webhooks, then Add webhook. Use te following settings:
* Payload URL: https://www.common-ground.dev/webhook/github
* Content type: Application/JSON
* Secret: [leave blanck]
* Events: [just the push event]

Now every time you update your repository the commonground dev page will alerted, rescan your repository and do al the appropriate platform actions. It just as easy as that.
Another option that we have is to declare our repository on [publiccode](), to do this you need to copy the publiccode.yaml from the [api/public/schema](api/public/schema]) folder to your root folder (dont forget to redo this every time you make a major change to your repository concerning versioning or licencing).


Continues integration
Expand Down
21 changes: 13 additions & 8 deletions admin/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2602,7 +2602,7 @@ [email protected]:
resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf"
integrity sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==

commander@^2.11.0, commander@^2.19.0, commander@^2.20.0, commander@~2.20.0:
commander@^2.11.0, commander@^2.19.0, commander@^2.20.0:
version "2.20.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422"
integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==
Expand All @@ -2612,6 +2612,11 @@ commander@~2.19.0:
resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a"
integrity sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==

commander@~2.20.3:
version "2.20.3"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33"
integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==

common-tags@^1.4.0:
version "1.8.0"
resolved "https://registry.yarnpkg.com/common-tags/-/common-tags-1.8.0.tgz#8e3153e542d4a39e9b10554434afaaf98956a937"
Expand Down Expand Up @@ -4545,9 +4550,9 @@ handle-thing@^2.0.0:
integrity sha512-d4sze1JNC454Wdo2fkuyzCr6aHcbL6PGGuFAz0Li/NcOm1tCHGnWDRmJP85dh9IhQErTc2svWFEX5xHIOo//kQ==

handlebars@^4.0.3:
version "4.2.1"
resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.2.1.tgz#dc69c0e61604224f0c23b38b5b6741db210b57da"
integrity sha512-bqPIlDk06UWbVEIFoYj+LVo42WhK96J+b25l7hbFDpxrOXMphFM3fNIm+cluwg4Pk2jiLjWU5nHQY7igGE75NQ==
version "4.5.3"
resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.5.3.tgz#5cf75bd8714f7605713511a56be7c349becb0482"
integrity sha512-3yPecJoJHK/4c6aZhSvxOyG4vJKDshV36VHp0iVCDVh7o9w2vwi3NSnL2MMPj3YdduqaBcu7cGbggJQM0br9xA==
dependencies:
neo-async "^2.6.0"
optimist "^0.6.1"
Expand Down Expand Up @@ -10318,11 +10323,11 @@ [email protected]:
source-map "~0.6.1"

uglify-js@^3.1.4:
version "3.6.0"
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.6.0.tgz#704681345c53a8b2079fb6cec294b05ead242ff5"
integrity sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg==
version "3.7.3"
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.7.3.tgz#f918fce9182f466d5140f24bb0ff35c2d32dcc6a"
integrity sha512-7tINm46/3puUA4hCkKYo4Xdts+JDaVC9ZPRcG8Xw9R4nhO/gZgUM3TENq8IF4Vatk8qCig4MzP/c8G4u2BkVQg==
dependencies:
commander "~2.20.0"
commander "~2.20.3"
source-map "~0.6.1"

unicode-canonical-property-names-ecmascript@^1.0.4:
Expand Down
9 changes: 3 additions & 6 deletions api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ ARG APP_ENV=prod

# prevent the reinstallation of vendors at every changes in the source code
COPY composer.json composer.lock symfony.lock ./

RUN set -eux; \
composer install --prefer-dist --no-dev --no-scripts --no-progress --no-suggest; \
composer clear-cache
Expand All @@ -105,11 +106,9 @@ RUN set -eux; \
composer dump-autoload --classmap-authoritative --no-dev; \
composer run-script --no-dev post-install-cmd; \
chmod +x bin/console; sync

VOLUME /srv/api/var

# Now that we have our own composer lets update
RUN composer update --no-interaction

COPY docker/php/docker-entrypoint.sh /usr/local/bin/docker-entrypoint
RUN chmod +x /usr/local/bin/docker-entrypoint

Expand All @@ -118,16 +117,14 @@ CMD ["php-fpm"]

# Let update the docs to show the latest chages
# RUN bin/console api:swagger:export --output=/srv/api/public/schema/openapi.yaml --yaml --spec-version=3
# RUN bin/console app:publiccode:update --location=/srv/api/public/schema/ --spec-version=0.2

#############################
# "nginx" stage #
#############################
# depends on the "php" stage above, and with an litle bit of help from https://github.com/shiphp/nginx-env
FROM shiphp/nginx-env AS api_platform_nginx

# We use our own more secure and limited config
#ONBUILD ADD docker/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf

# Due to our config we need a copy of the public folder for serving static content
COPY docker/nginx/conf.d/default.conf.template /etc/nginx/conf.d/default.conf
WORKDIR /srv/api
Expand Down
11 changes: 7 additions & 4 deletions api/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
"api-platform/api-pack": "^1.1",
"conduction/commongroundbundle": "dev-master",
"doctrine/doctrine-fixtures-bundle": "^3.2",
"doctrine/rst-parser": "^0.1.0",
"guzzlehttp/guzzle": "^6.3",
"knplabs/knp-markdown-bundle": "^1.8",
"lexik/jwt-authentication-bundle": "^2.6",
"phpdocumentor/reflection-docblock": "^4.3",
"ramsey/uuid": "^3.8",
Expand All @@ -21,14 +23,15 @@
"symfony/flex": "^1.1",
"symfony/framework-bundle": "4.3.*",
"symfony/mercure-bundle": "*",
"symfony/property-access": "4.4.*",
"symfony/yaml": "4.3.*",
"tbbc/money-bundle": "^3.1",
"webonyx/graphql-php": "^0.13.8"
},
"require-dev" : {
"api-platform/schema-generator" : "^2.1",
"symfony/maker-bundle" : "^1.11",
"symfony/profiler-pack" : "^1.0"
"api-platform/schema-generator": "^2.1",
"symfony/maker-bundle": "^1.11",
"symfony/profiler-pack": "^1.0"
},
"config" : {
"preferred-install" : {
Expand Down Expand Up @@ -60,7 +63,7 @@
"extra" : {
"symfony" : {
"allow-contrib" : false,
"require" : "4.3.*"
"require" : "4.4.*"
}
},
"scripts": {
Expand Down
Loading

0 comments on commit 6795406

Please sign in to comment.