Skip to content

Commit

Permalink
DEVOPS-1133: faucet-service migration to gcp (#319)
Browse files Browse the repository at this point in the history
* 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
pavlops authored Dec 7, 2023
1 parent f4f05b4 commit a36800e
Show file tree
Hide file tree
Showing 45 changed files with 3,221 additions and 16 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/cicd-prd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ jobs:
strategy:
fail-fast: false
matrix:
application:
[
application: [
bluebell-playground,
developer-portal,
devex,
devex-apollo,
faucet-service
eth-spout,
governance-api,
governance-snapshot,
Expand All @@ -40,6 +40,11 @@ jobs:
path: products/bluebell
tag_length: 8
tag_latest: false
- application: developer-portal
image_name: developer-portal
path: products/developer-portal
tag_length: 8
tag_latest: false
- application: devex
image_name: devex
path: products/devex
Expand All @@ -50,9 +55,9 @@ jobs:
path: products/devex-apollo
tag_length: 8
tag_latest: false
- application: developer-portal
image_name: developer-portal
path: products/developer-portal
- application: faucet-service
image_name: faucet-service
path: products/faucet-service
tag_length: 8
tag_latest: false
- application: eth-spout
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/cicd-stg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
developer-portal,
devex,
devex-apollo,
faucet-service,
governance-api,
governance-snapshot,
neo-savant,
Expand All @@ -49,6 +50,11 @@ jobs:
path: products/devex-apollo
tag_length: 8
tag_latest: false
- application: faucet-service
image_name: faucet-service
path: products/faucet-service
tag_length: 8
tag_latest: false
- application: neo-savant
image_name: neo-savant
path: products/neo-savant
Expand Down
9 changes: 9 additions & 0 deletions products/faucet-service/.env.example
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
4 changes: 4 additions & 0 deletions products/faucet-service/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
build
.DS_STORE
coverage.txt
.env
13 changes: 13 additions & 0 deletions products/faucet-service/Dockerfile
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"]
674 changes: 674 additions & 0 deletions products/faucet-service/LICENSE

Large diffs are not rendered by default.

37 changes: 37 additions & 0 deletions products/faucet-service/Makefile
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}"
Loading

0 comments on commit a36800e

Please sign in to comment.