Add Docker and CI file

parent 0b702989
Pipeline #2528 passed with stages
in 5 minutes and 34 seconds
image: docker:git
services:
- docker:dind
stages:
- build
- test
- release
variables:
TEST_IMAGE: briar/go-reproducer:${CI_BUILD_REF_NAME}
RELEASE_IMAGE: briar/go-reproducer:latest
before_script:
- echo ${DOCKER_HUB_PASS} | docker login -u ${DOCKER_HUB_USER} --password-stdin
build:
stage: build
script:
- docker build -t ${TEST_IMAGE} .
- docker push $TEST_IMAGE
test_build:
stage: test
script:
- docker run ${TEST_IMAGE} /bin/bash -c "./build-obfs4proxy.py"
except:
- tags
release:
stage: release
script:
- docker pull $TEST_IMAGE
- docker tag $TEST_IMAGE $RELEASE_IMAGE
- docker push $RELEASE_IMAGE
only:
- master
FROM debian:stretch
ENV LANG=C.UTF-8
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /opt/go-reproducer
ADD build-*.py ./
ADD install*.sh ./
ADD versions.json ./
ADD utils.py ./
ADD template.pom ./
ADD template-android.pom ./
RUN ./install.sh
CMD ./build-obfs4proxy.py
#!/usr/bin/env bash
set -e
set -x
apt-get install -y --no-install-recommends \
ca-certificates \
git \
binutils \
zip \
unzip \
wget \
fastjar \
python \
python3
apt-get -y --no-install-recommends -t stretch-backports install \
golang
#!/usr/bin/env bash
set -e
set -x
# add backports repo
echo "deb http://ftp.debian.org/debian stretch-backports main" >> /etc/apt/sources.list
# update package sources
apt-get update
apt-get -y upgrade
# do not install documentation to keep image small
echo "path-exclude=/usr/share/locale/*" >> /etc/dpkg/dpkg.cfg.d/01_nodoc
echo "path-exclude=/usr/share/man/*" >> /etc/dpkg/dpkg.cfg.d/01_nodoc
echo "path-exclude=/usr/share/doc/*" >> /etc/dpkg/dpkg.cfg.d/01_nodoc
# install dependencies
./install-dependencies.sh
#./install-dependencies-verification.sh
# clean up for smaller image size
apt-get -y autoremove --purge
apt-get clean
rm -rf /var/lib/apt/lists/*
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