Skip to content

Commit

Permalink
Simplify our makefile as much as possible (#753)
Browse files Browse the repository at this point in the history
refactor(makefile): simplify makefile by removing the autogenerated targets and make building binaries and dockerfiles separate operations.
  • Loading branch information
slim-bean authored Jul 29, 2019
1 parent d8ee6b8 commit 573673a
Show file tree
Hide file tree
Showing 9 changed files with 347 additions and 261 deletions.
28 changes: 10 additions & 18 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ jobs:
- run:
name: Run Unit Tests
command: |
touch loki-build-image/.uptodate &&
make BUILD_IN_CONTAINER=false test
make test
lint:
<<: *defaults
Expand All @@ -68,13 +67,11 @@ jobs:
- run:
name: Lint
command: |
touch loki-build-image/.uptodate &&
make BUILD_IN_CONTAINER=false lint
make lint
- run:
name: Check Generated Fies
command: |
touch loki-build-image/.uptodate &&
make BUILD_IN_CONTAINER=false check-generated-files
build:
Expand All @@ -86,22 +83,19 @@ jobs:
- run:
name: Promtail cross platform
command: |
touch loki-build-image/.uptodate &&
make GOOS=linux BUILD_IN_CONTAINER=false cmd/promtail/promtail
make GOOS=linux BUILD_IN_CONTAINER=false promtail
rm cmd/promtail/promtail
make GOOS=windows BUILD_IN_CONTAINER=false cmd/promtail/promtail
make GOOS=windows BUILD_IN_CONTAINER=false promtail
- run:
name: Build Images
command: |
touch loki-build-image/.uptodate &&
make BUILD_IN_CONTAINER=false
make images
- run:
name: Save Images
command: |
touch loki-build-image/.uptodate &&
make BUILD_IN_CONTAINER=false save-images
make save-images
- save_cache:
key: v1-loki-{{ .Branch }}-{{ .Revision }}
Expand All @@ -127,8 +121,7 @@ jobs:
- run:
name: Load Images
command: |
touch loki-build-image/.uptodate &&
make BUILD_IN_CONTAINER=false load-images
make load-images
- run:
name: Push Images
Expand All @@ -143,7 +136,7 @@ jobs:
command: |
if [ -n "$DOCKER_USER" ]; then
docker login -u "$DOCKER_USER" -p "$DOCKER_PASS" &&
make BUILD_IN_CONTAINER=false push-plugin
make docker-driver-push
fi
publish-master:
Expand All @@ -160,8 +153,7 @@ jobs:
- run:
name: Load Images
command: |
touch loki-build-image/.uptodate &&
make BUILD_IN_CONTAINER=false load-images
make load-images
- run:
name: Push Images
Expand All @@ -174,7 +166,7 @@ jobs:
command: |
if [ -n "$DOCKER_USER" ]; then
docker login -u "$DOCKER_USER" -p "$DOCKER_PASS" &&
PLUGIN_TAG=master make BUILD_IN_CONTAINER=false push-plugin && PLUGIN_TAG=latest make BUILD_IN_CONTAINER=false push-plugin
PLUGIN_TAG=master make docker-driver-push && PLUGIN_TAG=latest make docker-driver-push
fi
test-helm:
Expand Down
Loading

0 comments on commit 573673a

Please sign in to comment.