Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.

Commit

Permalink
Update Dockerfile tests to run make targets that woudl be executed on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
mikenairn authored and openshift-merge-robot committed Jan 7, 2020
1 parent 566a466 commit d00354c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
10 changes: 5 additions & 5 deletions openshift-ci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Base image used on CI for all builds and test jobs. See [here](https://github.co
#### Build and Test

```
$ docker build -t registry.svc.ci.openshift.org/openshift/release:intly-golang-1.13 - < Dockerfile.tools
$ IMAGE_NAME=registry.svc.ci.openshift.org/openshift/release:intly-golang-1.13 test/run
operator-sdk version: "v0.12.0", commit: "2445fcda834ca4b7cf0d6c38fba6317fb219b469", go version: "go1.13.5 linux/amd64"
go version go1.13.5 linux/amd64
hello world
$ docker build -t registry.svc.ci.openshift.org/integr8ly/heimdall-base-image:latest - < Dockerfile.tools
$ IMAGE_NAME=registry.svc.ci.openshift.org/integr8ly/heimdall-base-image:latest test/run
operator-sdk version: "v0.12.0", commit: "2445fcda834ca4b7cf0d6c38fba6317fb219b469", go version: "go1.13.5 linux/amd64"
go version go1.13.5 linux/amd64
...
SUCCESS!
```
13 changes: 7 additions & 6 deletions openshift-ci/test/run
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
# The image has to be available before this script is executed.
#

WORK_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

docker run --rm --entrypoint=/bin/sh ${IMAGE_NAME} -c 'operator-sdk version'
docker run --rm --entrypoint=/bin/sh ${IMAGE_NAME} -c 'go version'
docker run --rm --entrypoint=/bin/sh ${IMAGE_NAME} -c "cd /go/src/; mkdir hello; cd hello;
echo 'package main
import \"fmt\"
func main() {
fmt.Println(\"hello world\")
}' > main.go; go run main.go"

docker run --rm -u $UID -v "${WORK_DIR}/../..:/heimdall:z" --entrypoint=/bin/sh ${IMAGE_NAME} -c "cd /heimdall && make vendor/check"
docker run --rm -u $UID -v "${WORK_DIR}/../..:/heimdall:z" --entrypoint=/bin/sh ${IMAGE_NAME} -c "cd /heimdall && make code/check"
docker run --rm -u $UID -v "${WORK_DIR}/../..:/heimdall:z" --entrypoint=/bin/sh ${IMAGE_NAME} -c "cd /heimdall && make code/compile"
docker run --rm -u $UID -v "${WORK_DIR}/../..:/heimdall:z" --entrypoint=/bin/sh ${IMAGE_NAME} -c "cd /heimdall && make test/unit"

echo "SUCCESS!"

0 comments on commit d00354c

Please sign in to comment.