Skip to content
Snippets Groups Projects
Commit 0f4ad7e4 authored by Ulf Seltmann's avatar Ulf Seltmann
Browse files

* removed server_name due to unexpected redirect-behavior behind proxy

* fixed ci-pipeline
* build for production by default
* fixed base-path for /
parent 8542ae85
Branches
No related merge requests found
Pipeline #1488 passed with stages
in 17 minutes and 20 seconds
assets/tenant/node_modules
assets/tenant/yarn.error
\ No newline at end of file
*
!/assets
/assets/tenant/node_modules
/assets/tenant/yarn.error
/assets/tenant/dist
\ No newline at end of file
......@@ -5,7 +5,6 @@ node_modules
yarn-error.log
ModuleDescriptor.json
/.tern-project
/.settings
/.build
\ No newline at end of file
/assets/tenant/dist
\ No newline at end of file
......@@ -12,20 +12,15 @@ variables:
docker_build:
stage: build
image: docker:latest
image: ubleipzig/deployer:1.3.2
services:
- docker:dind
script: |
docker build --pull \
deployer build \
--build-arg HTTP_PROXY=${HTTP_PROXY} \
--build-arg HTTPS_PROXY=${HTTPS_PROXY} \
--build-arg NO_PROXY=${NO_PROXY} \
--build-arg http_proxy=${HTTP_PROXY} \
--build-arg https_proxy=${HTTPS_PROXY} \
--build-arg no_proxy=${NO_PROXY} \
-t image \
.
docker save --output=image.tar.gz image
--output image.tar.gz
artifacts:
name: docker-image
paths:
......@@ -35,15 +30,15 @@ docker_build:
docker_publish_alpha:
stage: publish
image: docker:latest
image: ubleipzig/deployer:1.3.2
services:
- docker:dind
script: |
test "${DOCKER_ALPHA_AUTH_CONFIG}" == "" && echo "docker-config does not exists, aborting!" && false
mkdir -p ~/.docker && echo "$DOCKER_ALPHA_AUTH_CONFIG" >~/.docker/config.json
docker load --input=image.tar.gz
docker tag image ${alpha_repo}:alpha-${CI_COMMIT_REF_SLUG}
docker push ${alpha_repo}:alpha-${CI_COMMIT_REF_SLUG}
deployer publish \
--input image.tar.gz \
--docker-config "${DOCKER_ALPHA_AUTH_CONFIG}" \
--name ${alpha_repo} \
--tag ${CI_COMMIT_REF_SLUG}
dependencies:
- docker_build
tags:
......@@ -55,15 +50,15 @@ docker_publish_alpha:
docker_publish_staging:
stage: publish
image: docker:latest
image: ubleipzig/deployer:1.3.2
services:
- docker:dind
script: |
test "${DOCKER_STAGING_AUTH_CONFIG}" == "" && echo "docker-config does not exists, aborting!" && false
mkdir -p ~/.docker && echo "$DOCKER_STAGING_AUTH_CONFIG" >~/.docker/config.json
docker load --input=image.tar.gz
docker tag image ${staging_repo}:staging
docker push ${staging_repo}:staging
deployer publish \
--input image.tar.gz \
--docker-config "${DOCKER_STAGING_AUTH_CONFIG}" \
--name ${staging_repo} \
--tag staging
dependencies:
- docker_build
tags:
......@@ -73,22 +68,23 @@ docker_publish_staging:
docker_publish_production:
stage: publish
image: docker:latest
image: ubleipzig/deployer:1.3.2
services:
- docker:dind
script: |
test "${DOCKER_PRODUCTION_AUTH_CONFIG}" == "" && echo "docker-config does not exists, aborting!" && false
mkdir -p ~/.docker && echo "$DOCKER_PRODUCTION_AUTH_CONFIG" >~/.docker/config.json
docker load --input=image.tar.gz
export version=`expr ${CI_COMMIT_TAG} ':' 'release/\(.\+\)'`
export major_version=`expr ${version} ':' '\([^.]\+\)'`
export minor_version=`expr ${version} ':' '[^.]\+\.\([^.]\+\)'`
export patch_version=`expr ${version} ':' '[^.]\+\.[^.]\+\.\(.\+\)'`
echo "major version ${major_version}, minor version ${minor_version}, patch version ${patch_version}"
for tag in "latest" "${major_version}" "${major_version}.${minor_version}" "${version}";do
docker tag image ${production_repo}:${tag}
docker push ${production_repo}:${tag}
done
deployer publish \
--input image.tar.gz \
--docker-config "${DOCKER_PRODUCTION_AUTH_CONFIG}" \
--name ${production_repo} \
--tag latest \
--tag ${version} \
--tag "${major_version}.${minor_version}" \
--tag "${major_version}"
dependencies:
- docker_build
tags:
......
FROM nginx:stable-alpine as builder
ENV NODE_ENV=production
COPY assets/tenant/package* /app/
RUN apk add --no-cache nodejs yarn \
......@@ -19,7 +19,6 @@ ENV npm_config_cache=/tmp/.npm \
APP_USER=stripes \
APP_HOME=/app \
BASE_PATH="/" \
HOST_NAME=localhost \
DOLLAR=$ \
OKAPI_URL=http://localhost:9130 \
TENANT=diku \
......
......@@ -21,7 +21,7 @@ else
chown ${APP_USER}:${APP_USER} ${APP_USER_HOME} -R
fi
common_args="--host=0.0.0.0 stripes.config.js --publicPath=${BASE_PATH}/"
common_args="--host=0.0.0.0 stripes.config.js --publicPath=${BASE_PATH}"
case $1 in
serve:production)
......
server {
listen ${PORT};
server_name ${HOST_NAME};
location ${BASE_PATH} {
alias /app/dist;
alias /app/dist/;
try_files ${DOLLAR}uri ${DOLLAR}uri/ =404;
}
}
......@@ -5,10 +5,5 @@ services:
volumes:
- ./assets/tenant:/app
- ./assets/docker/docker-entrypoint:/docker-entrypoint
- ./.build:/usr/share/nginx/html
ports:
- 127.0.0.1:80:80
- 127.0.0.1:3001:3000
environment:
OKAPI_URL: http://localhost:9130/
tenant: diku
\ No newline at end of file
- 127.0.0.1:3000:3000
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment