# specify what docker image
# go with the default image for now and mangle it
#image: debian:jessie

stages:
  - test
  - deploy


#before_script:

php-syntax-check:
  stage: test
  script:
   - apt-get clean
   - apt-get update
   - apt-get install -y php-cli
   - php -l htdocs/index.php
   - find components -name *.php | xargs -n 1 php -l
   - find plugins -name *.php | xargs -n 1 php -l
   - find lib -name *.php | xargs -n 1 php -l

js-syntax-check:
  stage: test
  script:
   - apt-get clean
   - apt-get update
#   - apt-get install -y nodejs
#   - ln -s /usr/bin/nodejs /usr/bin/node
   - apt-get install -y curl gnupg
   - curl -sL https://deb.nodesource.com/setup_8.x | bash -
   - apt-get install -y nodejs
   - npm install -g jshint        
   - find htdocs/js/ -name *.js ! -name jquery* | xargs -n 1 jshint --verbose

fake-deploy-beta:
  stage: deploy
  script:
   - echo "Hello World!"
  only:
   - beta
  environment: beta

fake-deploy-live:
  stage: deploy
  script:
   - echo "Hello World!"
  only:
   - sucs-site
  environment: live