forked from jamalsa/laravel.com
-
Notifications
You must be signed in to change notification settings - Fork 10
/
.gitlab-ci.yml
34 lines (31 loc) · 913 Bytes
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
stages:
- test
- deploy
before_script:
- echo 'Initial Setup'
- cp .env.production .env
- echo "APP_KEY=${LARAVEL_APP_KEY}" >> .env
- composer install --prefer-dist --no-interaction > /dev/null
- . ~/.nvm/nvm.sh
- nvm use 4
- npm install
- export BUILD_VERSION=`date +%Y%m%d.%s`
test:
stage: test
script:
- echo 'Running PHP unit test'
- php vendor/bin/phpunit --debug
deploy:
stage: deploy
only:
- master
script:
- echo 'Build Application'
- gulp --production
- mkdir ${DEPLOY_BUILD_PATH}/${BUILD_VERSION}
- cp -r . ${DEPLOY_BUILD_PATH}/${BUILD_VERSION}
- unlink ${DEPLOY_WEBROOT_PATH}
- ln -sf ${DEPLOY_BUILD_PATH}/${BUILD_VERSION} ${DEPLOY_WEBROOT_PATH}
- ln -sf ${LARAVEL_DOC_PATH} ${DEPLOY_BUILD_PATH}/${BUILD_VERSION}/resources/docs
- chmod -R 777 ${DEPLOY_BUILD_PATH}/${BUILD_VERSION}/storage
- sudo service php5-fpm restart