Skip to content
Snippets Groups Projects
Commit 81941742 authored by Benjamin Guillon's avatar Benjamin Guillon :metal:
Browse files

Update .gitlab-ci.yml, docker/php-build/Dockerfile, docker/php-fpm/Dockerfile files

parent caf5b79c
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 #64624 failed
stages: stages:
- build - build
- images
- test - test
default: default:
...@@ -7,8 +8,19 @@ default: ...@@ -7,8 +8,19 @@ default:
- docker:dind - docker:dind
image: docker:latest image: docker:latest
php-image-build: build:
stage: build stage: build
script:
- docker build --pull -t "$CI_REGISTRY_IMAGE/php-build:$CI_COMMIT_REF_SLUG" -f ./docker/php-build/Dockerfile .
- docker create --name php-build-tmp "$CI_REGISTRY_IMAGE/php-build:$CI_COMMIT_REF_SLUG"
- docker cp php-build-tmp:/var/www/html $CI_BUILD_DIR/php-build
- docker rm -f php-build-tmp
artifacts:
paths:
- $CI_BUILD_DIR/php-build
php-image-build:
stage: images
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
script: script:
...@@ -16,11 +28,9 @@ php-image-build: ...@@ -16,11 +28,9 @@ php-image-build:
- docker push "$CI_REGISTRY_IMAGE/php-fpm:$CI_COMMIT_REF_SLUG" - docker push "$CI_REGISTRY_IMAGE/php-fpm:$CI_COMMIT_REF_SLUG"
nginx-image-build: nginx-image-build:
stage: build stage: images
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
needs:
- php-image-build
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"
...@@ -29,10 +39,9 @@ test: ...@@ -29,10 +39,9 @@ test:
stage: test stage: test
image: $CI_REGISTRY_IMAGE/php-fpm:$CI_COMMIT_REF_SLUG image: $CI_REGISTRY_IMAGE/php-fpm:$CI_COMMIT_REF_SLUG
variables: variables:
# Don't git clone, the software is already in the image run # Don't clone, the software is already in the image run
GIT_STRATEGY: none GIT_STRATEGY: none
needs: dependencies: []
- php-image-build
script: script:
- pwd && ls -la . - pwd && ls -la .
- sh .tms/vendor/bin/simple-phpunit --configuration phpunit.xml.dist - sh .tms/vendor/bin/simple-phpunit --configuration phpunit.xml.dist
......
FROM gitlab-registry.in2p3.fr/cc-in2p3-devops/openshift-origin/openshift-images/php:stable-alpine
LABEL maintainer="CNRS/CCIN2P3 DevOps Team"
RUN apk add --no-cache --virtual .php-build zlib-dev libpng-dev libjpeg-turbo-dev freetype-dev \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) gd mysqli pdo pdo_mysql
ADD tms /var/www/html/
WORKDIR /var/www/html
RUN apk add --no-cache --virtual .php-tools composer yarn npm \
&& mv .env.template .env \
&& php composer.phar install \
&& yarn install --ignore-engines \
&& yarn encore dev \
&& apk del .php-tools
...@@ -5,12 +5,4 @@ RUN apk add --no-cache --virtual .php-build zlib-dev libpng-dev libjpeg-turbo-de ...@@ -5,12 +5,4 @@ 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/html WORKDIR /var/www/html
RUN apk add --no-cache --virtual .php-tools composer yarn npm \
&& mv .env.template .env \
&& php composer.phar install \
&& yarn install --ignore-engines \
&& yarn encore dev \
&& apk del .php-tools
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