Skip to content

Commit

Permalink
Merge pull request #9 from ConductionNL/development
Browse files Browse the repository at this point in the history
Bijwerken omgeving
  • Loading branch information
rubenvdlinde authored Jan 8, 2020
2 parents e21519f + e983216 commit 6f1e583
Show file tree
Hide file tree
Showing 75 changed files with 11,877 additions and 2,459 deletions.
93 changes: 75 additions & 18 deletions .env
Original file line number Diff line number Diff line change
@@ -1,62 +1,119 @@
##################################################
#
# General settings for your component
#
# General settings for your component
#
##################################################

##################################################
# Enviroment settings
##################################################

# Depracticed, now set as CONTAINER_PROJECT_NAME
APP_NAME=pc
# Do you want to dsiplay the symfony debug toolbar?
# The shortcode for this component, should be a small set of letters reprecentint the application
APP_NAME=bc
# The Full title of the application
APP_TITLE=Proto Component
# The current version of the application
APP_VERSION=V.0.1
# Do you want to display the symfony debug toolbar?
APP_DEBUG=1
# What is the enviroment type you want to use for local production? (choose between dec,stag,prod, acce or test)
APP_ENV=dev
# We use a build to tag images, this is swithced to the version on master and to env on other branches
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$|^(.+\.)?huwelijksplanner\.online$|^(.+\.)?larping\.eu$|^(.+\.)?common-ground\.dev$|^(.+\.)?trouwplanner\.online$|^(.+\.)?zaakonline\.nl$|localhost

##################################################
# Orgization details
##################################################

# The following details describe your organisations and are used for both certificate creation, nlx (if active) and common-ground.dev

ORGANIZATION_NAME=Conduction
ORGANIZATION_EMAIL_ADDRESS=[email protected]
ORGANIZATION_COUNTRY_NAME=Netherlands
ORGANIZATION_STATE=Noord-Holland
ORGANIZATION_LOCALITY=Amsterdam
ORGANIZATION_UNIT_NAME=Common-Ground

##################################################
# Documentation settings
##################################################

APP_DEMO=dev
APP_REPRO=dev
# 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","zaakonline.nl","huwelijksplanner.online","common-ground.dev"]


# The demo enviroment for this component @depracticed
APP_DEMO=pc.zaakonline.nl
# he Repository for this component
APP_REPRO=https://github.com/ConductionNL/Proto-component-commonground

##################################################
# Docker settings
##################################################

CONTAINER_REGISTRY_BASE=docker.io/conduction
CONTAINER_PROJECT_TITLE=Proto Component
CONTAINER_PROJECT_NAME=pc
CONTAINER_PROJECT_VERSION=V.0.1
CONTAINER_PROJECT_NAME=bc
# The repository for the primary (php) container of this project
CONTAINER_REPRO=https://hub.docker.com/repository/docker/conduction/pc-php

##################################################
# Websub settings
# Notifcation settings
##################################################

WEBSUB_PROVIDER=sasd
WEBSUB_AUTHORIZATION=sasd
NOTIFICATION_ENABLED=falsedxfddxf
NOTIFICATION_PROVIDER=sasdasd
NOTIFICATION_ENABLED_AUTHORIZATION=sasd

##################################################
# Authorization settings
##################################################

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

##################################################
# NLX Setup, read more at https://docs.nlx.io/get-started/#
# Auditrail settings
##################################################

AUDITTRAIL_ENABLED=false

##################################################
# Healthcheck settings
##################################################

HEALTH_ENABLED=false

##################################################
# Archive settings
##################################################

ARCHIVE_ENABLED=false

##################################################
# NLX Setup, read more at https://docs.nlx.io/get-started/#
##################################################

# Do you want to provide an nlx outway? (option for your component to reach nlx services)
NLX_OUTWAY=true
NLX_OUTWAY=true

# Do you want to provice an nlx inway (option for nlx services to reach your api)
NLX_INWAY=false
NLX_INWAY=false

