Skip to content
Snippets Groups Projects
.gitlab-ci.yml 1.11 KiB
Newer Older
Romain Lebbadi-Breteau's avatar
Romain Lebbadi-Breteau committed
variables:
  DOCKER_HOST: tcp://dockerhost:2375/
  DOCKER_DRIVER: overlay2
  DOCKER_TLS_CERTDIR: ''

stages:
- lint
- test
- build

lint:
  stage: lint
  image: php:8.1-cli
  before_script:
  - apt-get update -y && apt-get install -y git zip unzip libzip-dev
  - docker-php-ext-install zip
  - curl -sS https://getcomposer.org/installer | php
  - php composer.phar install
  script:
  - php bin/console lint:yaml config
  - php bin/console lint:container
  - php vendor/bin/phplint --exclude=vendor --exclude=var --no-cache -v

include:
- template: Security/SAST.gitlab-ci.yml

build_image:
  image: docker
  services:
  - name: docker:dind
    alias: dockerhost
  stage: build
  before_script:
  - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
  script:
  - docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_BRANCH -f docker/Dockerfile.prod .
  - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_BRANCH
Romain Lebbadi-Breteau's avatar
Romain Lebbadi-Breteau committed
  - echo $SSH_KEY | base64 -d > ~/.ssh/id_ed25519
  - chmod 600 ~/.ssh/id_ed25519
  - cat ~/.ssh/id_ed25519
  - ssh -o StrictHostKeyChecking=no ubuntu@141.94.208.123 ./update.sh
  # only:
  # - main