Skip to content

Commit

Permalink
Create main logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaptoss committed Apr 4, 2024
1 parent 54704c7 commit 85352dd
Show file tree
Hide file tree
Showing 36 changed files with 9,000 additions and 2,660 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/actions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
on:
workflow_dispatch:
push:
branches:
- 'master'
- 'main'

env:
CI_JOB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
converge:
name: Converge
runs-on: ubuntu-latest
steps:

- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install werf
uses: werf/actions/[email protected]

- name: Log in to registry
# This is where you will update the personal access token to GITHUB_TOKEN
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin

- name: Run echo
run: |
werf version
docker version
echo $GITHUB_REPOSITORY
echo $GITHUB_SHA
- name: Run Build
run: |
. $(werf ci-env github --as-file)
werf export service --tag ghcr.io/$GITHUB_REPOSITORY:$GITHUB_SHA
22 changes: 22 additions & 0 deletions .github/workflows/code-review.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
on:
pull_request:

permissions:
checks: write
contents: read
pull-requests: write

jobs:
lint:
name: code-review
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: golangci-lint
uses: reviewdog/action-golangci-lint@v2
with:
reporter: github-pr-review
cache: false
37 changes: 37 additions & 0 deletions .github/workflows/tag.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
on:
workflow_dispatch:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

env:
CI_JOB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
converge:
name: Converge
runs-on: ubuntu-latest
steps:

- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install werf
uses: werf/actions/[email protected]

- name: Log in to registry
# This is where you will update the personal access token to GITHUB_TOKEN
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin

- name: Run echo
run: |
werf version
docker version
echo $GITHUB_REPOSITORY
echo $GITHUB_REF_NAME
- name: Run Build
run: |
. $(werf ci-env github --as-file)
werf export service --tag ghcr.io/$GITHUB_REPOSITORY:$GITHUB_REF_NAME
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.vscode/
.idea/
config.*.yaml
docs/node_modules
docs/web_deploy
vendor/
35 changes: 35 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
linters:
enable:
- asciicheck
- bodyclose
- dogsled
- dupl
- errcheck
- exportloopref
- goconst
- gofmt
- goimports
- revive
- gosimple
- govet
- ineffassign
- misspell
- nakedret
- nolintlint
- prealloc
- staticcheck
- stylecheck
- typecheck
- unconvert
- unused

issues:
max-same-issues: 50

linters-settings:
dogsled:
max-blank-identifiers: 3
golint:
min-confidence: 0
maligned:
suggest-new: true
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.20-alpine as buildbase
FROM golang:1.22-alpine as buildbase

RUN apk add git build-base

Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,19 @@ use `./generate.sh --help` to see all available options.
Note: if you are using Gitlab for building project `docs/spec/paths` folder must not be
empty, otherwise only `Build and Publish` job will be passed.

## Config
```yaml
network:
rpc: "" # (url) RPC API endpoint
contract_address: "" # (hex) target contract address
vault_address: "http://127.0.0.1:8200" # (url) vault address
vault_mount_path: "secret_data" # (string)
```
ENV
```
VAULT_TOKEN (will be cleared after start service)
```

## Running from docker

Make sure that docker installed.
Expand Down
7 changes: 7 additions & 0 deletions config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
network:
rpc: ""
contract_address: ""
private_key: ""
vault_address: "http://127.0.0.1:8200"
vault_mount_path: "secret_data"

log:
level: debug
disable_sentry: true
Expand Down
Loading

0 comments on commit 85352dd

Please sign in to comment.