# NLX Certification Details
NLX_COUNTRY_NAME=Netherlands
NLX_COUNTRY_NAME=Netherlands
NLX_STATE=Noord-Holland
NLX_LOCALITY=Amsterdam
NLX_ORGANIZATION_NAME=Conduction
Expand Down
Binary file added .github/IMAGES/travis activate repository.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/IMAGES/travis enviroment variables.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions .github/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# View examples and documentation at https://deliverybot.dev/docs/
production:
environment: production
production_environment: true
134 changes: 134 additions & 0 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
name: Docker Image CI

on:
pull_request:
branches:
- master
- staging
- development
push:
branches:
- master
- staging
- development

jobs:

build:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Setting APP_NAME
run: |
export NAME=$(grep APP_NAME= .env | cut -d '=' -f2)
echo ::set-env name=APP_NAME::$NAME
- name: Print app name
run: echo "APP_NAME = $APP_NAME"
- name: Setting APP_ENV to dev
run: |
echo ::set-env name=APP_ENV::dev
echo ::set-env name=APP_BUILD::dev
echo "set APP_ENV to $APP_ENV"
- name: Setting APP_ENV to prod
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' )
run: |
export VERSION=$(grep APP_VERSION= .env | cut -d '=' -f2)
echo ::set-env name=APP_BUILD::$VERSION
echo "set APP_BUILD to $APP_BUILD"
- name: Setting APP_ENV to stag
if: contains( github.ref, 'staging' ) || contains( github.base_ref, 'staging' )
run: |
echo ::set-env name=APP_ENV::stag
echo ::set-env name=APP_BUILD::stag
echo "set APP_ENV to $APP_ENV"
- name: Print definitive APP_ENV
run: echo "APP_ENV is now $APP_ENV"
- name: Build the Docker image
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 (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: Database Update
run: docker-compose exec -T php bin/console doctrine:schema:update --force
#- 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
id: dockerhub-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'
name: Push to docker hub
run: docker-compose push
- name: Create kube config
id: kubeconfig
if: contains( github.ref, 'master' ) || contains( github.ref, 'staging' ) || contains( github.ref, 'development' )
run: |
if [ "${{ secrets.KUBECONFIG }}" != "" ]; then
printf "${{ secrets.KUBECONFIG }}" > kubeconfig.yaml
echo "##[set-output name=success]true"
else
echo "##[set-output name=success]false"
fi
- name: Set correct helm version
if: (contains( github.ref, 'master' ) || contains( github.ref, 'staging' ) || contains( github.ref, 'development' )) && steps.kubeconfig.outputs.success == 'true'
run: helm init --upgrade --kubeconfig="kubeconfig.yaml"
- name: Deploy through helm
id: helm-install
if: (contains( github.ref, 'master' ) || contains( github.ref, 'staging' ) || contains( github.ref, 'development' )) && steps.kubeconfig.outputs.success == 'true'
run: helm upgrade $APP_NAME-$APP_ENV ./api/helm --kubeconfig="kubeconfig.yaml" --namespace=$APP_ENV --set settings.env=$APP_ENV,settings.debug=1
- name: Install through helm
if: failure() && (contains( github.ref, 'master' ) || contains( github.ref, 'staging' ) || contains( github.ref, 'development' )) && steps.kubeconfig.outputs.success == 'true'
run: helm install --name $APP_NAME-$APP_ENV ./api/helm --kubeconfig="kubeconfig.yaml" --namespace=$APP_ENV --set settings.env=$APP_ENV,settings.debug=1
- name: Rollout new containers
if: (contains( github.ref, 'master' ) || contains( github.ref, 'staging' ) || 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
env:
RELEASENAME: ${{ steps.releasecode.outputs.releasename }}
- name: Create Release
if: contains( github.ref, 'master' ) && steps.kubeconfig.outputs.success == 'true' && ( success() || failure() )
id: create_release
uses: actions/create-release@v1
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ steps.releasecode.outputs.releasename }}
release_name: ${{ steps.releasecode.outputs.releasename }}
draft: false
prerelease: false
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
api/helm/kubeconfig.yaml

!/api/public/bundle/*

.idea/
1 change: 1 addition & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# AUTHORS
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

## 2019-11-11 (v.0.0.1)

- Initial public release
Loading

0 comments on commit 6f1e583

Please sign in to comment.