Skip to content

Commit

Permalink
Merge pull request #811 from maticnetwork/vcastellm/pos-296-bump-go-v…
Browse files Browse the repository at this point in the history
…ersion-in-bor-and-heimdall

Bump Go version to v1.18.1
  • Loading branch information
Victor Castell authored Apr 28, 2022
2 parents b3ca506 + 67af597 commit 7d806b1
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 3 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Docker Image CI

on:
push:
tags:
- 'v*.*.*'
# to be used by fork patch-releases ^^
- 'v*.*.*-*'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build the Docker image
env:
DOCKERHUB: ${{ secrets.DOCKERHUB }}
DOCKERHUB_KEY: ${{ secrets.DOCKERHUB_KEY }}
run: |
ls -l
echo "Docker login"
docker login -u $DOCKERHUB -p $DOCKERHUB_KEY
echo "running build"
docker build -f Dockerfile.deprecated -t maticnetwork/heimdall:${GITHUB_REF/refs\/tags\//} .
echo "pushing image"
docker push maticnetwork/heimdall:${GITHUB_REF/refs\/tags\//}
echo "DONE!"
31 changes: 31 additions & 0 deletions Dockerfile.deprecated
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Simple usage with a mounted data directory:
# > docker build -t maticnetwork/heimdall:<tag> .
# > docker run -it -p 26657:26657 -p 26656:26656 -v ~/.heimdalld:/root/.heimdalld maticnetwork/heimdall:<tag> heimdalld init

# Start from a Debian image with the latest version of Go installed
# and a workspace (GOPATH) configured at /go.
FROM golang:latest

# update available packages
RUN apt-get update -y && apt-get upgrade -y && apt install build-essential -y

# create go src directory and clone heimdall
RUN mkdir -p /root/heimdall

# add code to docker instance
ADD . /root/heimdall/

# change work directory
WORKDIR /root/heimdall

# GOBIN required for go install
ENV GOBIN $GOPATH/bin

# run build
RUN make install

# add volumes
VOLUME [ "/root/.heimdalld", "./logs" ]

# expose ports
EXPOSE 1317 26656 26657
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ build-docker-develop:
.PHONY: contracts build

PACKAGE_NAME := github.com/maticnetwork/heimdall
GOLANG_CROSS_VERSION ?= v1.17.3
GOLANG_CROSS_VERSION ?= v1.18.1

.PHONY: release-dry-run
release-dry-run:
Expand All @@ -151,7 +151,7 @@ release-dry-run:
-v /var/run/docker.sock:/var/run/docker.sock \
-v `pwd`:/go/src/$(PACKAGE_NAME) \
-w /go/src/$(PACKAGE_NAME) \
ghcr.io/troian/golang-cross:${GOLANG_CROSS_VERSION} \
goreleaser/goreleaser-cross:${GOLANG_CROSS_VERSION} \
--rm-dist --skip-validate --skip-publish

.PHONY: release
Expand All @@ -168,5 +168,5 @@ release:
-v /var/run/docker.sock:/var/run/docker.sock \
-v `pwd`:/go/src/$(PACKAGE_NAME) \
-w /go/src/$(PACKAGE_NAME) \
ghcr.io/troian/golang-cross:${GOLANG_CROSS_VERSION} \
goreleaser/goreleaser-cross:${GOLANG_CROSS_VERSION} \
--rm-dist --skip-validate
10 changes: 10 additions & 0 deletions docker/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env sh

# start processes
heimdalld start > ./logs/heimdalld.log &
heimdalld rest-server > ./logs/heimdalld-rest-server.log &
sleep 100
bridge start --all > ./logs/bridge.log &

# tail logs
tail -f ./logs/heimdalld.log ./logs/heimdalld-rest-server.log ./logs/bridge.log

0 comments on commit 7d806b1

Please sign in to comment.