Git Product home page Git Product logo

gitlab-ci-php's Introduction

Build and test PHP applications with Gitlab CI

Docker images with everything you'll need to build and test PHP applications.

Logo


GitHub last commit

Docker Pulls


CURRENTLY ONLY ALPINE IMAGES!

All versions come with:


Gitlab pipeline examples

Symfony examples

Simple .gitlab-ci.yml using MariaDB service

variables:
    MYSQL_ROOT_PASSWORD: root
    MYSQL_USER: symfony
    MYSQL_PASSWORD: password
    MYSQL_DATABASE: project
    APP_ENV: prod
    DATABASE_URL: mysql://$MYSQL_USER:$MYSQL_PASSWORD@mysql/$MYSQL_DATABASE

image: cstadler333/gitlab-ci-php:8.3-alpine
services:
    - mariadb:10.11

build:
    stage: build
    before_script:
        - npm install
    script:
        - npm run build
        - composer install --prefer-dist --no-ansi --no-interaction --no-progress

Advanced .gitlab-ci.yml using MariaDB service, stages, templates and cache

stages:
    - build
    - deploy

variables:
    MYSQL_ROOT_PASSWORD: root
    MYSQL_USER: symfony
    MYSQL_PASSWORD: password
    MYSQL_DATABASE: project
    APP_ENV: prod
    DATABASE_URL: mysql://$MYSQL_USER:$MYSQL_PASSWORD@mysql/$MYSQL_DATABASE

cache:
    key: $CI_COMMIT_REF_NAME
    paths:
        - node_modules/
        - vendor/

image: cstadler333/gitlab-ci-php:8.3-alpine
services:
    - mariadb:10.11

.build_template: &build
    stage: build
    before_script:
        - npm install --force
    script:
        - npm run build
        - composer install --prefer-dist --no-ansi --no-interaction --no-progress

.deploy_template: &deploy
    stage: deploy
    before_script:
        - 'which ssh-agent || ( apt-get install -qq openssh-client )'
        - eval $(ssh-agent -s)
        - ssh-add <(echo "$SSH_PRIVATE_KEY")
        - mkdir -p ~/.ssh
        - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'

Build Master:
    <<: *build
    only:
        - master

Deploy Master:
    <<: *deploy
    only:
        - master
    script:
        - rsync -a --progress --human-readable --delete
            --exclude .git
            --exclude node_modules
            --exclude var
            --exclude vendor
            .
            user@server:path

Deploying PHP applications with Gitlab

Recommended

gitlab-ci-php's People

Contributors

gschrisstadler avatar cstadler333 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.