-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
126 additions
and
58 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
version: 2 | ||
jobs: | ||
validation: | ||
docker: | ||
- image: circleci/golang:1.9-alpine | ||
working_directory: /go/src/github.com/ahmedkamals/foo-protocol-proxy | ||
steps: | ||
- checkout | ||
- run: make get-deps setup validate nuke | ||
|
||
unit: | ||
docker: | ||
- image: circleci/golang:1.9-alpine | ||
|
||
working_directory: /go/src/github.com/ahmedkamals/foo-protocol-proxy | ||
steps: | ||
- checkout | ||
- run: make setup unit nuke | ||
|
||
integration: | ||
docker: | ||
- image: circleci/golang:1.9-alpine | ||
|
||
working_directory: /go/src/github.com/ahmedkamals/foo-protocol-proxy | ||
steps: | ||
- checkout | ||
- run: make setup integration nuke |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
Ahmed Kamal <me.ahmed.kamal@gmail.com> Ahmed Kamal <ahmedkamals@users.noreply.github.com> |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# InfraKit maintainers file | ||
# | ||
# This file describes who runs the foo-protocol-proxy project and how. | ||
# This is a living document - if you see something out of date or missing, speak up! | ||
# | ||
# It is structured to be consumable by both humans and programs. | ||
# To extract its contents programmatically, use any TOML-compliant parser. | ||
# | ||
# This file is compiled into the MAINTAINERS file in docker/opensource. | ||
# | ||
[Org] | ||
[Org."Core maintainers"] | ||
people = [ | ||
"ahmedkamals" | ||
] | ||
|
||
[people] | ||
|
||
# A reference list of all people associated with the project. | ||
# All other sections should refer to people by their canonical key | ||
# in the people section. | ||
|
||
# ADD YOURSELF HERE IN ALPHABETICAL ORDER | ||
|
||
[people.ahmedkamals] | ||
Name = "Ahmed Kamal" | ||
Email = "me.ahmed.kamal@gmail.com" | ||
GitHub = "ahmedkamals" |
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 |
---|---|---|
@@ -1,21 +1,21 @@ | ||
DOCKER := $(shell docker info > /dev/null 2>&1 || $(SUDO) 2>&1) docker | ||
|
||
image: ## to build a docker image. | ||
@echo "$(WARN_COLOR)$(MSG_PREFIX) Creating Docker Image$(MSG_SUFFIX)$(NO_COLOR)" | ||
@echo "$(WARN_COLOR)$(MSG_PREFIX) 🐳 Creating Docker Image$(MSG_SUFFIX)$(NO_COLOR)" | ||
@$(DOCKER) build ${DOCKER_BUILD_FLAGS} -t $(REGISTRY_REPO):$(DOCKER_TAG) -f $(DOCKER_FILE) $(args) 2>&1 | ||
|
||
deploy: ## to deploy a docker container. | ||
@echo "$(WARN_COLOR)$(MSG_PREFIX) Deploying Docker Container$(MSG_SUFFIX)$(NO_COLOR)" | ||
@echo "$(WARN_COLOR)$(MSG_PREFIX) 🐳 Deploying Docker Container$(MSG_SUFFIX)$(NO_COLOR)" | ||
@$(SUDO) bash ./deploy.sh $(args) 2>&1 | ||
|
||
publish: ## to publish the docker image to dockerhub repository. | ||
@echo "$(WARN_COLOR)$(MSG_PREFIX) Pushing Docker Image to $(REGISTRY_REPO):$(DOCKER_TAG)$(MSG_SUFFIX)$(NO_COLOR)" | ||
@echo "$(WARN_COLOR)$(MSG_PREFIX) 🐳 Pushing Docker Image to $(REGISTRY_REPO):$(DOCKER_TAG)$(MSG_SUFFIX)$(NO_COLOR)" | ||
@$(DOCKER) push $(REGISTRY_REPO):$(DOCKER_TAG) 2>&1 | ||
|
||
docker-kill: ## to send kill signal to the main process at the docker container. | ||
@echo "$(WARN_COLOR)$(MSG_PREFIX) Sending kill signal to main Docker process$(MSG_SUFFIX)$(NO_COLOR)" | ||
@echo "$(WARN_COLOR)$(MSG_PREFIX) 🐳 Sending kill signal to main Docker process$(MSG_SUFFIX)$(NO_COLOR)" | ||
@$(DOCKER) exec -it $(BINARY_PREFIX)-${DOCKER_TAG} pkill $(args) $(BINARY_PREFIX) > /dev/null 2>&1 | ||
|
||
docker-logs: ## to get logs from the docker container. | ||
@echo "$(WARN_COLOR)$(MSG_PREFIX) Getting logs of the Docker container$(MSG_SUFFIX)$(NO_COLOR)" | ||
@echo "$(WARN_COLOR)$(MSG_PREFIX) 🐳 Getting logs of the Docker container$(MSG_SUFFIX)$(NO_COLOR)" | ||
@$(DOCKER) logs -f $(BINARY_PREFIX)-${DOCKER_TAG} 2>&1 |
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
all: setup generate test coverage-html validate format nuke build-x install clean list help deploy ## to run all targets. | ||
|
||
list: ## to list all targets. | ||
@$(MAKE) -rRpqn | awk -F':' '/^[a-z0-9][^$#\/\t=]*:([^=]|$$)/ {split($$1,A,/ /);for(i in A)printf "$(DISCLAIMER_COLOR)%-30s$(NO_COLOR)\n", A[i]}' | sort -u 2>&1 | ||
|
||
help: ## to get help about the targets. | ||
@echo "$(OK_COLOR)$$FOO_PROTOCOL_PROXY$(NO_COLOR)" | ||
@echo "$(INFO_COLOR)Please use \`make <target>\`, Available options for <target> are:$(NO_COLOR)\n" | ||
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z._-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf " $(HELP_COLOR)%-28s$(NO_COLOR) %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort -u 2>&1 | ||
@echo "Useful variables:" | ||
@awk 'BEGIN { FS = ":=" } /^## /{x = substr($$0, 4); getline; if (NF >= 2) printf " $(DISCLAIMER_COLOR)%-28s$(NO_COLOR) %s\n", $$1, x}' $(MAKEFILE_LIST) | sort -u 2>&1 | ||
|
||
setup: ## to setup the external used tools. | ||
@echo "$(OK_COLOR)$(MSG_PREFIX) Setting-up required components$(MSG_SUFFIX)$(NO_COLOR)" | ||
@$(GO) install $(GO_FLAGS) -tags $(GO_TAGS) $(PKGS) 2>&1 | ||
|
||
get-deps: ## to get required dependencies. | ||
@echo "$(OK_COLOR)$(MSG_PREFIX) Installing required dependencies$(MSG_SUFFIX)$(NO_COLOR)" | ||
@$(foreach dependency, $(DEPENDENCIES), $(call getDependency,$(dependency))) | ||
|
||
generate: ## to generate related files. | ||
@echo "$(OK_COLOR)$(MSG_PREFIX) Generating files via go generate$(MSG_SUFFIX)$(NO_COLOR)" | ||
@$(GO) generate $(GO_FLAGS) $(PKGS) 2>&1 | ||
|
||
install: ## to install the generated binary. | ||
@echo "$(OK_COLOR)$(MSG_PREFIX) Installing generated binary$(MSG_SUFFIX)$(NO_COLOR)" | ||
@if [ ! -f $(TARGET_BINARY) ] ; then $(MAKE) build; fi | ||
@cp $(TARGET_BINARY) $(INSTALLATION_BASE_PATH) 2>&1 | ||
|
||
clean: clean-bin clean-coverage ## to clean up all generated files. | ||
|
||
nuke: clean ## to do clean up and enforce removing the corresponding installed archive or binary. | ||
@echo "$(OK_COLOR)$(MSG_PREFIX) Cleaning go dependencies$(MSG_SUFFIX)$(NO_COLOR)" | ||
@$(GO) clean -i $(GO_FLAGS) ./... net 2>&1 | ||
|
||
run: ## to run the generated binary, and build a new one if not existed. | ||
@echo "$(OK_COLOR)$(MSG_PREFIX) Running generated binary$(MSG_SUFFIX)$(NO_COLOR)" | ||
@if [ ! -f $(TARGET_BINARY) ] ; then $(MAKE) build; fi | ||
@$(TARGET_BINARY) $(args) 2>&1 | ||
|
||
kill: ## to send a kill signal to the running process of the binary. | ||
@echo "$(OK_COLOR)$(MSG_PREFIX) Sending kill signal $(args)$(MSG_SUFFIX)$(NO_COLOR)" | ||
@pkill $(args) $(notdir $(TARGET_BINARY)) > /dev/null 2>&1 |
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