Skip to content

Instantly share code, notes, and snippets.

@thom8
Created November 19, 2018 03:13
Show Gist options
  • Save thom8/fa234fa62a6cf65c6da1936766f8d1f5 to your computer and use it in GitHub Desktop.
Save thom8/fa234fa62a6cf65c6da1936766f8d1f5 to your computer and use it in GitHub Desktop.
image: integratedexperts/circleci2-builder
services:
- docker:dind
stages:
- validate
- build
- deploy
validate:
stage: validate
script:
- "curl -s -H 'Cache-Control: no-cache' -o /tmp/validate-scaffold.php https://projects.govcms.gov.au/dof/sass-scaffold-ci/raw/master/validate-scaffold.php?$(date +%s) && PROJECT_DIR=$CI_PROJECT_DIR php /tmp/validate-scaffold.php || [ \"$CI_PROJECT_NAMESPACE\" == \"GovCMS\" ] || true"
build:
stage: build
script:
- export DOCKER_HOST=tcp://localhost:2375
- docker network prune -f && docker network create amazeeio-network
- docker run --name amazeeio-ssh-agent -d amazeeio/ssh-agent
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN gitlab-registry-production.govcms.amazee.io
- ahoy up
- docker-compose exec -T test dockerize -wait tcp://mariadb:3306 -timeout 1m
- ahoy -v install -- install_configure_form.update_status_module='array(FALSE,FALSE)'
- ahoy lint || true
- ahoy test-phpunit
- ahoy test-behat
- ahoy audit-site
artifacts:
paths:
- tests/behat/features/screenshots
expire_in: 7 days
except:
variables:
- $CI_COMMIT_MESSAGE =~ /GovCMS-Migration/
deploy:
stage: deploy
script:
- echo "curl -X POST -d projectName=$CI_PROJECT_NAME -d branchName=$CI_COMMIT_REF_NAME http://rest2tasks-lagoon.govcms.amazee.io/deploy"
- curl -X POST -d projectName=$CI_PROJECT_NAME -d branchName=$CI_COMMIT_REF_NAME http://rest2tasks-lagoon.govcms.amazee.io/deploy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment