Skip to content

Commit

Permalink
Merge branch 'staging'
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenvdlinde committed Nov 27, 2019
2 parents e0a9eaf + 95de137 commit f5307e8
Show file tree
Hide file tree
Showing 39 changed files with 1,901 additions and 1,243 deletions.
43 changes: 34 additions & 9 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -8,43 +8,68 @@
# Enviroment settings
##################################################

# Depracticed, now set as CONTAINER_PROJECT_NAME
# The shortcode for this component, should be a small set of letters reprecentint the application
APP_NAME=pc
# Do you want to dsiplay the symfony debug toolbar?
# 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
# The description for this api
APP_DESCRIPTION='Naast deze JSON rest API is er ook een [graphql](/graphql) interface beschikbaar.'

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

APP_DEMO=dev
APP_REPRO=dev
APP_DEMO=pc.zaakonline.nl
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_REPRO=https://hub.docker.com/repository/docker/conduction/pc-php

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

WEBSUB_PROVIDER=sasd
WEBSUB_AUTHORIZATION=sasd
NOTIFICATION_ENABLED=false
NOTIFICATION_PROVIDER=sasd
NOTIFICATION_ENABLED_AUTHORIZATION=sasd

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

AUTH_ENABLED=false
AUTH_PROVIDER=sasd
AUTH_AUTHORIZATION=sasd

##################################################
# 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/#
##################################################
Expand Down
60 changes: 44 additions & 16 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,26 @@ jobs:
build:

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_ENV
env:
APP_ENV: dev
run: echo "set APP_ENV to $APP_ENV"
- if: contains( github.ref, 'master' ) || contains( github.base_ref, 'master' )
env:
APP_ENV: prod
run: echo "set APP_ENV to $APP_ENV"
- if: contains( github.ref, 'staging' ) || contains( github.base_ref, 'staging' )
env:
APP_ENV: stag
run: echo "set APP_ENV to $APP_ENV"
- name: Setting APP_ENV to dev
run: |
echo ::set-env name=APP_ENV::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 APP_ENV to $APP_ENV"
- 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 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
- name: Run the docker image
Expand All @@ -42,12 +45,37 @@ jobs:
run: sleep 100
- name: Check if all containers are running
run: docker ps
#docker-compose logs
- name: Dumping the logs
run: docker-compose logs
- 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
run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
- name: Push to docker hub
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
if: (contains( github.ref, 'master' ) || contains( github.ref, 'staging' ) || contains( github.ref, 'development' )) && steps.kubeconfig.outputs.success == 'true'
run: helm upgrade pc-$APP_ENV ./api/helm --kubeconfig="kubeconfig.yaml" --namespace=$APP_ENV --set settings.env=$APP_ENV,settings.debug=1,settings.loadbalancerEnabled=true
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/
231 changes: 231 additions & 0 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f5307e8

Please sign in to comment.