Skip to content

Commit

Permalink
clone and copy into container (#64)
Browse files Browse the repository at this point in the history
* clone and copy into container
  • Loading branch information
InoMurko authored May 27, 2021
1 parent c392fd9 commit f06b9f1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 17 deletions.
14 changes: 4 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,6 @@ commands:
type: string
description: "Path to persist Docker archive"
default: "~/docker"
build-arg:
type: string
description: "Args to pass into docker file"
default: ""
steps:
- when:
condition: <<parameters.import>>
Expand All @@ -226,11 +222,7 @@ commands:
DIRNAME="$(dirname "$DOCKERFILE")"
cd "$DIRNAME" || exit 1
if [ -z "<<parameters.build-arg>>" ]; then
docker build . --cache-from "<<parameters.image>>" -t "<<parameters.image>>" -f "$BASENAME"
else
docker build . --cache-from "<<parameters.image>>" -t "<<parameters.image>>" -f "$BASENAME" --build-arg <<parameters.build-arg>>
fi
docker build . --cache-from "<<parameters.image>>" -t "<<parameters.image>>" -f "$BASENAME"
- when:
condition: <<parameters.export>>
steps:
Expand Down Expand Up @@ -386,11 +378,13 @@ jobs:
steps:
- setup_remote_docker
- attach_workspace: *attach_workspace
- run: |
echo ${GITHUB_TOKEN} | git clone https://[email protected]/omgnetwork/$(cat tester/CONTRACT_REPO_NAME).git tester/plasma-contracts
- docker_build:
image: "omisegoimages/elixir-omg-tester-plasma-deployer"
dockerfile: "tester/Dockerfile.plasma_deployer"
export: "~/docker/omisegoimages_elixir-omg_tester_plasma_deployer.tar"
build-arg: "GITHUB_TOKEN=${GITHUB_TOKEN}"

- persist_to_workspace:
<<: *persist_workspace
paths:
Expand Down
9 changes: 2 additions & 7 deletions tester/Dockerfile.plasma_deployer
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
FROM node:10.22-alpine

MAINTAINER OmiseGO Engineering <[email protected]>

ARG GITHUB_TOKEN
MAINTAINER OMG Network Engineering <[email protected]>

WORKDIR /home/node

Expand All @@ -15,10 +13,7 @@ RUN apk add --update \

COPY CONTRACT_SHA /tmp/CONTRACT_SHA
COPY CONTRACT_REPO_NAME /tmp/CONTRACT_REPO_NAME

# pass in token for prompt instead of git clone https://${GITHUB_TOKEN}@github.com... to avoid
# leaving the token data in .git/config
RUN echo ${GITHUB_TOKEN} | git clone https://[email protected]/omgnetwork/$(cat /tmp/CONTRACT_REPO_NAME).git plasma-contracts
COPY plasma-contracts /home/node/plasma-contracts
RUN cd /home/node/plasma-contracts && git reset --hard $(cat /tmp/CONTRACT_SHA)
RUN cd /home/node/plasma-contracts && npm install
RUN cd /home/node/plasma-contracts/plasma_framework && rm -Rf ./build
Expand Down

0 comments on commit f06b9f1

Please sign in to comment.