]> git.p6c8.net - jirafeau.git/blob - .gitlab-ci.yml
Updated CHANGELOG
[jirafeau.git] / .gitlab-ci.yml
1 # Select what we should cache
2 cache:
3 paths:
4 - vendor/
5
6 # Run tests for php:8.2
7 job_lint_app_82:
8 image: php:8.2
9 before_script: &before_linter_script
10 # Install git, the docker php image doesn't have it installed by default
11 - apt-get update -yqq
12 - apt-get install git -yqq
13 - apt-get install zip -yqq
14 # Enable necessary php extensions
15 - docker-php-ext-enable curl && docker-php-ext-enable json && docker-php-ext-enable zip && docker-php-ext-enable mbstring && docker-php-ext-enable gd && docker-php-ext-enable pdo_mysql
16 # Install composer
17 - curl -sS https://getcomposer.org/installer | php
18 # Create composer.json file manually, since this is a project without any non-dev dependencies yet
19 - php composer.phar require --dev php-parallel-lint/php-parallel-lint
20 - php composer.phar require --dev friendsofphp/php-cs-fixer:3.64.0
21 # Install all project dependencies
22 - php composer.phar install
23 script: &linter_script
24 - ./vendor/bin/parallel-lint --exclude vendor .
25 - ./vendor/bin/php-cs-fixer -vvv check . --using-cache=no --rules=@PSR12,-single_space_around_construct
26
27 # Run tests for php:8.1
28 job_lint_app_81:
29 image: php:8.1
30 before_script: *before_linter_script
31 script: *linter_script
32
33 # Run tests for php:7.4
34 job_lint_app_74:
35 image: php:7.4
36 before_script: *before_linter_script
37 script: *linter_script
38
39 publish:
40 image: docker:latest
41 stage: deploy
42 services:
43 - docker:dind
44 script:
45 # Login to GitLab's Docker registry
46 - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
47 # Create a new builder instance and switch to it
48 - docker buildx create --use
49 # Build the image:
50 # 1. Build a Docker image for linux/arm/v7, linux/arm64/v8 and linux/amd64
51 # 2. Tag it with the current commit tag and "latest"
52 # 3. Push it to GitLab's Docker registry
53 - docker buildx build --push --platform linux/arm/v7,linux/arm64/v8,linux/amd64 --tag $CI_REGISTRY/$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG --tag $CI_REGISTRY/$CI_REGISTRY_IMAGE:latest .
54 only:
55 - tags

patrick-canterino.de