Skip to content

Commit 1b891f4

Browse files
committed
fix(docker): simplify stuff to workaround unneseccary problems with docker run
1 parent 89f2ec4 commit 1b891f4

File tree

5 files changed

+19
-27
lines changed

5 files changed

+19
-27
lines changed

.dockerignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.dockerignore
2+
Dockerfile
3+
maintenance_scripts/docker_test.sh

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
__pycache__/
22
.mypy_cache/
3-
Dockerfile
43
locale/*.mo
54
locale/pikaur.pot
65
.idea/

.travis.yml

-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@ language: minimal
22
services:
33
- docker
44
script:
5-
- mv ./maintenance_scripts/Dockerfile ./
65
- ./maintenance_scripts/docker_test.sh --coveralls

maintenance_scripts/Dockerfile Dockerfile

+9
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
FROM archlinux/base
44
WORKDIR /opt/app-build/
55

6+
ARG TRAVIS
7+
ARG TRAVIS_JOB_ID
8+
ARG TRAVIS_BRANCH
9+
ARG TRAVIS_PULL_REQUEST
10+
ARG MODE=--local
11+
612
RUN pacman -Syu --noconfirm --needed sudo base-devel git && \
713
useradd -m user && \
814
echo "root ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
@@ -22,6 +28,9 @@ RUN pacman -Sy ruby-ronn asp --noconfirm --needed && \
2228
sudo -u user tar --transform 's,^,pikaur-git/,' -cf pikaur-git.tar.gz . && \
2329
sudo -u user sed -i 's/"$pkgname::.*"/"pikaur-git.tar.gz"/' PKGBUILD && \
2430
sudo -u user makepkg -fsi --noconfirm && \
31+
sleep 0.1 && \
2532
sudo -u user pikaur -S --noconfirm --color=always python-virtualenv \
2633
python-pylint flake8 mypy python-vulture python-coveralls \
2734
python2 python2-setuptools iputils # @TODO: coveralls workaround
35+
36+
RUN sudo -u user ./maintenance_scripts/ci.sh $MODE --write-db

maintenance_scripts/docker_test.sh

+7-25
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,15 @@ set -x
1010
cd "$(readlink -e "$(dirname "${0}")")"/.. || exit 2
1111

1212

13-
rm -fr ./htmlcov/*
14-
mkdir -p ./htmlcov/
15-
16-
17-
sudo docker build ./ -t pikaur -f ./Dockerfile
18-
1913
return_code=0
20-
sudo docker \
21-
container run \
22-
--dns="8.8.8.8" \
23-
--tty \
24-
--interactive \
25-
--volume /run/dbus/system_bus_socket:/run/dbus/system_bus_socket:ro \
26-
--volume "$(readlink -e ./htmlcov/)":/opt/app-build/htmlcov \
27-
pikaur:latest \
28-
sudo \
29-
-u user \
30-
env TRAVIS="${TRAVIS:-}" \
31-
TRAVIS_JOB_ID="${TRAVIS_JOB_ID:-}" \
32-
TRAVIS_BRANCH="${TRAVIS_BRANCH:-}" \
33-
TRAVIS_PULL_REQUEST="${TRAVIS_PULL_REQUEST:-}" \
34-
./maintenance_scripts/ci.sh "${1:--local}" --write-db \
14+
sudo docker build ./ \
15+
--build-arg TRAVIS="${TRAVIS:-}" \
16+
--build-arg TRAVIS_JOB_ID="${TRAVIS_JOB_ID:-}" \
17+
--build-arg TRAVIS_BRANCH="${TRAVIS_BRANCH:-}" \
18+
--build-arg TRAVIS_PULL_REQUEST="${TRAVIS_PULL_REQUEST:-}" \
19+
--build-arg MODE="${1:---local}" \
20+
-t pikaur -f ./Dockerfile \
3521
|| return_code=$?
3622

37-
if [[ "${1:-}" == "--local" ]] && [[ ${return_code} -eq 0 ]] ; then
38-
firefox htmlcov/index.html
39-
fi
40-
4123
echo "Exited with $return_code"
4224
exit ${return_code}

0 commit comments

Comments
 (0)