Skip to content

Commit

Permalink
Merge pull request #96 from terra-money/release/v2.4
Browse files Browse the repository at this point in the history
merge Release/v2.4
  • Loading branch information
gregnuj committed May 23, 2023
2 parents 11b5367 + fc0b25c commit 04c489e
Show file tree
Hide file tree
Showing 19 changed files with 341 additions and 745 deletions.
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
COMPOSE_PROJECT_NAME=localterra
TERRA_VERSION=2.4.0
73 changes: 73 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: docker-build

on:
pull_request:
branches:
- main
push:
branches:
- main
tags:
- 'v*'

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout
uses: actions/checkout@v3

# https://docs.docker.com/build/ci/github-actions/multi-platform/
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

# Workaround: https://github.com/docker/build-push-action/issues/461
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2

- name: Log in to the github container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}


# https://github.com/docker/login-action
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:

github-token: ${{ secrets.GITHUB_TOKEN }}
images: |
ghcr.io/${{ github.repository }}
terraformlabs/localterra
tags: |
type=sha
type=edge,branch=test
type=semver,pattern={{tag}}
type=semver,pattern={{version}}
type=raw,value=latest,event=branch,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
type=raw,value=classic,event=branch,enable=${{ github.ref == format('refs/heads/{0}', 'classic') }}
- name: Build docker image
uses: docker/build-push-action@v3
with:
push: ${{ github.event_name != 'pull_request' }}
file: Dockerfile
platforms: linux/amd64
tags: ${{ env.DOCKER_METADATA_OUTPUT_TAGS }}
labels: ${{ env.DOCKER_METADATA_OUTPUT_LABELS }}


35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Release

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+' # Push events to matching v*, i.e. v1.0, v20.15.10
- 'v[0-9]+.[0-9]+.[0-9]+-rc*' # Push events to matching v*, i.e. v1.0-rc1, v20.15.10-rc5

jobs:
artifacts:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set version tag
run: echo "VERSION=$(echo ${{github.ref_name}} | sed 's/^v//')" >> $GITHUB_ENV

- name: Create build directory
run: mkdir -p build/release

- name: Build Changelog
id: github_release
uses: mikepenz/release-changelog-builder-action@v3

- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
tag_name: ${{github.ref_name}}
body: ${{steps.github_release.outputs.changelog}}
files: |
build/release/*
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,3 @@ dependency-graph.png
node_modules/

logs/
data/
config/addrbook.json
config/write-file-atomic*
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
ARG TERRA_VERSION=2.3.1

FROM ghcr.io/terra-money/core:${TERRA_VERSION}

COPY ./terra/genesis.json \
./terra/priv_validator_key.json \
/app/config/

RUN mkdir -p /app/data && \
echo '{"height": "0","round": 0,"step": 0}' > /app/data/priv_validator_state.json

CMD terrad start \
--api.enable true \
--api.enabled-unsafe-cors true \
--api.swagger true \
--home /app \
--minimum-gas-prices 0.015uluna \
--moniker localterra \
--p2p.upnp true \
--rpc.laddr tcp://0.0.0.0:26657
66 changes: 66 additions & 0 deletions compose-fcd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
version: "3.8"

x-fcd-env: &fcd-env
- CHAIN_ID=localterra
- LCD_URI=http://terrad:1317
- RPC_URI=http://terrad:26657
- USE_LOG_FILE=true
- TYPEORM_CONNECTION=postgres
- TYPEORM_HOST=postgres
- TYPEORM_USERNAME=terra
- TYPEORM_PASSWORD=abc123
- TYPEORM_DATABASE=fcd
- TYPEORM_SYNCHRONIZE=true
- TYPEORM_LOGGING=false
- TYPEORM_ENTITIES=src/orm/*Entity.ts
- LEGACY_NETWORK=false

services:
terrad:
extends:
file: compose-rpc.yml
service: terrad

postgres:
image: postgres:14-alpine
hostname: postgres
environment:
POSTGRES_USER: terra
POSTGRES_PASSWORD: abc123
volumes:
- ./initdb.d:/docker-entrypoint-initdb.d
- pgdata:/var/lib/postgresql/data
networks:
- default
ports:
- 5433:5432

fcd_collector:
image: ghcr.io/terra-money/fcd:${TERRA_VERSION}
command: collector
hostname: fcd_collector
restart: unless-stopped
environment: *fcd-env
volumes:
- ./logs:/app/logs
networks:
- default

fcd_api:
image: ghcr.io/terra-money/fcd:${TERRA_VERSION}
command: start
hostname: fcd_api
environment: *fcd-env
volumes:
- ./logs:/app/logs
networks:
- default
ports:
- 3060:3060

volumes:
terra:
pgdata:

networks:
default:
27 changes: 27 additions & 0 deletions compose-rpc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: "3.8"

services:
terrad:
build:
context: .
dockerfile: Dockerfile
args:
TERRA_VERSION: ${TERRA_VERSION}
image: ghcr.io/terra-money/localterra:${TERRA_VERSION}
hostname: terrad
pull_policy: always
volumes:
- terra:/app
networks:
- default
ports:
- "1317:1317"
- "9090:9090"
- "9091:9091"
- "26657:26657"

volumes:
terra:

networks:
default:

0 comments on commit 04c489e

Please sign in to comment.