Skip to content

Commit

Permalink
build(docker-test): Don't build all of Kubernetes (this kills the crab)
Browse files Browse the repository at this point in the history
  • Loading branch information
elldritch committed Jun 15, 2018
1 parent 7d65cf2 commit f72b2bc
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 20 deletions.
67 changes: 52 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
version: 2

defaults: &defaults
working_directory: /home/fossa/go/src/github.com/fossas/fossa-cli
environment:
TEST_RESULTS: /tmp/test-results
ARTIFACTS: /tmp/artifacts
WORKSPACE: /tmp/workspace

jobs:
build:
<<: *defaults
docker:
- image: quay.io/fossa/fossa-cli:latest
working_directory: /home/fossa/go/src/github.com/fossas/fossa-cli
environment:
TEST_RESULTS: /tmp/test-results
ARTIFACTS: /tmp/artifacts
steps:
- checkout
- run:
Expand Down Expand Up @@ -36,21 +41,53 @@ jobs:
# # Run tests
# go test ./...
- run:
name: Run integration tests
command: |
# Load shell helpers (e.g. sdkman)
source /home/fossa/.bashrc
# Run tests
./test.sh
- run:
name: Run FOSSA build
name: Run FOSSA analysis
command: |
fossa --debug 2> tee $ARTIFACTS/fossa-build-stderr
fossa analyze --debug 2> tee $ARTIFACTS/fossa-build-stderr
- run:
name: Run FOSSA license check
command: |
fossa test --debug 2> tee $ARTIFACTS/fossa-test-stderr
- run:
name: Save artifacts
command: |
cp $(which fossa) $ARTIFACTS
- run:
name: Save workspace
command: |
cp $(which fossa) $WORKSPACE
- store_test_results:
path: /tmp/test-results
path: $TEST_RESULTS
- store_artifacts:
path: /tmp/artifacts
path: $ARTIFACTS
- persist_to_workspace:
root: $WORKSPACE
paths:
- fossa
test:
<<: *defaults
docker:
- image: quay.io/fossa/fossa-cli-test:latest
steps:
- attach_workspace:
at: $WORKSPACE
- run:
name: Load workspace
command: |
cp $WORKSPACE/fossa $GOPATH/bin/fossa
- run:
name: Run integration tests
command: |
# Load shell helpers (e.g. sdkman)
source /home/fossa/.bashrc
# Run tests
./test.sh
workflows:
version: 2
build-and-test:
jobs:
- build
- test:
requires:
- build
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,17 @@ $(PREFIX)/fossa: $(BIN)/fossa
# Building various Docker images.
.PHONY: docker-base
docker-base: ./docker/base/Dockerfile
sudo docker build -t fossa-cli-base -f ./docker/base/Dockerfile .
sudo docker build -t quay.io/fossa/fossa-cli-base -f ./docker/base/Dockerfile .

.PHONY: docker
docker-devel: docker-base ./docker/devel/Dockerfile
sudo docker build -t fossa-cli-devel -f ./docker/devel/Dockerfile .
sudo docker build -t fossa-cli -f ./docker/devel/Dockerfile .
sudo docker tag fossa-cli quay.io/fossa/fossa-cli

.PHONY: docker-test
docker-test: docker-base ./docker/test/Dockerfile
sudo docker build -t fossa-cli-test -f ./docker/test/Dockerfile .
sudo docker tag fossa-cli-test quay.io/fossa/fossa-cli-test

# Useful build tasks.
.PHONY: install
Expand All @@ -56,5 +58,6 @@ vendor: $(DEP)
clean:
rm -f $(BIN)/fossa

# TODO: release task that builds and deploys in the Dockerfile?
# TODO: test task that runs in Dockerfile?
.PHONY: release
release:
GOVERSION=$(go version) goreleaser --rm-dist
2 changes: 1 addition & 1 deletion docker/test/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RUN mkdir -p $GOPATH/src/k8s.io && \
cd $GOPATH/src/k8s.io && \
git clone --depth=1 https://github.com/kubernetes/kubernetes && \
cd kubernetes && \
make
make ./cmd/kube-apiserver

## Consul (nested govendor)
### This is currently vendored because of the go-discover vendor.json syntax
Expand Down

0 comments on commit f72b2bc

Please sign in to comment.