Skip to content

Commit

Permalink
Docker release method (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinvol authored Jul 15, 2022
1 parent 7d26e82 commit ad9cd4f
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 1 deletion.
28 changes: 28 additions & 0 deletions .env.prod
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This file is for reference only, each oracle provider should make their own
# Documentation on what variables can be configured can be found here: https://github.com/celo-org/celo-oracle/blob/main/README-config.md

MID_AGGREGATION_MAX_EXCHANGE_VOLUME_SHARE=1
MID_AGGREGATION_MAX_PERCENTAGE_DEVIATION=0.05
MID_AGGREGATION_MAX_PERCENTAGE_BID_ASK_SPREAD=0.025

METRICS=true
PROMETHEUS_PORT=9090

API_REQUEST_TIMEOUT=5000
CIRCUIT_BREAKER_PRICE_CHANGE_THRESHOLD=0.25
MINIMUM_PRICE_SOURCES=2
REPORT_STRATEGY=BLOCK_BASED
MIN_REPORT_PRICE_CHANGE_THRESHOLD=0.005

# Replace with your RPC
HTTP_RPC_PROVIDER_URL=
# Replace with your RPC WS
WS_RPC_PROVIDER_URL=


# Replace with your address (at least your using private key)
ADDRESS=

DEVMODE=true
OVERRIDE_INDEX=1
OVERRIDE_ORACLE_COUNT=3
27 changes: 27 additions & 0 deletions build_and_publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash
set -euo pipefail

REPOSITORY="us-west1-docker.pkg.dev/celo-testnet-production/celo-oracle"

PACKAGE_NAME=$(grep name package.json | awk -F \" '{print $4}')
PACKAGE_VERSION=$(grep version package.json | awk -F \" '{print $4}')
COMMIT_HASH=$(git log -1 --pretty=%h)

VERSION="$PACKAGE_NAME-$PACKAGE_VERSION"

echo "Building version $VERSION"

docker buildx build --platform linux/amd64 -t $PACKAGE_NAME .

echo "Taggimg image"
docker tag $PACKAGE_NAME $REPOSITORY/$PACKAGE_NAME:$PACKAGE_VERSION
docker tag $PACKAGE_NAME $REPOSITORY/$PACKAGE_NAME:$COMMIT_HASH

echo "Pushing"

# Pushing requires a one time set-up:
# gcloud auth configure-docker \
# us-west1-docker.pkg.dev

docker push $REPOSITORY/$PACKAGE_NAME:$PACKAGE_VERSION
docker push $REPOSITORY/$PACKAGE_NAME:$COMMIT_HASH
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "celo-oracle",
"version": "0.0.0",
"version": "1.0.0-rc1",
"description": "Oracle application to aggregate and report exchange rates to the Celo network",
"author": "Celo",
"license": "Apache-2.0",
Expand Down

0 comments on commit ad9cd4f

Please sign in to comment.