-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CI] Add cosmovisor to container images (#796)
## Summary Add cosmovisor binary to our container images. It will allow us to use cosmovisor in [docker-compose-example](https://github.com/pokt-network/poktroll-docker-compose-example) repo in the future to automate upgrades. ## Type of change Select one or more from the following: - [ ] New feature, functionality or library - [ ] Consensus breaking; add the `consensus-breaking` label if so. See #791 for details - [ ] Bug fix - [ ] Code health or cleanup - [ ] Documentation - [x] Other - tooling ## Testing No code was changed - no reason for extensive testing. - Tested Dockerfile.release locally and Dockerfile.dev will be tested by CI. ## Sanity Checklist - [x] I have tested my changes using the available tooling - [x] I have commented my code - [x] I have performed a self-review of my own code; both comments & source code - [ ] I create and reference any new tickets, if applicable - [ ] I have left TODOs throughout the codebase, if applicable
- Loading branch information
Showing
5 changed files
with
39 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,6 +85,35 @@ install_ci_deps: ## Installs `mockgen` and other go tools | |
go install golang.org/x/tools/cmd/goimports@latest | ||
go install github.com/mikefarah/yq/v4@latest | ||
|
||
.PHONY: install_cosmovisor | ||
install_cosmovisor: ## Installs `cosmovisor` | ||
go install cosmossdk.io/tools/cosmovisor/cmd/[email protected] && cosmovisor version --cosmovisor-only | ||
|
||
.PHONY: cosmovisor_cross_compile | ||
cosmovisor_cross_compile: # Installs multiple cosmovisor binaries for different platforms (used by Dockerfile.release) | ||
@COSMOVISOR_VERSION="v1.6.0"; \ | ||
PLATFORMS="linux/amd64 linux/arm64"; \ | ||
mkdir -p ./tmp; \ | ||
echo "Fetching Cosmovisor source..."; \ | ||
temp_dir=$$(mktemp -d); \ | ||
cd $$temp_dir; \ | ||
go mod init temp; \ | ||
go get cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@$$COSMOVISOR_VERSION; \ | ||
for platform in $$PLATFORMS; do \ | ||
OS=$${platform%/*}; \ | ||
ARCH=$${platform#*/}; \ | ||
echo "Compiling for $$OS/$$ARCH..."; \ | ||
GOOS=$$OS GOARCH=$$ARCH go build -o $(CURDIR)/tmp/cosmovisor-$$OS-$$ARCH cosmossdk.io/tools/cosmovisor/cmd/cosmovisor; \ | ||
done; \ | ||
cd $(CURDIR); \ | ||
rm -rf $$temp_dir; \ | ||
echo "Compilation complete. Binaries are in ./tmp/"; \ | ||
ls -l ./tmp/cosmovisor-* | ||
|
||
.PHONY: cosmovisor_clean | ||
cosmovisor_clean: | ||
rm -f ./tmp/cosmovisor-* | ||
|
||
######################## | ||
### Makefile Helpers ### | ||
######################## | ||
|