forked from nguyenanhung/codeigniter3-skeleton
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.gitlab-ci.yml
More file actions
43 lines (43 loc) · 1.7 KB
/
test.gitlab-ci.yml
File metadata and controls
43 lines (43 loc) · 1.7 KB
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
35
36
37
38
39
40
41
42
43
stages:
- deploy
deploy:
stage: deploy
variables:
GIT_STRATEGY: fetch
script:
- echo "============|| Check Environment ||============"
- whoami
- pwd
- cat /etc/centos-release
- php -v
- git --version
- composer --version
- rsync --version
- date
- echo "============|| Build vendor ||============"
- ls -la
- composer validate
- composer install --no-dev --no-plugins --no-scripts --no-progress --prefer-dist --optimize-autoloader
- sudo chown -R gitlab-runner:gitlab-runner vendor/
- ls -la
- echo "============|| Deploy to production ||============"
- whoami
- echo $DEPLOY_PATH
- pwd
- sudo rsync -am --stats app/ "$DEPLOY_PATH/app/"
- sudo rsync -am --stats deploy/.prod.database.php "$DEPLOY_PATH/app/config/database.php"
- sudo rsync -am --stats firewall/ "$DEPLOY_PATH/firewall/"
- sudo rsync -am --stats nginx/ "$DEPLOY_PATH/nginx/"
- sudo rsync -am --stats storage/ "$DEPLOY_PATH/storage/"
- sudo rsync -am --stats vendor/ "$DEPLOY_PATH/vendor/"
- sudo rsync -am --stats public/ "$DEPLOY_PATH/public/"
- sudo rsync -rvh deploy/.prod.index.php "$DEPLOY_PATH/public/index.php"
- sudo rsync -rvh deploy/.prod.server.php "$DEPLOY_PATH/server.php"
- sudo rsync -rvh README.md "$DEPLOY_PATH/README.md"
- sudo chown -R nginx:nginx "$DEPLOY_PATH"
- cd $DEPLOY_PATH
- sudo php server.php tool clean_cache
- sudo php server.php tool flush_opcache
- php server.php tool pipelines "My-Services" "deploy"
only:
- main