Skip to content

Commit 6102461

Browse files
authored
chore: Remove SSH key requirement for Dockerfile, CI (#29)
1 parent 89994c5 commit 6102461

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

.circleci/config.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ jobs:
1818
command: "go env"
1919
- go/load-cache:
2020
key: go-mod-v6-{{ checksum "go.sum" }}
21-
- add_ssh_keys
2221
- go/mod-download
2322
- go/save-cache:
2423
key: go-mod-v6-{{ checksum "go.sum" }}
@@ -46,15 +45,13 @@ jobs:
4645
resource_class: large
4746
steps:
4847
- checkout
49-
- add_ssh_keys
5048
- aws-ecr/build-image:
5149
push-image: false
5250
dockerfile: Dockerfile
5351
path: ./
5452
build-path: ./
5553
tag: "$CIRCLE_SHA1,$CIRCLE_TAG"
5654
repo: "$CIRCLE_PROJECT_REPONAME"
57-
extra-build-args: "--secret id=sshKey,src=/home/circleci/.ssh/$DEPLOY_KEY_NAME"
5855
- run:
5956
name: Save Docker image to export it to workspace
6057
command: |
@@ -93,6 +90,10 @@ workflows:
9390
filters:
9491
tags:
9592
only: /.*/
93+
branches:
94+
only:
95+
- main
96+
- dev
9697
- push_docker:
9798
requires:
9899
- build_docker

Dockerfile

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,11 @@ 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-
1914
# Build
2015
WORKDIR /go/src/github.com/babylonchain/cli-tools
2116
# Cache dependencies
2217
COPY go.mod go.sum /go/src/github.com/babylonchain/cli-tools/
23-
RUN --mount=type=secret,id=sshKey,target=/root/.ssh/id_rsa go mod download
18+
RUN go mod download
2419
# Copy the rest of the files
2520
COPY ./ /go/src/github.com/babylonchain/cli-tools/
2621

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 --secret id=sshKey,src=${BBN_PRIV_DEPLOY_KEY} --tag babylonchain/cli-tools -f Dockerfile \
32+
$(DOCKER) build --tag babylonchain/cli-tools -f Dockerfile \
3333
$(shell git rev-parse --show-toplevel)
3434

3535
.PHONY: build build-docker install tests

0 commit comments

Comments
 (0)