Skip to content

Commit dc5e4b6

Browse files
gilmiriamm1guelpf
authored andcommitted
add Docker to project
1 parent cd2539a commit dc5e4b6

File tree

6 files changed

+45
-4
lines changed

6 files changed

+45
-4
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
language: php
1+
language: php1
22

33
sudo: false
44

@@ -22,4 +22,4 @@ before_script:
2222

2323
script:
2424
- vendor/bin/phpunit --verbose --coverage-text
25-
- if [ "$STATIC_ANALYSIS" != "" ]; then php phpstan.phar analyse --level=4 lib; fi;
25+
- if [ "$STATIC_ANALYSIS" != "" ]; then php1 phpstan.phar analyse --level=4 lib; fi;

Makefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.PHONY: clean up test
2+
clean: ## Clean up containers
3+
docker-compose down -v
4+
5+
up: ## Up the containers
6+
docker-compose build
7+
docker-compose up -d
8+
9+
test: up ## Test API
10+
docker-compose exec php composer install
11+
docker-compose exec php /app/vendor/phpunit/phpunit/phpunit --no-configuration /app/test

docker-compose.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: "3"
2+
services:
3+
php:
4+
build: etc/docker/dev/php
5+
volumes:
6+
- .:/app
7+
working_dir: /app
8+
command: tail -f /dev/null

etc/docker/dev/php/Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM php:7.2-cli
2+
3+
RUN echo "\nexport TERM=xterm" >> /etc/bash.bashrc \
4+
&& apt-get update && apt-get install -y --no-install-recommends \
5+
apt-utils apt-transport-https
6+
7+
RUN apt-get update && apt-get install -y --no-install-recommends \
8+
curl \
9+
git \
10+
libzip-dev \
11+
zip \
12+
unzip \
13+
&& rm -rf /var/lib/apt/lists/*
14+
15+
# Xdebug install
16+
RUN pecl install zip \
17+
&& docker-php-ext-enable zip
18+
19+
# Composer and no dev vendor requirements
20+
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer
21+
22+
WORKDIR /app

lib/Gitlab/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function __construct(Builder $httpClientBuilder = null)
8383
$this->httpClientBuilder->addPlugin(new HistoryPlugin($this->responseHistory));
8484
$this->httpClientBuilder->addPlugin(new ApiVersion());
8585
$this->httpClientBuilder->addPlugin(new HeaderDefaultsPlugin([
86-
'User-Agent' => 'php-gitlab-api (http://github.com/m4tthumphrey/php-gitlab-api)',
86+
'User-Agent' => 'php1-gitlab-api (http://github.com/m4tthumphrey/php1-gitlab-api)',
8787
]));
8888

8989
$this->setUrl('https://gitlab.com');

test/Gitlab/Tests/Api/ProjectsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,7 @@ public function shouldRemoveLabel()
11051105
*/
11061106
public function shouldGetLanguages()
11071107
{
1108-
$expectedArray = ['php' => 100];
1108+
$expectedArray = ['php1' => 100];
11091109
$api = $this->getApiMock();
11101110
$api->expects($this->once())
11111111
->method('get')

0 commit comments

Comments
 (0)