Skip to content
Permalink
Browse files

Add building docker

  • Loading branch information...
DG0lden committed Mar 26, 2019
1 parent 18a434b commit cc726b0b218c58ffd45f1932593888fec7d76f11
@@ -2,9 +2,6 @@
# Global settings
# ------------------------------------------------------------------

cache:
paths:
- /builds/adorsys/xs2a/psd2-dynamic-sandbox/.m2/repository

# ------------------------------------------------------------------
# stages
@@ -26,6 +23,8 @@ variables:
DOCKER_IMAGE_NAME_XS2A_ONLINE_BANKING: "docker.io/adorsys/xs2a-online-banking"
DOCKER_IMAGE_NAME_XS2A_CERTIFICATE_GENERATOR: "docker.io/adorsys/xs2a-certificate-generator"
DOCKER_IMAGE_NAME_XS2A_ONLINE_BANKING_UI: "docker.io/adorsys/xs2a-online-banking-ui"
DOCKER_IMAGE_NAME_XS2A_TPP_UI: "docker.io/adorsys/xs2a-bank-tpp-ui"
DOCKER_IMAGE_NAME_XS2A_DEVPORTAL_UI: "docker.io/adorsys/xs2a-bank-devportal"

###########################
# Build variables #
@@ -47,30 +46,90 @@ variables:
- cat /sys/fs/cgroup/memory/memory.limit_in_bytes
- java -XX:+PrintFlagsFinal -version | grep -Ei "maxheapsize|maxram"
- mvn -DskipTests clean install
cache:
key: "Java_${CI_COMMIT_REF_SLUG}"
paths:
- /builds/adorsys/xs2a/psd2-dynamic-sandbox/.m2/repository

# Build docker images and put them to DOCKER HUB repo
.build_dockerhub_image: &build_dockerhub_image
.build_docker_images: &build_docker_images
script:
- docker build -t "$DOCKER_IMAGE_NAME_XS2A_ONLINE_BANKING:$DOCKER_TAG" online-banking/online-banking-app

- docker build -t "$DOCKER_IMAGE_NAME_XS2A_CERTIFICATE_GENERATOR:$DOCKER_TAG" certificate-generator
# - docker build -t "$DOCKER_IMAGE_NAME_XS2A_ONLINE_BANKING_UI:$DOCKER_TAG" oba-ui
- docker build -t "$DOCKER_IMAGE_NAME_XS2A_TPP_UI:$DOCKER_TAG" tpp-ui
- docker build -t "$DOCKER_IMAGE_NAME_XS2A_DEVPORTAL_UI:$DOCKER_TAG" developer-portal-ui

- docker build -t "$DOCKER_IMAGE_NAME_XS2A_ONLINE_BANKING_UI:$DOCKER_TAG" oba-ui
.push_dockerhub_images: &push_dockerhub_images
script:
- docker build -t "$DOCKER_IMAGE_NAME_XS2A_ONLINE_BANKING:$DOCKER_TAG" online-banking/online-banking-app
- docker build -t "$DOCKER_IMAGE_NAME_XS2A_CERTIFICATE_GENERATOR:$DOCKER_TAG" certificate-generator
# - docker build -t "$DOCKER_IMAGE_NAME_XS2A_ONLINE_BANKING_UI:$DOCKER_TAG" oba-ui
- docker build -t "$DOCKER_IMAGE_NAME_XS2A_TPP_UI:$DOCKER_TAG" tpp-ui
- docker build -t "$DOCKER_IMAGE_NAME_XS2A_DEVPORTAL_UI:$DOCKER_TAG" developer-portal-ui

- docker login -u $DOCKER_HUB_LOGIN -p $DOCKER_HUB_PASS

- docker push "$DOCKER_IMAGE_NAME_XS2A_ONLINE_BANKING:$DOCKER_TAG"

- docker push "$DOCKER_IMAGE_NAME_XS2A_CERTIFICATE_GENERATOR:$DOCKER_TAG"

- docker push "$DOCKER_IMAGE_NAME_XS2A_ONLINE_BANKING_UI:$DOCKER_TAG"

- docker logout

# ------------------------------------------------------------------
# jobs
# ------------------------------------------------------------------


build devportal frontend:
stage: "build:src"
image: "adorsys/ci-build"
script:
- cd developer-portal-ui
- npm install
- npm run build --prod
cache:
key: "DEVPORTAL_${CI_COMMIT_REF_SLUG}"
paths:
- developer-portal-ui/node_modules
artifacts:
paths:
- "developer-portal-ui/dist"
name: "$CI_PROJECT_NAME-${CI_BUILD_REF_NAME#*v}"
expire_in: "1 day"

#build oba frontend:
# stage: "build:src"
# image: "adorsys/ci-build"
# script:
# - cd oba-ui
# - npm install
# - npm run build --prod
# cache:
# key: "OBA_UI_${CI_COMMIT_REF_SLUG}"
# paths:
# - oba-ui/node_modules
# artifacts:
# paths:
# - "oba-ui/dist"
# name: "$CI_PROJECT_NAME-${CI_BUILD_REF_NAME#*v}"
# expire_in: "1 day"

