You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
115 lines
3.1 KiB
115 lines
3.1 KiB
kind: pipeline
|
|
type: docker
|
|
name: HeartWave
|
|
|
|
# dev is DMZ
|
|
|
|
trigger:
|
|
event:
|
|
- push
|
|
|
|
steps:
|
|
- name: test
|
|
image: php:7.4
|
|
commands:
|
|
- cd Sources
|
|
# Installe les dépendances PHP si nécessaire
|
|
- composer install
|
|
# - composer require phpunit/phpunit
|
|
- vendor/bin/phpunit common/Tests
|
|
|
|
# build CONTAINER for app-build on flutter IMAGE
|
|
- name: docker-build
|
|
build: Sources/src/config
|
|
ports:
|
|
- "8080:80"
|
|
volumes:
|
|
- ./php/vhosts:/etc/apache2/sites-enabled
|
|
- ./:/var/www
|
|
restart: always
|
|
|
|
- name: code-analysis
|
|
image: #####
|
|
environment:
|
|
SONAR_TOKEN:
|
|
from_secret: SONAR_TOKEN
|
|
commands:
|
|
- export SONAR_SCANNER_VERSION=4.7.0.2747
|
|
- export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux
|
|
- curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip
|
|
- unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
|
|
- export PATH=$SONAR_SCANNER_HOME/bin:$PATH
|
|
- export SONAR_SCANNER_OPTS="-server"
|
|
- sonar-scanner -D sonar.projectKey=Bowl_in -D sonar.sources=./Sources/bowlin_project -D sonar.host.url=https://codefirst.iut.uca.fr/sonar -D sonar.flutter.coverage.reportPath=./Sources/bowlin_project/coverage/lcov.info
|
|
depends_on: [ test ]
|
|
|
|
|
|
# database container deployment
|
|
- name: container-mysql
|
|
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest
|
|
volumes:
|
|
- db-data:/var/lib/mysql
|
|
environment:
|
|
IMAGENAME: mariadb:10
|
|
CONTAINERNAME: mysql
|
|
COMMAND: create
|
|
# OVERWRITE: false
|
|
# should be true
|
|
PRIVATE: false
|
|
CODEFIRST_CLIENTDRONE_ENV_MARIADB_ROOT_PASSWORD:
|
|
from_secret: db_root_password
|
|
CODEFIRST_CLIENTDRONE_ENV_MARIADB_DATABASE:
|
|
from_secret: db_database
|
|
CODEFIRST_CLIENTDRONE_ENV_MARIADB_USER:
|
|
from_secret: db_user
|
|
CODEFIRST_CLIENTDRONE_ENV_MARIADB_PASSWORD:
|
|
from_secret: db_password
|
|
ADMINS: antoineperederii,antoinepinagot,kevinmonteiro,paullevrault,davidd_almeida
|
|
|
|
- name: phpmyadmin-container
|
|
# should find a goog version
|
|
image: phpmyadmin
|
|
restart: always
|
|
ports:
|
|
- 8082:80
|
|
environment:
|
|
PMA_HOST: container-mysql
|
|
depends_on:
|
|
-container-mysql
|
|
networks:
|
|
- admin
|
|
|
|
|
|
- name: docker-push
|
|
image: plugins/docker
|
|
settings:
|
|
username:
|
|
from_secret: DOCKER_USERNAME
|
|
password:
|
|
from_secret: DOCKER_PASSWORD
|
|
repo: myusername/my-php-app
|
|
tags: latest
|
|
auto_tag: true
|
|
registry: docker.io
|
|
|
|
- name: deploy-container
|
|
image: docker
|
|
commands:
|
|
- docker stop my-php-container || true
|
|
- docker rm my-php-container || true
|
|
- docker run -d --name my-php-container -p 80:80 myusername/my-php-app
|
|
- name: notify
|
|
image: ruby:2.1
|
|
rules:
|
|
- if: "$CI_COMMIT_TAG =~ /^.*-demo$/"
|
|
when: on_success
|
|
script:
|
|
- sh ./notifymail.sh
|
|
|
|
volumes:
|
|
db-data:
|
|
|
|
networks:
|
|
admin:
|
|
|