Skip to content

Commit

Permalink
Testing [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
vfarcic committed Jun 29, 2017
1 parent 9bbf14e commit 9f96fec
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 48 deletions.
3 changes: 2 additions & 1 deletion Dockerfile.docs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
FROM cilerler/mkdocs AS build
MAINTAINER Viktor Farcic <[email protected]>
ADD . /docs
RUN pip install pygments && pip install pymdown-extensions && mkdocs build --site-dir /site
RUN pip install pygments && pip install pymdown-extensions
RUN mkdocs build --site-dir /site


FROM nginx:1.11-alpine
Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ pipeline {
steps {
checkout scm
sh "docker image build -t vfarcic/docker-flow-proxy ."
sh "docker image build -t vfarcic/docker-flow-proxy-docs -f Dockerfile.docs ."
sh "docker tag vfarcic/docker-flow-proxy vfarcic/docker-flow-proxy:beta"
withCredentials([usernamePassword(
credentialsId: "docker",
Expand All @@ -22,6 +21,7 @@ pipeline {
sh "docker push vfarcic/docker-flow-proxy:beta"
sh "docker image build -t vfarcic/docker-flow-proxy-test -f Dockerfile.test ."
sh "docker push vfarcic/docker-flow-proxy-test"
sh "docker image build -t vfarcic/docker-flow-proxy-docs -f Dockerfile.docs ."
}
}
stage("test") {
Expand Down
14 changes: 0 additions & 14 deletions docker-compose-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,10 @@ version: "2"

services:

unit:
image: golang:1.7
volumes:
- .:/usr/src/myapp
- /tmp/go:/go
working_dir: /usr/src/myapp
command: sh -c "go get -d -v -t && go test --cover ./... --run UnitTest && go build -v -o docker-flow-proxy"

staging-swarm:
image: vfarcic/docker-flow-proxy-test
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- HOST_IP=${HOST_IP}
- DOCKER_HUB_USER=${DOCKER_HUB_USER}

docs:
image: cilerler/mkdocs
volumes:
- .:/docs
command: bash -c "pip install pygments && pip install pymdown-extensions && mkdocs build"
42 changes: 10 additions & 32 deletions docs/feedback-and-contribution.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,57 +50,35 @@ docker image build -t $DOCKER_HUB_USER/docker-flow-proxy .

### The Complete Cycle (Unit, Build, Staging)

#### Setup
Docker 17.05+ is required.

```bash
# Change to the IP of your host
export HOST_IP=[...]
```
#### Unit Tests & Build

#### Unit Tests
Unit tests are executed as part of the build.

```bash
docker-compose \
-f docker-compose-test.yml \
run --rm unit
docker image build -t vfarcic/docker-flow-proxy .
```

#### Staging (Integration) Tests

```bash
# Change to the IP of your host
export HOST_IP=[...]

# Change to your user in hub.docker.com
export DOCKER_HUB_USER=[...]

docker image build \
-t $DOCKER_HUB_USER/docker-flow-proxy:beta \
.
docker tag $DOCKER_HUB_USER/docker-flow-proxy \
vfarcic/docker-flow-proxy:beta

docker image push \
$DOCKER_HUB_USER/docker-flow-proxy:beta
docker push $DOCKER_HUB_USER/docker-flow-proxy:beta

docker-compose \
-f docker-compose-test.yml \
run --rm staging-swarm
```

##### Locally simulating CI

All above can be executed in same manner as CI is running it before a build using the command that follows.

```bash
# Change to your user in hub.docker.com
export DOCKER_HUB_USER=[...]

# Change to the IP of your host
export HOST_IP=[...]

./scripts/local-ci.sh
```

The script requires:

* docker logged in to docker hub with $DOCKER_HUB_USER user

### Pull Request

Once the feature is done, create a pull request.

0 comments on commit 9f96fec

Please sign in to comment.