Commit 3c93345e by Lukáš Lalinský

Add GitLab CI files

parent ae1ba7b5
stages:
- prepare
- test
build build-env image:
stage: prepare
script:
- cd ci/build-env
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
- docker build -t ${CI_REGISTRY_IMAGE}/build-env .
- docker push $CI_REGISTRY_IMAGE/build-env
tags:
- docker-host
build phoenix image:
stage: prepare
script:
- cd ci/phoenix
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
- docker build -t ${CI_REGISTRY_IMAGE}/phoenix:4.11 --build-arg HBASE_VERSION=1.3.1 --build-arg PHOENIX_VERSION=4.11.0-HBase-1.3 .
- docker push $CI_REGISTRY_IMAGE/phoenix:4.11
tags:
- docker-host
test:
image: $CI_REGISTRY_IMAGE/build-env
services:
- $CI_REGISTRY_IMAGE/phoenix:4.11
script:
- tox
FROM ubuntu:xenial
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y python-dev python3-dev tox
FROM openjdk:8
ARG HBASE_VERSION
ARG PHOENIX_VERSION
ARG PHOENIX_NAME=apache-phoenix
ENV HBASE_URL http://www.apache.org/dyn/closer.cgi?action=download&filename=hbase/$HBASE_VERSION/hbase-$HBASE_VERSION-bin.tar.gz
RUN wget --no-verbose -O hbase.tar.gz "$HBASE_URL" && \
mkdir /opt/hbase && \
tar xf hbase.tar.gz --strip-components=1 -C /opt/hbase && \
rm hbase.tar.gz
ENV PHOENIX_URL http://www.apache.org/dyn/closer.cgi?action=download&filename=phoenix/apache-phoenix-$PHOENIX_VERSION/bin/apache-phoenix-$PHOENIX_VERSION-bin.tar.gz
RUN wget --no-verbose -O phoenix.tar.gz "$PHOENIX_URL" && \
mkdir /opt/phoenix && \
tar xf phoenix.tar.gz --strip-components=1 -C /opt/phoenix && \
rm phoenix.tar.gz
RUN ln -sv /opt/phoenix/phoenix-*-server.jar /opt/hbase/lib/
EXPOSE 8765
COPY docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["docker-entrypoint.sh"]
#!/usr/bin/env bash
pids=()
/opt/hbase/bin/hbase-daemon.sh foreground_start master &
pids+=($!)
/opt/phoenix/bin/queryserver.py &
pids+=($!)
cleanup() {
if [ ${#pids[@]} -ne 0 ]
then
pids=($(ps -o pid= -p "${pids[@]}"))
if [ ${#pids[@]} -ne 0 ]
then
kill "${pids[@]}"
fi
fi
}
trap cleanup SIGCHLD SIGINT SIGTERM
wait
Markdown is supported
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