Skip to content

Commit

Permalink
chore: improve makefile cmds
Browse files Browse the repository at this point in the history
  • Loading branch information
martinsaporiti committed Oct 9, 2024
1 parent 994ed04 commit 961bce0
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 25 deletions.
24 changes: 10 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ REQUIRED_FILE := ${ISSUER_RESOLVER_PATH}
DOTENV_CMD = $(BIN)/godotenv
ENV = $(DOTENV_CMD) -f .env-issuer

.PHONY: run-full
run-full:
.PHONY: run-all-registry
run-all-registry:
@make down
ifeq ($(ISSUER_KMS_ETH_PROVIDER)$(ISSUER_KMS_BJJ_PROVIDER), localstoragelocalstorage)
$(DOCKER_COMPOSE_FULL_CMD) up -d redis postgres api pending_publisher notifications ui
Expand All @@ -50,10 +50,6 @@ build/docker: ## Build the docker image.
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
.

.PHONY: clean
clean: ## Go clean
$(GO) clean ./...

.PHONY: tests
tests:
$(GO) test -v ./... --count=1
Expand All @@ -73,7 +69,7 @@ api: $(BIN)/oapi-codegen
.PHONY: up
up:
ifeq ($(ISSUER_KMS_ETH_PROVIDER)$(ISSUER_KMS_BJJ_PROVIDER), localstoragelocalstorage)
$(DOCKER_COMPOSE_INFRA_CMD) up -d redis postgres
$(DOCKER_COMPOSE_INFRA_CMD) up -d redis postgres
else
$(DOCKER_COMPOSE_INFRA_CMD) up -d redis postgres vault
endif
Expand All @@ -84,14 +80,14 @@ endif
$(DOCKER_COMPOSE_INFRA_CMD) up -d redis postgres

# Build the docker image for the issuer-api
.PHONY: build
build:
docker build -t issuer-api:local -f ./Dockerfile .
.PHONY: build-api
build-api:
docker build -t issuernode-api:local -f ./Dockerfile .

# Build the docker image for the issuer-ui
.PHONY: build-ui
build-ui:
docker build -t issuer-ui:local -f ./ui/Dockerfile ./ui
docker build -t issuernode-ui:local -f ./ui/Dockerfile ./ui


.PHONY: validate_issuer_resolver_file
Expand Down Expand Up @@ -125,8 +121,8 @@ validate_localstorage_file:
fi

# Run the api, pending_publisher and notifications services
.PHONY: run
run: validate_issuer_resolver_file validate_localstorage_file up
.PHONY: run-api
run-api: validate_issuer_resolver_file validate_localstorage_file up
COMPOSE_DOCKER_CLI_BUILD=1 $(DOCKER_COMPOSE_CMD) up -d api pending_publisher notifications

# Run the ui.
Expand All @@ -137,7 +133,7 @@ run-ui: build-ui add-host-url-swagger

# Run all services
.PHONE: run-all
run-all: build build-ui validate_localstorage_file up add-host-url-swagger
run-all: build-api build-ui validate_localstorage_file up add-host-url-swagger
COMPOSE_DOCKER_CLI_BUILD=1 $(DOCKER_COMPOSE_CMD) up -d ui api pending_publisher notifications


Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Streamline the **Verifiable Credentials issuance** process with the user-friendl
- [Quick Start Installation](#quick-start-installation)
- [Prerequisites](#prerequisites)
- [Run Issuer Node API and UI (docker compose with images from privadoid dockerhub registry)](#run-issuer-node-api-and-ui-docker-compose-with-images-from-privadoid-registry)
- [Install and run Issuer Node API and UI (docker compose and build from source)](#install-and-run-issuer-node-api-and-ui-docker-compose-and-build-from-source)
- [Install and run Issuer Node API and UI (docker compose and build from source)](#install-and-run-issuer-node-api-and-ui---docker-compose-and-build-from-source)
- [Running only Issuer Node API (docker compose and build from source)](#running-only-issuer-node-api-docker-compose-and-build-from-source)
- [KMS Providers Configuration](#kms-providers-configuration)
- [Quick Start Demo](#quick-start-demo)
Expand Down Expand Up @@ -75,11 +75,11 @@ cp resolvers_settings_sample.yaml resolvers_settings.yaml
```
then modify the file with the proper values. The most important fields to run the issuer node are RPC (`networkURL`) fields.
In this file you can define customizations for each type of blockchain and network. For this example, we only need to
define the RPCs. that will use.
define the RPCs that we will use.

4. Run
```shell
make run-full
make run-all-registry
```

after a few seconds, the issuer node will be running and you can check the docker containers with `docker ps` and you
Expand Down Expand Up @@ -182,7 +182,7 @@ make up
Then run:

```shell
make build && make run
make build-api && make run-api
```
----
**Troubleshooting:**
Expand Down
6 changes: 3 additions & 3 deletions infrastructure/local/docker-compose-full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ services:
- api

api:
image: privadoid/issuernode
image: privadoid/issuernode-api
pull_policy: always
ports:
- "3001:3001"
Expand All @@ -91,7 +91,7 @@ services:
- redis

notifications:
image: privadoid/issuernode
image: privadoid/issuernode-api
pull_policy: always
env_file:
- ../../.env-issuer
Expand All @@ -108,7 +108,7 @@ services:
- api

pending_publisher:
image: privadoid/issuernode
image: privadoid/issuernode-api
pull_policy: always
env_file:
- ../../.env-issuer
Expand Down
8 changes: 4 additions & 4 deletions infrastructure/local/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
services:

ui:
image: issuer-ui:local
image: issuernode-ui:local
ports:
- "8088:80"
env_file:
Expand All @@ -13,7 +13,7 @@ services:
retries: 5

api:
image: issuer-api:local
image: issuernode-api:local
ports:
- "3001:3001"
env_file:
Expand All @@ -29,7 +29,7 @@ services:
command: sh -c "sleep 4s && ./migrate && ./platform"

notifications:
image: issuer-api:local
image: issuernode-api:local
ports:
- "3004:3004"
env_file:
Expand All @@ -44,7 +44,7 @@ services:
retries: 5

pending_publisher:
image: issuer-api:local
image: issuernode-api:local
ports:
- "3005:3005"
env_file:
Expand Down

0 comments on commit 961bce0

Please sign in to comment.