diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..12b5197 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,26 @@ +version: 2.1 +jobs: + build: + docker: + - image: ../.tests/DockerfileUbuntu + steps: + - run: + name: Setup + command: | + redis-server & + cd /tmp/hyperglass + poetry run hyperglass setup -d + poetry run hyperglass build-ui + - run: + name: Set listen_address + command: | + echo "listen_address: 127.0.0.1" >> /root/hyperglass/hyperglass.yaml + - run: + name: Start + command: | + poetry run hyperglass start &> /var/log/hyperglassci.log & + sleep 10 + - run: + name: Test + command: | + curl -s -o /dev/null -w "%{http_code}" http://localhost:8001 diff --git a/.tests/DockerfileUbuntu b/.tests/DockerfileUbuntu index 5b21b66..e2becba 100644 --- a/.tests/DockerfileUbuntu +++ b/.tests/DockerfileUbuntu @@ -12,17 +12,14 @@ RUN apt-get update \ && curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3 \ && python3 --version \ && echo "NodeJS $(node --version)" \ - && echo "Yarn $(yarn --version)" \ - && git clone --single-branch --branch v1.0.0 --depth 1 https://github.com/checktheroads/hyperglass + && echo "Yarn $(yarn --version)" + # && git clone --single-branch --branch v1.0.0 --depth 1 https://github.com/checktheroads/hyperglass +COPY ./ /tmp/hyperglass ENV PATH=$PATH:/root/.poetry/bin # ENV BASH_ENV=/etc/profile exec bash FROM base as install -WORKDIR ./hyperglass +WORKDIR /tmp/hyperglass RUN poetry install --no-ansi - -FROM install as setup -WORKDIR ./hyperglass -RUN poetry run hyperglass setup -d -EXPOSE 8001 -CMD poetry run hyperglass start +COPY ./dockersetup.sh /dockersetup.sh +ENTRYPOINT ["/dockersetup.sh"]