Skip to content

Commit 13e7600

Browse files
committed
Switch to private signer dependency
1 parent 0f8da6b commit 13e7600

File tree

6 files changed

+21
-17
lines changed

6 files changed

+21
-17
lines changed

.circleci/config.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
command: "go env"
1919
- go/load-cache:
2020
key: go-mod-v6-{{ checksum "go.sum" }}
21+
- add_ssh_keys
2122
- go/mod-download
2223
- go/save-cache:
2324
key: go-mod-v6-{{ checksum "go.sum" }}
@@ -45,13 +46,15 @@ jobs:
4546
resource_class: large
4647
steps:
4748
- checkout
49+
- add_ssh_keys
4850
- aws-ecr/build-image:
4951
push-image: false
5052
dockerfile: Dockerfile
5153
path: ./
5254
build-path: ./
5355
tag: "$CIRCLE_SHA1,$CIRCLE_TAG"
54-
repo: "$CIRCLE_PROJECT_REPONAME"
56+
repo: "cli-tools"
57+
extra-build-args: "--secret id=sshKey,src=/home/circleci/.ssh/$DEPLOY_KEY_NAME"
5558
- run:
5659
name: Save Docker image to export it to workspace
5760
command: |
@@ -79,7 +82,7 @@ jobs:
7982
- aws-ecr/push-image:
8083
registry-id: AWS_ECR_REGISTRY_ID
8184
region: "$AWS_REGION"
82-
repo: "$CIRCLE_PROJECT_REPONAME"
85+
repo: "cli-tools"
8386
tag: "$CIRCLE_SHA1,$CIRCLE_TAG"
8487

8588
workflows:
@@ -90,10 +93,6 @@ workflows:
9093
filters:
9194
tags:
9295
only: /.*/
93-
branches:
94-
only:
95-
- main
96-
- dev
9796
- push_docker:
9897
requires:
9998
- build_docker

Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,16 @@ RUN apk add --no-cache --update openssh git make build-base linux-headers libc-d
1111
pkgconfig zeromq-dev musl-dev alpine-sdk libsodium-dev \
1212
libzmq-static libsodium-static gcc
1313

