Skip to content

Commit

Permalink
feat: add private sdk components to dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
BaptistG committed Nov 20, 2023
1 parent b446f27 commit 6bf5d92
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 94 deletions.
12 changes: 10 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Use an official Node.js runtime as the builder image
FROM node:16-alpine
FROM node:20-alpine

ARG GITHUB_TOKEN

ENV GITHUB_TOKEN $GITHUB_TOKEN

# Set the working directory inside the container
WORKDIR /app
Expand All @@ -10,8 +14,12 @@ COPY package.json ./
# Copy the yarn.lock file to the container
COPY yarn.lock ./

COPY .npmrc ./

# Install the app dependencies
RUN yarn install
RUN echo "//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}" >> .npmrc
RUN yarn install --frozen-lockfile && yarn cache clean
RUN rm -f .npmrc

# Copy the tsconfig.json to be able to compile the typescript
COPY tsconfig.json ./
Expand Down
85 changes: 0 additions & 85 deletions cloudrun.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"devDependencies": {
"@types/express": "^4.17.13",
"@types/graceful-fs": "^4.1.5",
"@types/node": "^16.9.6",
"@types/node": "^20.9.2",
"@typescript-eslint/eslint-plugin": "^5.2.0",
"@typescript-eslint/parser": "^5.2.0",
"eslint": "^8.1.0",
Expand Down
3 changes: 2 additions & 1 deletion scripts/publish.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/bin/bash
account=$1
version=$2
token=$3

echo "Building docker image"
docker build -t merkl-dispute:latest --platform linux/amd64 .
docker build --build-arg GITHUB_TOKEN=$token -t merkl-dispute:latest --platform linux/amd64 .

docker tag merkl-dispute:latest europe-west1-docker.pkg.dev/$account/registry/merkl-dispute:$version

Expand Down
5 changes: 4 additions & 1 deletion scripts/publishAndDeploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@ read version
echo "Please enter the account to deploy to: (merkl-dispute-1 or merkl-dispute-2)"
read account

sh scripts/publish.sh $account $version
echo "Please enter Github token to download the SDK"
read token

sh scripts/publish.sh $account $version $token
bash scripts/deploy.sh $account $version
15 changes: 11 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -900,10 +900,12 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.3.2.tgz#fa6a90f2600e052a03c18b8cb3fd83dd4e599898"
integrity sha512-vOBLVQeCQfIcF/2Y7eKFTqrMnizK5lRNQ7ykML/5RuwVXVWxYkgwS7xbt4B6fKCUPgbSL5FSsjHQpaGQP/dQmw==

"@types/node@^16.9.6":
version "16.18.37"
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.18.37.tgz#a1f8728e4dc30163deb41e9b7aba65d0c2d4eda1"
integrity sha512-ql+4dw4PlPFBP495k8JzUX/oMNRI2Ei4PrMHgj8oT4VhGlYUzF4EYr0qk2fW+XBVGIrq8Zzk13m4cvyXZuv4pA==
"@types/node@^20.9.2":
version "20.9.2"
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.9.2.tgz#002815c8e87fe0c9369121c78b52e800fadc0ac6"
integrity sha512-WHZXKFCEyIUJzAwh3NyyTHYSR35SevJ6mZ1nWwJafKtiQbqRTIKSRcw3Ma3acqgsent3RRDqeVwpHntMk+9irg==
dependencies:
undici-types "~5.26.4"

"@types/pbkdf2@^3.0.0":
version "3.1.0"
Expand Down Expand Up @@ -3893,6 +3895,11 @@ underscore@~1.13.2:
resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.13.6.tgz#04786a1f589dc6c09f761fc5f45b89e935136441"
integrity sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A==

undici-types@~5.26.4:
version "5.26.5"
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617"
integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==

undici@^5.22.0:
version "5.22.1"
resolved "https://registry.yarnpkg.com/undici/-/undici-5.22.1.tgz#877d512effef2ac8be65e695f3586922e1a57d7b"
Expand Down

0 comments on commit 6bf5d92

Please sign in to comment.