Skip to content
Snippets Groups Projects
Commit ef251b25 authored by Cyril L'Orphelin's avatar Cyril L'Orphelin
Browse files

Merge branch 'openshift-deployment' of gitlab.in2p3.fr:cc-in2p3-dev/TMS into openshift-deployment

parents 30ce9f21 9d4dded3
No related branches found
No related tags found
3 merge requests!5Module Tapes : Try fixing bug 'Mixed Content The page at was loaded over...,!3Openshift deployment,!2Openshift deployment
Pipeline #64945 passed
# IntelliJ IDEA
.idea
###> symfony/webpack-encore-bundle ###
/node_modules/
/public/build/
npm-debug.log
yarn-error.log
###< symfony/webpack-encore-bundle ###
stages: stages:
- build - php
- nginx
- test
default: default:
services:
- docker:dind
image: docker:latest
before_script: before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
image: docker:latest
services: php-image-build:
- docker:dind stage: php
script:
- docker build --pull -t "$CI_REGISTRY_IMAGE/php-fpm:$CI_COMMIT_REF_SLUG" -f ./docker/php-fpm/Dockerfile .
- docker cp -a $(docker create "$CI_REGISTRY_IMAGE/php-fpm:$CI_COMMIT_REF_SLUG"):/var/www/tms/. php-build
- docker push "$CI_REGISTRY_IMAGE/php-fpm:$CI_COMMIT_REF_SLUG"
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
paths:
- php-build
nginx-image-build: nginx-image-build:
stage: build stage: nginx
script: script:
- docker build --pull -t "$CI_REGISTRY_IMAGE/nginx:$CI_COMMIT_REF_SLUG" -f ./docker/nginx/Dockerfile . - docker build --pull -t "$CI_REGISTRY_IMAGE/nginx:$CI_COMMIT_REF_SLUG" -f ./docker/nginx/Dockerfile .
- docker push "$CI_REGISTRY_IMAGE/nginx:$CI_COMMIT_REF_SLUG" - docker push "$CI_REGISTRY_IMAGE/nginx:$CI_COMMIT_REF_SLUG"
php-image-build: test:
stage: build stage: test
variables:
# Don't clone, the software is already in the image run
GIT_STRATEGY: none
dependencies: []
script: script:
- docker build --pull -t "$CI_REGISTRY_IMAGE/php-fpm:$CI_COMMIT_REF_SLUG" -f ./docker/php-fpm/Dockerfile . - docker run $CI_REGISTRY_IMAGE/php-fpm:$CI_COMMIT_REF_SLUG ./vendor/bin/simple-phpunit --configuration phpunit.xml.dist
- docker push "$CI_REGISTRY_IMAGE/php-fpm:$CI_COMMIT_REF_SLUG" ## TODO: Define unit tests
## TODO: Add unit tests report as job artifact
FROM gitlab-registry.in2p3.fr/cc-in2p3-devops/openshift-origin/openshift-images/nginx:stable-alpine FROM gitlab-registry.in2p3.fr/cc-in2p3-devops/openshift-origin/openshift-images/nginx:stable-alpine
LABEL maintainer="CNRS/CCIN2P3 DevOps Team" LABEL maintainer="CNRS/CCIN2P3 DevOps Team"
ADD tms/symfony.conf /etc/nginx/conf.d/default.conf ADD php-build/symfony.conf /etc/nginx/conf.d/default.conf
ADD php-build/public /var/www/tms/public
...@@ -5,14 +5,12 @@ RUN apk add --no-cache --virtual .php-build zlib-dev libpng-dev libjpeg-turbo-de ...@@ -5,14 +5,12 @@ RUN apk add --no-cache --virtual .php-build zlib-dev libpng-dev libjpeg-turbo-de
&& docker-php-ext-configure gd --with-freetype --with-jpeg \ && docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) gd mysqli pdo pdo_mysql && docker-php-ext-install -j$(nproc) gd mysqli pdo pdo_mysql
ADD tms /var/www/html/ WORKDIR /var/www/tms
WORKDIR /var/www/html ADD tms /var/www/tms
RUN apk add --no-cache --virtual .php-tools composer yarn npm \ RUN apk add --no-cache --virtual .php-tools composer yarn npm \
&& mv .env.template .env \ && mv .env.template .env \
&& php composer.phar install \ && php composer.phar install \
&& yarn install --ignore-engines \ && yarn install --ignore-engines \
&& yarn encore dev \ && yarn encore production \
&& apk del .php-tools && apk del .php-tools
EXPOSE 3315
server { server {
listen 8081; listen 8081;
server_name localhost; root /var/www/tms/public;
index index.php index.html; index index.html index.htm index.php;
root /var/www/html/public; server_name _;
charset utf-8;
location = /favicon.ico { log_not_found off; access_log off; }
location = /robots.txt { log_not_found off; access_log off; }
# redirect server error pages to the static page /50x.html location / {
error_page 500 502 503 504 /50x.html; try_files $uri $uri/ /index.php$is_args$args;
location = /50x.html {
root /usr/share/nginx/html;
} }
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 location ~ \.php$ {
# fastcgi_split_path_info ^(.+\.php)(/.+)$;
location / { fastcgi_pass php-tms:9000;
fastcgi_pass php-tms:9000; fastcgi_index index.php;
fastcgi_index index.php; include fastcgi_params;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
} }
error_page 404 /index.php;
location ~ /\.ht {
deny all;
}
} }
...@@ -262,7 +262,7 @@ ...@@ -262,7 +262,7 @@
} }
}) })
}); })
$('#tableTapes').on( 'processing.dt', function ( e, settings, processing ) { $('#tableTapes').on( 'processing.dt', function ( e, settings, processing ) {
$('#loadertable').css( 'display', processing ? 'block' : 'none' ); $('#loadertable').css( 'display', processing ? 'block' : 'none' );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment