Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump Go version to v1.18.1 #811

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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