14+
# Load private repos SSH deploy key and configure ssh
15+
RUN mkdir -p /root/.ssh && ssh-keyscan github.com >> /root/.ssh/known_hosts
16+
RUN git config --global url."[email protected]:".insteadOf "https://github.com/"
17+
ENV GOPRIVATE=github.com/babylonchain/*
18+
1419
# Build
1520
WORKDIR /go/src/github.com/babylonchain/cli-tools
1621
# Cache dependencies
1722
COPY go.mod go.sum /go/src/github.com/babylonchain/cli-tools/
18-
RUN go mod download
23+
RUN --mount=type=secret,id=sshKey,target=/root/.ssh/id_rsa go mod download
1924
# Copy the rest of the files
2025
COPY ./ /go/src/github.com/babylonchain/cli-tools/
2126

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ $(BUILDDIR)/:
2929
mkdir -p $(BUILDDIR)/
3030

3131
build-docker:
32-
$(DOCKER) build --tag babylonchain/cli-tools -f Dockerfile \
32+
$(DOCKER) build --secret id=sshKey,src=${BBN_PRIV_DEPLOY_KEY} --tag babylonchain/cli-tools -f Dockerfile \
3333
$(shell git rev-parse --show-toplevel)
3434

3535
.PHONY: build build-docker install tests

go.mod

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,12 @@ require (
4747
)
4848

4949
require (
50-
github.com/babylonchain/covenant-signer v0.1.0
50+
github.com/babylonchain/covenant-signer v0.1.2
5151
github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0
5252
github.com/btcsuite/btcwallet/wallet/txauthor v1.3.4
5353
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0
54+
github.com/golang/mock v1.6.0
55+
github.com/prometheus/client_golang v1.18.0
5456
)
5557

5658
require (
@@ -162,7 +164,6 @@ require (
162164
github.com/golang-jwt/jwt/v4 v4.4.2 // indirect
163165
github.com/golang/glog v1.2.0 // indirect
164166
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
165-
github.com/golang/mock v1.6.0 // indirect
166167
github.com/golang/protobuf v1.5.3 // indirect
167168
github.com/google/btree v1.1.2 // indirect
168169
github.com/google/go-cmp v0.6.0 // indirect
@@ -250,7 +251,6 @@ require (
250251
github.com/pierrec/lz4/v4 v4.1.8 // indirect
251252
github.com/pkg/errors v0.9.1 // indirect
252253
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
253-
github.com/prometheus/client_golang v1.18.0 // indirect
254254
github.com/prometheus/client_model v0.6.0 // indirect
255255
github.com/prometheus/common v0.47.0 // indirect
256256
github.com/prometheus/procfs v0.12.0 // indirect
@@ -323,3 +323,5 @@ require (
323323
pgregory.net/rapid v1.1.0 // indirect
324324
sigs.k8s.io/yaml v1.4.0 // indirect
325325
)
326+
327+
replace github.com/babylonchain/covenant-signer => github.com/babylonchain/covenant-signer v0.1.2

go.sum

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -279,12 +279,8 @@ github.com/aws/aws-sdk-go v1.44.312/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8
279279
github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g=
280280
github.com/babylonchain/babylon v0.8.6-0.20240426101001-7778c798e236 h1:Ydna4VcP56xu1+zdgygqHdSCeMduZjuznVhr4exO5do=
281281
github.com/babylonchain/babylon v0.8.6-0.20240426101001-7778c798e236/go.mod h1:lfeASLNJgcUsX7LEns3HRUv0k+MjzcB2q2AMasfz38M=
282-
github.com/babylonchain/covenant-signer v0.0.0-20240507155851-64756e393be2 h1:v5h+81bOlENEw/cyXv/6+/5laUs/EOvxAfZTdWbOW5A=
283-
github.com/babylonchain/covenant-signer v0.0.0-20240507155851-64756e393be2/go.mod h1:alX7NoDE2m7gW4O17hLAsluU30P0XaP5RlThAco8Y9Q=
284-
github.com/babylonchain/covenant-signer v0.0.0-20240509110821-b6017a54332f h1:UKNyeBlPZgLB5+1ZUA1YCL6bPtREA+oP1OT6ibNadw0=
285-
github.com/babylonchain/covenant-signer v0.0.0-20240509110821-b6017a54332f/go.mod h1:alX7NoDE2m7gW4O17hLAsluU30P0XaP5RlThAco8Y9Q=
286-
github.com/babylonchain/covenant-signer v0.1.0 h1:86IKwReT+3q2TMBsGg9BUzXl5lGkHqAK8PS1QigwdA0=
287-
github.com/babylonchain/covenant-signer v0.1.0/go.mod h1:alX7NoDE2m7gW4O17hLAsluU30P0XaP5RlThAco8Y9Q=
282+
github.com/babylonchain/covenant-signer v0.1.2 h1:MaiMG2Rouw+wsA4PhWUtx9/WCYh0Y9r1rMENvzYs8zY=
283+
github.com/babylonchain/covenant-signer v0.1.2/go.mod h1:alX7NoDE2m7gW4O17hLAsluU30P0XaP5RlThAco8Y9Q=
288284
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
289285
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
290286
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=

itest/e2e_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
staking "github.com/babylonchain/babylon/btcstaking"
1818
signerbtccli "github.com/babylonchain/covenant-signer/btcclient"
1919
signercfg "github.com/babylonchain/covenant-signer/config"
20+
"github.com/babylonchain/covenant-signer/observability/metrics"
2021
"github.com/babylonchain/covenant-signer/signerapp"
2122
"github.com/babylonchain/covenant-signer/signerservice"
2223
"github.com/babylonchain/covenant-signer/utils"
@@ -317,6 +318,7 @@ func startSigningServer(
317318
context.Background(),
318319
parsedconfig,
319320
app,
321+
metrics.NewCovenantSignerMetrics(),
320322
)
321323

322324
require.NoError(t, err)

0 commit comments

Comments
 (0)