Danger Security Team

default:
  image: registry.gitlab.com/pixelco/hitrav
  cache:
    paths:
      - vendor/
      - node_modules/

stages:
  - test
  - stage-deploy
  - production-deploy

variables:
  GIT_STRATEGY: fetch
  GIT_DEPTH: "2"

.branches:
  only:
    - master

test:
  services:
    - mysql:5.7
  variables:
    MYSQL_ROOT_PASSWORD: secret
    MYSQL_DATABASE: hitrav
  extends:
    - .branches
  script:
    - composer install
    - cp .env.testing .env
    - php artisan key:generate
    - php artisan config:cache
    - php artisan migrate --seed
    - npm install
    - npm rebuild node-sass
    - npm run production
    - vendor/bin/phpunit --coverage-text --colors=never
  coverage: '/^\s*Lines:\s*\d+.\d+\%/'

.init_ssh: &init_ssh
  - eval $(ssh-agent -s)
  - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
  - mkdir -p ~/.ssh
  - chmod 700 ~/.ssh
  - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'

stage-deploy:
  stage: stage-deploy
  extends:
    - .branches
  script:
    - *init_ssh
    - php artisan deploy stage
  environment:
    name: stage
    url: "$HITRAV_STAGE_URL"

production-deploy:
  stage: production-deploy
  extends:
    - .branches
  script:
    - *init_ssh
    - php artisan deploy production
  environment:
    name: production
    url: "$HITRAV_PRODUCTION_URL"

Are there any code examples left?
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source