Skip to content

Instantly share code, notes, and snippets.

@gandra
Created February 12, 2017 14:31
Show Gist options
  • Save gandra/b8a842b6cfd3267cde186f351875ecee to your computer and use it in GitHub Desktop.
Save gandra/b8a842b6cfd3267cde186f351875ecee to your computer and use it in GitHub Desktop.
.gitlab-ci.yml
image: woohuiren/php-laravel-env:5.3
services:
- mysql:latest
before_script:
- bash .gitlab-key-inject.sh # Script injection for SSH keys used for deployments
variables:
MYSQL_DATABASE: laravel
MYSQL_ROOT_PASSWORD: $MYSQL_ROOT_PASSWORD
SSH_PRIVATE_KEY: $MY_DIGOCEAN_PRIVATE_KEY # Recommended to put into GitLab secret variables instead
GIT_DEPLOYMENT_URL: git@gitlab.com:woohuiren/test-laravel-project.git # Used for PUSH deployments
GIT_DEPLOYMENT_REMOTE: origin/master # Used for PUSH and PULL deployments
GIT_DEPLOYMENT_BRANCH: master # Used for PUSH and PULL deployments
STAGING_SERVER_HOSTNAME: myuser@myhost # Used for PULL deployments
STAGING_SERVER_DIRECTORY: /var/sites/my-laravel-root-dir # Used for PULL deployments
stages:
- build
- test
- staging_deploy
build_job:
stage: build
script:
- bash .gitlab-build.sh
test_job:
stage: test
script:
- bash .gitlab-test.sh
stage_job:
stage: staging_deploy
script:
- bash .gitlab-staging-pull-deploy.sh
environment:
name: staging
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment