Skip to content
This repository has been archived by the owner on Sep 21, 2020. It is now read-only.

Commit

Permalink
Merge pull request #53 from UKHomeOffice/go-clamav-rest
Browse files Browse the repository at this point in the history
Use go-clamav-rest over clamav-rest
  • Loading branch information
asmith030 committed Feb 13, 2020
2 parents 94a34f6 + 466fa67 commit b1ccfa0
Show file tree
Hide file tree
Showing 19 changed files with 293 additions and 908 deletions.
16 changes: 8 additions & 8 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pipeline:

scan-clamav-rest:
image: quay.io/ukhomeofficedigital/anchore-submission:latest
image_name: clamav-rest
image_name: go-clamav-rest
when:
event: push

Expand All @@ -37,7 +37,7 @@ pipeline:
environment:
- DOCKER_HOST=tcp://172.17.0.1:2375
commands:
- docker build -t clamav-rest:$${DRONE_COMMIT_SHA} clamav-rest
- docker build -t go-clamav-rest:$${DRONE_COMMIT_SHA} go-clamav-rest
when:
branch: master
event: [push, tag]
Expand Down Expand Up @@ -66,10 +66,10 @@ pipeline:
- DOCKER_HOST=tcp://172.17.0.1:2375
commands:
- docker login -u="ukhomeofficedigital+drone" -p=$${CLAMAV_REPO_TOKEN} quay.io
- docker tag clamav-rest:$${DRONE_COMMIT_SHA} quay.io/ukhomeofficedigital/clamav-rest:$${DRONE_COMMIT_SHA}
- docker tag clamav-rest:$${DRONE_COMMIT_SHA} quay.io/ukhomeofficedigital/clamav-rest:latest
- docker push quay.io/ukhomeofficedigital/clamav-rest:$${DRONE_COMMIT_SHA}
- docker push quay.io/ukhomeofficedigital/clamav-rest:latest
- docker tag go-clamav-rest:$${DRONE_COMMIT_SHA} quay.io/ukhomeofficedigital/go-clamav-rest:$${DRONE_COMMIT_SHA}
- docker tag go-clamav-rest:$${DRONE_COMMIT_SHA} quay.io/ukhomeofficedigital/go-clamav-rest:latest
- docker push quay.io/ukhomeofficedigital/go-clamav-rest:$${DRONE_COMMIT_SHA}
- docker push quay.io/ukhomeofficedigital/go-clamav-rest:latest
when:
branch: master
event: push
Expand All @@ -95,7 +95,7 @@ pipeline:
- DOCKER_HOST=tcp://172.17.0.1:2375
commands:
- docker login -u="ukhomeofficedigital+drone" -p=$${CLAMAV_REPO_TOKEN} quay.io
- docker tag clamav-rest:$${DRONE_COMMIT_SHA} quay.io/ukhomeofficedigital/clamav-rest:$${DRONE_TAG}
- docker push quay.io/ukhomeofficedigital/clamav-rest:$${DRONE_TAG}
- docker tag go-clamav-rest:$${DRONE_COMMIT_SHA} quay.io/ukhomeofficedigital/go-clamav-rest:$${DRONE_TAG}
- docker push quay.io/ukhomeofficedigital/go-clamav-rest:$${DRONE_TAG}
when:
event: tag
12 changes: 6 additions & 6 deletions ci-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ function clean_up() {
echo "No clamav container found."
fi

if docker ps -a --filter "name=clamav-rest" | grep clamav-rest &>/dev/null; then
if docker ps -a --filter "name=go-clamav-rest" | grep go-clamav-rest &>/dev/null; then
echo "Removing old clamav-rest container..."
docker stop clamav-rest &>/dev/null && docker rm clamav-rest &>/dev/null
docker stop go-clamav-rest &>/dev/null && docker rm go-clamav-rest &>/dev/null
else
echo "No clamav-rest container found."
fi
Expand All @@ -63,9 +63,9 @@ function clean_up() {
echo "No clamav image found."
fi

if docker images clamav-rest | grep clamav-rest &>/dev/null; then
if docker images go-clamav-rest | grep go-clamav-rest &>/dev/null; then
echo "Removing clamav-rest image..."
docker rmi clamav-rest
docker rmi go-clamav-rest
else
echo "No clamav-rest image found."
fi
Expand Down Expand Up @@ -114,10 +114,10 @@ echo "=========="
echo "TESTING REST API..."
echo "=========="

docker build -t ${TAG}-rest clamav-rest
docker build -t go-${TAG}-rest go-clamav-rest

#start container.
docker run -id -p 8080:8080 --name=clamav-rest -e HOST=clamav --link clamav:clamav clamav-rest
docker run -id -p 8080:8080 --name=go-clamav-rest --link clamav:clamav go-clamav-rest -host clamav
sleep 30 #wait for app to start

REST_CMD=$(curl -w %{http_code} -s --output /dev/null 172.17.0.1:8080)
Expand Down
27 changes: 0 additions & 27 deletions clamav-rest/Dockerfile

This file was deleted.

Loading

0 comments on commit b1ccfa0

Please sign in to comment.