-
Notifications
You must be signed in to change notification settings - Fork 2
/
bitbucket-pipelines.yml
52 lines (49 loc) · 1.9 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
image: php:7.4
clone:
depth: full # SonarCloud scanner needs the full history to assign issues properly
definitions:
caches:
sonar: ~/.sonar/cache # Caching SonarCloud artifacts will speed up your build
steps:
- step: &install-php-extensions
name: Install PHP Extensions
script:
# Installing first the libraries necessary to configure and install gd
- apt-get update && apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev
# Now we can configure and install the extension
- docker-php-ext-configure gd -with-jpeg=/usr/include/ --with-freetype=/usr/include/
- docker-php-ext-install -j$(nproc) gd
- step: &install-composer
name: Install dependencies
caches:
- composer # See https://confluence.atlassian.com/bitbucket/caching-dependencies-895552876.html
script:
- apt-get update && apt-get install -y unzip
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- composer require monolog/monolog
- composer require phpunit/phpunit
- composer install
# - vendor/bin/phpunit
services:
- docker
- step: &build-test-sonarcloud
name: Build, test and analyze on SonarCloud
caches:
- sonar
- composer
size: 2x # Double Resources available for this step
script: # Build your project and run
- pipe: sonarsource/sonarcloud-scan:1.2.1
variables:
DEBUG: "true" #Optional
services:
- docker
services:
docker:
memory: 7128
options:
size: 2x # Allocates twice the amount of memory globally
pipelines: # More info here: https://confluence.atlassian.com/bitbucket/configure-bitbucket-pipelines-yml-792298910.html
branches:
master:
- step: *build-test-sonarcloud