Initial commit
This commit is contained in:
commit
cb403bf2f3
25
.gitlab-ci.yml
Normal file
25
.gitlab-ci.yml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
image: docker:stable
|
||||||
|
|
||||||
|
variables:
|
||||||
|
DOCKER_HOST: tcp://docker:2375/
|
||||||
|
DOCKER_DRIVER: overlay2
|
||||||
|
CONTAINER_NAME: lab.wtfteam.pro:4567/containers/tdlib
|
||||||
|
|
||||||
|
services:
|
||||||
|
- docker:dind
|
||||||
|
|
||||||
|
stages:
|
||||||
|
- build
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
|
||||||
|
|
||||||
|
build:
|
||||||
|
stage: build
|
||||||
|
script:
|
||||||
|
- source ci/set_docker_tag.sh
|
||||||
|
- docker build -t $CONTAINER_NAME:$DOCKER_TAG .
|
||||||
|
- docker push $CONTAINER_NAME:$DOCKER_TAG
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
- master
|
25
Dockerfile
Normal file
25
Dockerfile
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
FROM alpine as builder
|
||||||
|
|
||||||
|
ENV TDLIB_VERSION=1.3.0
|
||||||
|
|
||||||
|
RUN apk update && apk add gperf alpine-sdk openssl-dev git cmake zlib-dev
|
||||||
|
|
||||||
|
WORKDIR /tmp/_build_tdlib/
|
||||||
|
|
||||||
|
RUN git clone https://github.com/tdlib/td.git /tmp/_build_tdlib/
|
||||||
|
RUN git checkout v${TDLIB_VERSION}
|
||||||
|
|
||||||
|
RUN mkdir build
|
||||||
|
WORKDIR /tmp/_build_tdlib/build/
|
||||||
|
RUN cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||||
|
RUN cmake --build .
|
||||||
|
RUN make install
|
||||||
|
RUN rm -rf /tmp/_build_tdlib/
|
||||||
|
|
||||||
|
FROM alpine
|
||||||
|
|
||||||
|
LABEL maintainer="vladimir@hodakov.me"
|
||||||
|
|
||||||
|
RUN apk update && apk add --no-cache gperf openssl-dev git cmake zlib-dev
|
||||||
|
|
||||||
|
COPY --from=builder /usr/local/lib/libtd* /usr/local/lib/
|
7
ci/set_docker_tag.sh
Normal file
7
ci/set_docker_tag.sh
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
if [[ $CI_BUILD_REF_NAME == "master" ]]; then
|
||||||
|
export DOCKER_TAG=latest;
|
||||||
|
else
|
||||||
|
export DOCKER_TAG="${CI_BUILD_REF_NAME}";
|
||||||
|
fi
|
Reference in New Issue
Block a user