Skip to content

Commit 13e59aa

Browse files
committed
now caches build image
1 parent b7589d9 commit 13e59aa

File tree

4 files changed

+76
-4
lines changed

4 files changed

+76
-4
lines changed

Dockerfile.test

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM steemitinc/ci-test-environment:latest
2+
3+
ADD . /usr/local/src/steem
4+
5+
RUN \
6+
cd /usr/local/src/steem && \
7+
git submodule update --init --recursive && \
8+
mkdir build && \
9+
cd build && \
10+
cmake \
11+
-DCMAKE_BUILD_TYPE=Debug \
12+
-DBUILD_STEEM_TESTNET=ON \
13+
-DLOW_MEMORY_NODE=OFF \
14+
-DCLEAR_VOTES=ON \
15+
.. && \
16+
make -j$(nproc) chain_test && \
17+
./tests/chain_test && \
18+
cd /usr/local/src/steem && \
19+
doxygen && \
20+
programs/build_helpers/check_reflect.py

circle.yml

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
machine:
2-
services:
3-
- docker
2+
services:
3+
- docker
44

5-
test:
5+
dependencies:
6+
cache_directories:
7+
- "~/docker"
68
override:
79
- docker info
8-
- docker build --rm=false -t steemit/steem .
10+
- time bash tests/scripts/create-ci-docker-image.sh
11+
12+
test:
13+
override:
14+
- time docker build --rm=false -t steemitinc/steem-test -f Dockerfile.test .

tests/scripts/Dockerfile.testenv

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM phusion/baseimage:0.9.19
2+
3+
RUN \
4+
apt-get update && \
5+
apt-get install -y \
6+
autoconf \
7+
automake \
8+
autotools-dev \
9+
bsdmainutils \
10+
build-essential \
11+
cmake \
12+
doxygen \
13+
git \
14+
libboost-all-dev \
15+
libreadline-dev \
16+
libssl-dev \
17+
libtool \
18+
ncurses-dev \
19+
pbzip2 \
20+
python3 \
21+
python3-dev \
22+
&& \
23+
apt-get clean && \
24+
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
set -x
3+
4+
DOCKER_CACHE_DIR="$HOME/docker"
5+
6+
if [[ ! -d $DOCKER_CACHE_DIR ]]; then
7+
mkdir -p $DOCKER_CACHE_DIR
8+
fi
9+
10+
if [[ -e $DOCKER_CACHE_DIR/image.tar ]]; then
11+
du -sh $DOCKER_CACHE_DIR/image.tar
12+
docker load -i $DOCKER_CACHE_DIR/image.tar
13+
else
14+
docker build --rm=false \
15+
-t steemitinc/ci-test-environment:latest \
16+
-f tests/scripts/Dockerfile.testenv . && \
17+
mkdir -p ~/docker && \
18+
docker save steemitinc/ci-test-environment:latest \
19+
> $DOCKER_CACHE_DIR/image.tar.tmp && \
20+
mv $DOCKER_CACHE_DIR/image.tar.tmp $DOCKER_CACHE_DIR/image.tar && \
21+
du -sh $DOCKER_CACHE_DIR/image.tar
22+
fi

0 commit comments

Comments
 (0)