-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbitbucket-pipelines.yml
31 lines (30 loc) · 1.79 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
# This is a sample build configuration for PHP.
# Check our guides at https://confluence.atlassian.com/x/VYk8Lw for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: ubuntu:latest
pipelines:
default:
- step:
script: # Modify the commands below to build your repository.
- export DEBIAN_FRONTEND=noninteractive
- apt-get update
- apt-get -y install sudo zip unzip curl
- apt-get -y install php php-curl php-xdebug php-intl php-mbstring php-pdo* php-mysql php-sqlite3 composer phpunit
- sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
- sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'
- apt-get -y install mysql-server mysql-client
- sudo service mysql start
- sudo mysql -u root -proot -e "CREATE DATABASE IF NOT EXISTS my_app;"
- sudo mysql -u root -proot -e "CREATE DATABASE IF NOT EXISTS test_myapp;"
- sudo mysql -u root -proot -e "CREATE USER 'my_app'@'localhost' IDENTIFIED BY 'secret';"
- sudo mysql -u root -proot -e "GRANT ALL ON my_app.* TO 'my_app'@'localhost';"
- sudo mysql -u root -proot -e "GRANT ALL ON test_myapp.* TO 'my_app'@'localhost';"
- composer install --prefer-dist --no-interaction --no-progress -a
- php bin/cake.php migrations migrate
- vendor/bin/phpunit --coverage-clover=coverage.xml
# SourceClear vulnerability scan
#- sudo curl -sSL https://download.sourceclear.com/ci.sh | sh
# CodeCov upload results
- if [ $? -eq 0 ]; then bash <(curl -s https://codecov.io/bash) -t $CODECOV_TOKEN; fi