build tpp frontend:
stage: "build:src"
image: "adorsys/ci-build"
script:
- cd tpp-ui
- npm install
- npm run build --prod
cache:
key: "TPP_UI_${CI_COMMIT_REF_SLUG}"
paths:
- tpp-ui/node_modules
artifacts:
paths:
- "tpp-ui/dist"
name: "$CI_PROJECT_NAME-${CI_BUILD_REF_NAME#*v}"
expire_in: "1 day"

build_package_java11:
<<: *build_java
variables:
@@ -93,23 +152,70 @@ pmd_report:
image: "adorsys/ci-build"
script:
- mvn -Dmaven.test.skip=true package pmd:pmd
cache:
key: "Java_${CI_COMMIT_REF_SLUG}"
paths:
- /builds/adorsys/xs2a/psd2-dynamic-sandbox/.m2/repository
artifacts:
paths:
- "qa/pmd/pmd-ruleset.xml"
- "**/**/*/pmd.html"
- "**/*/pmd.xml"
name: "$CI_PROJECT_NAME-${CI_BUILD_REF_NAME#*v}-pmd"
expire_in: "10 day"
#
#test tpp frontend:
# stage: "build:qa"
# image: "adorsys/ci-build"
# script:
# - nvm use
# - cd tpp-ui
# - npm run test-ci
# cache:
# key: "TPP_UI_${CI_COMMIT_REF_SLUG}"
# paths:
# - tpp-ui/node_modules
#
#test oba frontend:
# stage: "build:qa"
# image: "adorsys/ci-build"
# script:
# - cd oba-ui
# - npm test
# cache:
# key: "OBA_UI_${CI_COMMIT_REF_SLUG}"
# paths:
# - oba-ui/node_modules
#
#test developer portal frontend:
# stage: "build:qa"
# image: "adorsys/ci-build"
# script:
# - nvm use
# - cd developer-portal-ui
# - npm run test-ci
# cache:
# key: "DEVPORTAL_${CI_COMMIT_REF_SLUG}"
# paths:
# - developer-portal-ui/node_modules

check_pmd:
stage: "build:qa"
image: "adorsys/ci-build"
cache:
key: "Java_${CI_COMMIT_REF_SLUG}"
paths:
- /builds/adorsys/xs2a/psd2-dynamic-sandbox/.m2/repository
script:
- mvn -Dmaven.test.skip=true package pmd:check

check_javadoc_java8:
stage: "build:qa"
image: "adorsys/ci-build"
cache:
key: "Java_${CI_COMMIT_REF_SLUG}"
paths:
- /builds/adorsys/xs2a/psd2-dynamic-sandbox/.m2/repository
script:
- cat /sys/fs/cgroup/memory/memory.limit_in_bytes
- java -XX:+PrintFlagsFinal -version | grep -Ei "maxheapsize|maxram"
@@ -123,6 +229,10 @@ check_javadoc_java8:
unit_tests:
stage: "build:qa"
image: "adorsys/ci-build"
cache:
key: "Java_${CI_COMMIT_REF_SLUG}"
paths:
- /builds/adorsys/xs2a/psd2-dynamic-sandbox/.m2/repository
script:
- cat /sys/fs/cgroup/memory/memory.limit_in_bytes
- java -XX:+PrintFlagsFinal -version | grep -Ei "maxheapsize|maxram"
@@ -133,17 +243,27 @@ unit_tests:
name: "$CI_PROJECT_NAME-${CI_BUILD_REF_NAME#*v}-*"
expire_in: "10 day"

test building docker images:
stage: "build:qa"
variables:
DOCKER_TAG: test
<<: *build_docker_images

build_dockerhub_image_master:
stage: "build:image"
only:
- master
variables:
DOCKER_TAG: latest
<<: *build_dockerhub_image
<<: *push_dockerhub_images

release_maven_central:
stage: "release"
image: "adorsys/ci-build"
cache:
key: "Java_${CI_COMMIT_REF_SLUG}"
paths:
- /builds/adorsys/xs2a/psd2-dynamic-sandbox/.m2/repository
only:
- tags
script:
1 .nvmrc
@@ -0,0 +1 @@
10
@@ -0,0 +1,2 @@
dist
node_modules
@@ -0,0 +1,18 @@
# Stage SERVE
FROM nginx:1.15.5
MAINTAINER https://github.com/adorsys/xs2a

COPY ./nginx.conf /etc/nginx/conf.d/default.conf
COPY entry.sh /opt/entry.sh
ADD dist/psd2-accelerator /usr/share/nginx/html

RUN chgrp -R root /var/cache/nginx && \
find /var/cache/nginx -type d -exec chmod 775 {} \; && \
find /var/cache/nginx -type f -exec chmod 664 {} \; && \
chmod 775 /var/run && \
chmod 775 /opt/entry.sh && \
chmod -R 777 /etc/nginx/conf.d

EXPOSE 4205

ENTRYPOINT /opt/entry.sh
@@ -0,0 +1,3 @@
#!/bin/sh

nginx -g "daemon off;"
@@ -0,0 +1,11 @@
server {
listen 4205;

index index.html;
root /usr/share/nginx/html/;

location / {
proxy_intercept_errors on;
error_page 404 = /index.html;
}
}

0 comments on commit cc726b0

Please sign in to comment.
You can’t perform that action at this time.