Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
vandot committed Feb 11, 2021
0 parents commit cacbf53
Show file tree
Hide file tree
Showing 12 changed files with 5,081 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release

on:
push:
branches-ignore:
- '**'
tags:
- 'v*.*.*'

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Setup Go
uses: actions/setup-go@v1
with:
go-version: 1.15
- name: Checkout
uses: actions/checkout@v2
- name: Docker Login
if: success() && startsWith(github.ref, 'refs/tags/v')
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: |
echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46 changes: 46 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
project_name: tokenexporter

builds:
- id: linux-amd64
main: ./tokenexporter
binary: tokenexporter
goos:
- linux
goarch:
- amd64
flags:
- -v
- -trimpath
ldflags:
- -s -w

snapshot:
name_template: "{{.Tag}}-snapshot"

archives:
- name_template: "{{ tolower .ProjectName }}-{{ tolower .Os }}-{{ tolower .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
format: binary

dockers:
-
binaries:
- tokenexporter
builds:
- linux-amd64
goos: "linux"
goarch: "amd64"
image_templates:
- "ethersphere/tokenexporter:{{ .Major }}"
- "ethersphere/tokenexporter:{{ .Major }}.{{ .Minor }}"
- "ethersphere/tokenexporter:{{ .Major }}.{{ .Minor }}.{{ .Patch }}"
- "ethersphere/tokenexporter:latest"
dockerfile: Dockerfile.goreleaser
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
extra_files:
- data/addresses.txt
- data/tokens.json
34 changes: 34 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM golang:1.15 AS build

WORKDIR /src
# enable modules caching in separate layer
COPY go.mod go.sum ./
RUN go mod download

COPY . ./

RUN go build -trimpath -ldflags "-s -w" -o dist/tokenexporter ./tokenexporter

FROM debian:10.2-slim AS runtime

ENV PORT 9891
ENV DATA /app

RUN mkdir -p /app && chown nobody:nogroup /app

ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update && apt-get install -y \
ca-certificates; \
apt-get clean; \
rm -rf /var/lib/apt/lists/*;

COPY --from=build /src/dist/tokenexporter /usr/local/bin/tokenexporter
COPY data/addresses.txt /app/addresses.txt
COPY data/tokens.json /app/tokens.json

USER nobody
VOLUME /app
WORKDIR /app

ENTRYPOINT ["tokenexporter"]
23 changes: 23 additions & 0 deletions Dockerfile.goreleaser
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM debian:10.2-slim

ENV PORT 9891
ENV DATA /app

RUN mkdir -p /app && chown nobody:nogroup /app

ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update && apt-get install -y \
ca-certificates; \
apt-get clean; \
rm -rf /var/lib/apt/lists/*;

COPY tokenexporter /usr/local/bin/tokenexporter
COPY ./data/addresses.txt /app/addresses.txt
COPY ./data/tokens.json /app/tokens.json

USER nobody
VOLUME /app
WORKDIR /app

ENTRYPOINT ["tokenexporter"]
619 changes: 619 additions & 0 deletions README.md

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions data/addresses.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
bittrex:0xFBb1b73C4f0BDa4f67dcA266ce6Ef42f520fBB98
etherdelta:0x8d12A197cB00D4747a1fe03395095ce2A5CC6819
kraken:0xe853c56864a2ebe4576a807d26fdc4a0ada51919
kraken2:0x267be1c1d684f78cb4f6a176c4911b741e4ffdc0
vitalik:0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B
exchange:0x1db3439a222c519ab44bb1144fc28167b4fa6ee6
Loading

0 comments on commit cacbf53

Please sign in to comment.