Browse Source

Added Travis tests

Óscar García Amor 1 year ago
parent
commit
211cc20b1f
4 changed files with 34 additions and 14 deletions
  1. 8 0
      .travis.yml
  2. 2 6
      Dockerfile
  3. 16 0
      Makefile
  4. 8 8
      README.md

+ 8 - 0
.travis.yml

@@ -0,0 +1,8 @@
+sudo: required
+language: bash
+
+services:
+  - docker
+
+script:
+  - make ci-test

+ 2 - 6
Dockerfile

@@ -1,10 +1,6 @@
-FROM alpine:3.4
+FROM alpine:3.6
 
-RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/main" >> \
- /etc/apk/repositories \
- && echo "http://dl-cdn.alpinelinux.org/alpine/edge/community" >> \
- /etc/apk/repositories \
- && apk -U --no-progress upgrade \
+RUN apk -U --no-progress upgrade \
  && apk -U --no-progress add tor
 
 EXPOSE 9001 9050

+ 16 - 0
Makefile

@@ -0,0 +1,16 @@
+DOCKER_USER := ogarcia
+DOCKER_ORGANIZATION := connectical
+DOCKER_IMAGE := tor
+
+docker-image:
+	docker build -t $(DOCKER_ORGANIZATION)/$(DOCKER_IMAGE) .
+
+docker-image-test: docker-image
+	docker run --rm $(DOCKER_ORGANIZATION)/$(DOCKER_IMAGE) /usr/bin/tor --version
+
+ci-test:
+	docker run -t -i --rm --privileged -v /run/docker.sock:/var/run/docker.sock -v $(PWD):/app -w /app alpine:3.6 \
+		sh -c 'apk -U --no-progress upgrade && apk -U --no-progress add docker make && make docker-image-test'
+
+.PHONY: docker-image docker-image-test ci-test
+# vim:ft=make

+ 8 - 8
README.md

@@ -1,6 +1,6 @@
-# Small docker of Tor client
+# Small docker of Tor client [![Build Status](https://travis-ci.org/ogarcia/docker-tor.svg?branch=master)](https://travis-ci.org/ogarcia/docker-tor)
 
-(c) 2015-2016 Óscar García Amor
+(c) 2015-2017 Óscar García Amor
 Redistribution, modifications and pull requests are welcomed under the terms
 of GPLv3 license.
 
@@ -12,7 +12,7 @@ activities and relationships, and state security.
 This docker packages **Tor** under [Alpine Linux](https://alpinelinux.org/),
 a lightweight Linux distribution.
 
-Visit [Docker Hub](https://hub.docker.com/r/ogarcia/docker-tor/) to see all
+Visit [Docker Hub](https://hub.docker.com/r/connectical/tor/) to see all
 available tags.
 
 ## Run
@@ -24,7 +24,7 @@ docker run -d \
   --name=tor \
   -v /srv/tor/cfg:/etc/tor \
   -v /srv/tor/data:/var/lib/tor \
-  ogarcia/docker-tor
+  connectical/tor
 ```
 
 This start `tor` client and store config in `/srv/tor/cfg` and data in
@@ -59,7 +59,7 @@ docker run -d \
   -p 127.0.0.1:9050:9050 \
   -v /srv/tor/cfg:/etc/tor \
   -v /srv/tor/data:/var/lib/tor \
-  ogarcia/docker-tor
+  connectical/tor
 ```
 
 Next, open your browser, set `127.0.0.1:9050` as socks proxy and go to
@@ -85,7 +85,7 @@ docker run -d \
   --name=tor \
   -v /srv/tor/cfg:/etc/tor \
   -v /srv/tor/data:/var/lib/tor \
-  ogarcia/docker-tor
+  connectical/tor
 ```
 
 ### Other
@@ -103,7 +103,7 @@ docker run -t -i --rm \
   -v /srv/tor/cfg:/etc/tor \
   -v /srv/tor/data:/var/lib/tor \
   --entrypoint=/bin/sh \
-  ogarcia/docker-tor
+  connectical/tor
 ```
 
 Please note that the `--rm` modifier destroy the docker after shell exit.
@@ -115,5 +115,5 @@ If you need to see a documented config file of `tor`, you can open the
 
 ```sh
 docker run -t -i --rm --entrypoint=/usr/bin/less \
-  ogarcia/docker-tor /etc/tor/torrc.sample
+  connectical/tor /etc/tor/torrc.sample
 ```