Answers for "Danger Security Team"

0

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"
Posted by: Guest on November-11-2020

Browse Popular Code Answers by Language