Skip to content

Commit a36800e

Browse files
authored
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
1 parent f4f05b4 commit a36800e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+3221
-16
lines changed

.github/workflows/cicd-prd.yml

+10-5
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ jobs:
2020
strategy:
2121
fail-fast: false
2222
matrix:
23-
application:
24-
[
23+
application: [
2524
bluebell-playground,
2625
developer-portal,
2726
devex,
2827
devex-apollo,
28+
faucet-service
2929
eth-spout,
3030
governance-api,
3131
governance-snapshot,
@@ -40,6 +40,11 @@ jobs:
4040
path: products/bluebell
4141
tag_length: 8
4242
tag_latest: false
43+
- application: developer-portal
44+
image_name: developer-portal
45+
path: products/developer-portal
46+
tag_length: 8
47+
tag_latest: false
4348
- application: devex
4449
image_name: devex
4550
path: products/devex
@@ -50,9 +55,9 @@ jobs:
5055
path: products/devex-apollo
5156
tag_length: 8
5257
tag_latest: false
53-
- application: developer-portal
54-
image_name: developer-portal
55-
path: products/developer-portal
58+
- application: faucet-service
59+
image_name: faucet-service
60+
path: products/faucet-service
5661
tag_length: 8
5762
tag_latest: false
5863
- application: eth-spout

.github/workflows/cicd-stg.yml

+6
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
developer-portal,
2727
devex,
2828
devex-apollo,
29+
faucet-service,
2930
governance-api,
3031
governance-snapshot,
3132
neo-savant,
@@ -49,6 +50,11 @@ jobs:
4950
path: products/devex-apollo
5051
tag_length: 8
5152
tag_latest: false
53+
- application: faucet-service
54+
image_name: faucet-service
55+
path: products/faucet-service
56+
tag_length: 8
57+
tag_latest: false
5258
- application: neo-savant
5359
image_name: neo-savant
5460
path: products/neo-savant

products/faucet-service/.env.example

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
ENV_TYPE=dev
2+
NODE_URL=https://zilliqa-isolated-server.zilliqa.com/
3+
CHAIN_ID=222
4+
AMOUNT_IN_ZIL=10
5+
BATCH_INTERVAL=15s
6+
BATCH_LIMIT=10
7+
TTL=60
8+
PRIVATE_KEY=some
9+
RECAPTCHA_SECRET=some

products/faucet-service/.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
build
2+
.DS_STORE
3+
coverage.txt
4+
.env

products/faucet-service/Dockerfile

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM golang:1.17.1 as build-stage
2+
WORKDIR /app
3+
COPY . /app
4+
RUN go mod download && \
5+
CGO_ENABLED=0 GOOS=linux go build -o build/faucet-service ./cmd
6+
7+
8+
9+
FROM alpine:3.10 as final
10+
WORKDIR /app
11+
COPY --from=build-stage /app/build/faucet-service .
12+
EXPOSE 8080
13+
CMD ["./faucet-service"]

products/faucet-service/LICENSE

+674
Large diffs are not rendered by default.

products/faucet-service/Makefile

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
GOBASE = $(shell pwd)
2+
GOBIN = $(GOBASE)/build
3+
4+
.PHONY: test cover deps build start
5+
6+
.ONESHELL:
7+
SHELL := /bin/bash
8+
.SHELLFLAGS = -ec
9+
10+
ENVIRONMENT ?= dev
11+
VALID_ENVIRONMENTS := dev stg prd
12+
IMAGE_TAG ?= localhost:5001/scilla-server:latest
13+
14+
# Check if the ENVIRONMENT variable is in the list of valid environments
15+
ifeq ($(filter $(ENVIRONMENT),$(VALID_ENVIRONMENTS)),)
16+
$(error Invalid value for ENVIRONMENT. Valid values are dev, stg, or prd.)
17+
endif
18+
19+
deps:
20+
go mod download
21+
22+
test:
23+
go test ./... -cover -covermode=atomic -coverprofile=coverage.txt
24+
25+
cover:
26+
go tool cover -html=coverage.txt
27+
28+
build:
29+
CGO_ENABLED=0 GOOS=linux go build -o $(GOBIN)/faucet-service ./cmd
30+
31+
start:
32+
docker build -t faucet-service . -f Dockerfile && docker run -p 8080:8080 --env-file ./.env faucet-service
33+
34+
## Build and push the Docker image
35+
image/build-and-push:
36+
docker build --build-arg DEPLOY_ENV=${ENVIRONMENT} -t "${IMAGE_TAG}" .
37+
docker push "${IMAGE_TAG}"

0 commit comments

Comments
 (0)