Skip to content

Commit

Permalink
Fix Makefile so stop docker works on Linux (#608)
Browse files Browse the repository at this point in the history
## Context and purpose of the change

Fixes `make stop-docker` on Linux


## Brief Changelog

Call pkill commands in a pkill.sh file via bash to prevent the exit code of 1 from stopping the make in Linux

## Author's Checklist

I have...

- [ ] Run and PASSED locally all GAIA integration tests
- [ ] If the change is contentful, I either:
    - [ ] Added a new unit test OR 
    - [ ] Added test cases to existing unit tests
- [x] OR this change is a trivial rework / code cleanup without any test coverage

If skipped any of the tests above, explain.


## Reviewers Checklist

*All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.*

I have...

- [ ] reviewed state machine logic
- [ ] reviewed API design and naming
- [ ] manually tested (if applicable)
- [ ] confirmed the author wrote unit tests for new logic
- [ ] reviewed documentation exists and is accurate


## Documentation and Release Note

  - [ ] Does this pull request introduce a new feature or user-facing behavior changes? 
  - [ ] Is a relevant changelog entry added to the `Unreleased` section in `CHANGELOG.md`?
  - [ ] This pull request updates existing proto field values (and require a backend and frontend migration)? 
  - [ ] Does this pull request change existing proto field names (and require a frontend migration)?
  How is the feature or change documented? 
      - [ ] not applicable
      - [ ] jira ticket `XXX` 
      - [ ] specification (`x/<module>/spec/`) 
      - [ ] README.md 
      - [ ] not documented
  • Loading branch information
khdegraaf authored Feb 21, 2023
1 parent 94e3a91 commit c7ae1f5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 23 deletions.
40 changes: 17 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ BUILD_FLAGS := -tags "$(build_tags)" -ldflags '$(ldflags)'

.PHONY: build

all: lint check-dependencies build-local

###############################################################################
### Build & Clean ###
###############################################################################
Expand All @@ -81,15 +79,13 @@ build:
install: go.sum
go install $(BUILD_FLAGS) ./cmd/strided

clean:
rm -rf $(BUILDDIR)/*
clean:
rm -rf $(BUILDDIR)/*

###############################################################################
### CI ###
###############################################################################

ci: lint check-dependencies test-unit gosec build-local

gosec:
gosec -exclude-dir=deps -severity=high ./...

Expand All @@ -103,11 +99,11 @@ lint:
test-unit:
@go test -mod=readonly ./x/... ./app/...

test-unit-module:
@go test -mod=readonly ./x/$(module)/...
test-unit-path:
@go test -mod=readonly ./x/$(path)/...

test-cover:
@go test -mod=readonly -race -coverprofile=coverage.out -covermode=atomic ./x/$(module)/...
@go test -mod=readonly -race -coverprofile=coverage.out -covermode=atomic ./x/$(path)/...

test-integration-docker:
bash $(DOCKERNET_HOME)/tests/run_all_tests.sh
Expand All @@ -116,31 +112,29 @@ test-integration-docker:
### DockerNet ###
###############################################################################

build-docker:
build-docker:
@bash $(DOCKERNET_HOME)/build.sh -${build} ${BUILDDIR}

start-docker: build-docker
@bash $(DOCKERNET_HOME)/start_network.sh
@bash $(DOCKERNET_HOME)/start_network.sh

start-docker-all: build-docker
@ALL_HOST_CHAINS=true bash $(DOCKERNET_HOME)/start_network.sh
@ALL_HOST_CHAINS=true bash $(DOCKERNET_HOME)/start_network.sh

clean-docker:
@docker-compose -f $(DOCKERNET_COMPOSE_FILE) stop
@docker-compose -f $(DOCKERNET_COMPOSE_FILE) down
clean-docker:
@docker-compose -f $(DOCKERNET_COMPOSE_FILE) stop
@docker-compose -f $(DOCKERNET_COMPOSE_FILE) down
rm -rf $(DOCKERNET_HOME)/state
docker image prune -a

stop-docker:
@pkill -f "docker-compose .*stride.* logs" | true
@pkill -f "/bin/bash.*create_logs.sh" | true
@pkill -f "tail .*.log" | true
@bash $(DOCKERNET_HOME)/pkill.sh
docker-compose -f $(DOCKERNET_COMPOSE_FILE) down

upgrade-init:
upgrade-init:
PART=1 bash $(DOCKERNET_HOME)/tests/run_tests_upgrade.sh

upgrade-submit:
upgrade-submit:
UPGRADE_HEIGHT=400 bash $(DOCKERNET_HOME)/upgrades/submit_upgrade.sh

upgrade-validate:
Expand Down Expand Up @@ -209,7 +203,7 @@ localnet-state-export-startd:
@docker-compose -f $(STATE_EXPORT_COMPOSE_FILE) up -d

localnet-state-export-upgrade:
bash $(LOCALSTRIDE_HOME)/state-export/scripts/submit_upgrade.sh
bash $(LOCALSTRIDE_HOME)/state-export/scripts/submit_upgrade.sh

localnet-state-export-stop:
@docker-compose -f $(STATE_EXPORT_COMPOSE_FILE) down
Expand Down
3 changes: 3 additions & 0 deletions dockernet/pkill.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pkill -f "docker-compose .*stride.* logs" | true
pkill -f "/bin/bash.*create_logs.sh" | true
pkill -f "tail .*.log" | true

0 comments on commit c7ae1f5

Please sign in to comment.