-
Notifications
You must be signed in to change notification settings - Fork 4
/
bitbucket-pipelines.yml
134 lines (132 loc) · 4.24 KB
/
bitbucket-pipelines.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# image: tbaltrushaitis/ubuntu-nodejs:v8.0.0
image: php:7.1.22-fpm-jessie
pipelines:
default:
- step:
name: Default Step
script:
- echo "This script runs on all branches that don't have any specific pipeline assigned in 'branches'.\n"
branches:
master:
- step:
name: Default Step in Master
script:
- printf "[Step_00] This script runs only on commit to the MASTER branch.\n"
- uname -a
- free -m
- df -H
- netstat -apn
- ls -als
- pwd
- printf "Everything is awesome!\n";
dev-1.0.3:
- step:
name: "[01] Greeting"
script:
- printf "[Step_01] This script runs only on commit to the [${BITBUCKET_BRANCH}] branch.\n"
- uname -a
- pwd
- printf "[Step_01] ==================================================================== [FINISHED]\n"
- step:
name: "[02] System Update"
caches:
- apt
- bower
- node
script:
- printf "System Update \n"
- source ./bin/.bash_colors
- apt-get -y update
- apt-get -y upgrade
- printf "System Updated!\n"
- step:
name: "[03] Install System Packages"
caches:
- apt
script:
- apt -y install make curl git-hub git-all git-flow composer npm
- step:
name: "[04] PHP Setup"
caches:
- apt
script:
- printf "PHP setup \n"
# PHP setup
# - apt-get -y install php php-cli php-common php-dba
# - apt search php
# - sleep 10
- php -v
- step:
name: "[05] NVM install"
caches:
- apt
- node
script:
- printf "NVM install \n"
# NPM install
- curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
- export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
# - [ -s "${NVM_DIR}/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
- echo "NVM_DIR = [${NVM_DIR}]"
- ls -als ${NVM_DIR}/
- \. "${NVM_DIR}/nvm.sh" # This loads nvm
- echo -e "\t${Cyan}ENV:\t exported [$NVM_DIR/nvm.sh]${RC}"
# - command -v nvm
# This loads nvm bash_completion
# - . "$NVM_DIR/bash_completion"
- nvm ls-remote
- nvm install v10.20.0 --latest-npm
- node -v
# - step:
# name: "[06] Setup NODE.JS"
# caches:
# - node
# script:
# - nvm install v10.0.0
# - node -v
- step:
name: "[07] Build project"
caches:
- bower
- node
script:
- echo "BUILD project"
- pwd
# BUILD project
- make setup
- sleep 1
- make engine
- sleep 1
- make build
- sleep 1
- make release
- sleep 1
- make deploy
- sleep 1
- cd webroot
- pwd && ls -als
- cat .env
- ./artisan env
- step:
name: "[08] Check webroot"
script:
- cd ${DIR_WEB}
- cat .INSPIRATION
- step:
name: "[09] Finalize"
script:
- echo "[Step_Info] Script runs on the [${BITBUCKET_BRANCH}] branch."
- pwd
- echo "[BITBUCKET_CLONE_DIR] = [${BITBUCKET_CLONE_DIR}]"
- echo "[BITBUCKET_COMMIT] = [${BITBUCKET_COMMIT}]"
- echo "[BITBUCKET_REPO_OWNER] = [${BITBUCKET_REPO_OWNER}]"
- echo "[BITBUCKET_REPO_SLUG] = [${BITBUCKET_REPO_SLUG}]"
- echo "[BITBUCKET_TAG] = [${BITBUCKET_TAG}]"
- echo "[BITBUCKET_BUILD_NUMBER] = [${BITBUCKET_BUILD_NUMBER}]"
- echo "[CI] = [${CI}]"
- printf "[FINISHED] Everything is awesome!\n";
definitions:
caches:
apt: /var/cache/apt/
bower: ./bower_modules/
node: ./node_modules/