Skip to content

Commit

Permalink
Update scripts to use npm instead of yarn (#316)
Browse files Browse the repository at this point in the history
  • Loading branch information
HalfdanJ authored Jan 27, 2023
1 parent b6e50f0 commit ef1dbb9
Show file tree
Hide file tree
Showing 14 changed files with 38,126 additions and 10,933 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ node_modules/
.sass-cache
*.swp
.idea/
package-lock.json
dist/*
bundles/*
*.tgz
23 changes: 16 additions & 7 deletions libraries/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
FROM node:12
FROM node:16

RUN apt-get install gconf-service libasound2 libatk1.0-0 libc6 \
libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 \
libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 \
libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 \
libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 \
libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates \
fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget


# Install latest chrome dev package and fonts to support major charsets (Chinese, Japanese, Arabic, Hebrew, Thai and a few others)
# Note: this installs the necessary libs to make the bundled version of Chromium that Puppeteer
# installs, work.
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
&& apt-get update \
&& apt-get install -y google-chrome-unstable libxtst6 libxss1 fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
&& apt-get update \
&& apt-get install -y google-chrome-unstable libxtst6 libxss1 fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*

ENTRYPOINT ["yarn"]
ENTRYPOINT ["npm"]
74 changes: 33 additions & 41 deletions libraries/cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -1,47 +1,39 @@
steps:
# Build docker image with chrome installed
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'custom-yarn', '.']
id: 'prepare'
dir: 'libraries'
# Build docker image with chrome installed
- name: "gcr.io/cloud-builders/docker"
args: ["build", "-t", "custom-npm", "."]
id: "prepare"
dir: "libraries"

# Run yarn install on all folders
- name: 'custom-yarn'
args: ['install']
dir: 'libraries/image'
id: 'image-install'
waitFor: ['prepare']
# Run npm install on all folders
- name: "custom-npm"
args: ["ci"]
dir: "libraries/image"
id: "image-install"
waitFor: ["prepare"]

- name: 'custom-yarn'
args: ['install']
dir: 'libraries/pose'
id: 'pose-install'
waitFor: ['prepare']
- name: "custom-npm"
args: ["ci"]
dir: "libraries/pose"
id: "pose-install"
waitFor: ["prepare"]

- name: 'custom-yarn'
args: ['install']
dir: 'libraries/audio'
id: 'audio-install'
waitFor: ['prepare']
# Build the image bundle
- name: "custom-npm"
args: ["run", "build"]
dir: "libraries/image"

# Build the image bundle
- name: 'custom-yarn'
args: ['run', 'build']
dir: 'libraries/image'

# Test the image library
- name: 'custom-yarn'
args: ['run', 'test']
dir: 'libraries/image'

# Test the image library
- name: "custom-npm"
args: ["run", "test"]
dir: "libraries/image"

# Build the pose bundle
- name: 'custom-yarn'
args: ['run', 'build']
dir: 'libraries/pose'

# Test the pose library
- name: 'custom-yarn'
args: ['run', 'test']
dir: 'libraries/pose'

# Build the pose bundle
- name: "custom-npm"
args: ["run", "build"]
dir: "libraries/pose"

# Test the pose library
- name: "custom-npm"
args: ["run", "test"]
dir: "libraries/pose"
1 change: 0 additions & 1 deletion libraries/image/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ node_modules/
.sass-cache
*.swp
.idea/
package-lock.json
dist/*
bundles/*
*.tgz
Loading

0 comments on commit ef1dbb9

Please sign in to comment.