-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DEVOPS-1133: faucet-service migration to gcp (#319)
* feat: DEVOPS-1133 faucet-service migration to gcp * feat: DEVOPS-1133 faucet-service migration to gcp * feat: DEVOPS-1133 faucet-service migration to gcp * feat: DEVOPS-1133 faucet-service migration to gcp * feat: DEVOPS-1133 faucet-service migration to gcp * feat: DEVOPS-1133 faucet-service migration to gcp * feat: DEVOPS-1133 faucet-service migration to gcp
- Loading branch information
Showing
45 changed files
with
3,221 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
ENV_TYPE=dev | ||
NODE_URL=https://zilliqa-isolated-server.zilliqa.com/ | ||
CHAIN_ID=222 | ||
AMOUNT_IN_ZIL=10 | ||
BATCH_INTERVAL=15s | ||
BATCH_LIMIT=10 | ||
TTL=60 | ||
PRIVATE_KEY=some | ||
RECAPTCHA_SECRET=some |
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,4 @@ | ||
build | ||
.DS_STORE | ||
coverage.txt | ||
.env |
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,13 @@ | ||
FROM golang:1.17.1 as build-stage | ||
WORKDIR /app | ||
COPY . /app | ||
RUN go mod download && \ | ||
CGO_ENABLED=0 GOOS=linux go build -o build/faucet-service ./cmd | ||
|
||
|
||
|
||
FROM alpine:3.10 as final | ||
WORKDIR /app | ||
COPY --from=build-stage /app/build/faucet-service . | ||
EXPOSE 8080 | ||
CMD ["./faucet-service"] |
Large diffs are not rendered by default.
Oops, something went wrong.
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,37 @@ | ||
GOBASE = $(shell pwd) | ||
GOBIN = $(GOBASE)/build | ||
|
||
.PHONY: test cover deps build start | ||
|
||
.ONESHELL: | ||
SHELL := /bin/bash | ||
.SHELLFLAGS = -ec | ||
|
||
ENVIRONMENT ?= dev | ||
VALID_ENVIRONMENTS := dev stg prd | ||
IMAGE_TAG ?= localhost:5001/scilla-server:latest | ||
|
||
# Check if the ENVIRONMENT variable is in the list of valid environments | ||
ifeq ($(filter $(ENVIRONMENT),$(VALID_ENVIRONMENTS)),) | ||
$(error Invalid value for ENVIRONMENT. Valid values are dev, stg, or prd.) | ||
endif | ||
|
||
deps: | ||
go mod download | ||
|
||
test: | ||
go test ./... -cover -covermode=atomic -coverprofile=coverage.txt | ||
|
||
cover: | ||
go tool cover -html=coverage.txt | ||
|
||
build: | ||
CGO_ENABLED=0 GOOS=linux go build -o $(GOBIN)/faucet-service ./cmd | ||
|
||
start: | ||
docker build -t faucet-service . -f Dockerfile && docker run -p 8080:8080 --env-file ./.env faucet-service | ||
|
||
## Build and push the Docker image | ||
image/build-and-push: | ||
docker build --build-arg DEPLOY_ENV=${ENVIRONMENT} -t "${IMAGE_TAG}" . | ||
docker push "${IMAGE_TAG}" |
Oops, something went wrong.