ci: updating Dockerfile/script for extensions

- use a standard debian image for building
- update build script to set the timestamp of all files to first day of the current month with time of 00:00
  - md5sum wasn't matching for identical files if zip was created at different times
- update script slightly based on new insructions to create ./dist directory
This commit is contained in:
wileyj
2020-12-08 11:52:53 -05:00
committed by Hank Stoever
parent 2d0b14d474
commit afd184e7b5
2 changed files with 16 additions and 11 deletions

View File

@@ -1,15 +1,16 @@
FROM nikolaik/python-nodejs:python3.9-nodejs14 as build
FROM debian:buster-slim as builder
LABEL maintainer="ux@blockstack.com"
COPY . .
RUN apt-get update -y && apt-get install -y build-essential python3 nodejs zip curl \
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& sh -c 'echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list' \
&& apt-get update -y && apt-get install -y yarn \
&& ./build-ext.sh
# Build browser extensions
RUN apt-get update && \
apt-get install -y zip make && \
./build-ext.sh
FROM alpine:latest
COPY --from=build extension.zip .
COPY --from=builder /extension.zip .
# Wait for extension.zip to be copied into local
CMD sleep 60
CMD sleep 30

View File

@@ -1,11 +1,15 @@
#!/bin/sh
echo "🛠 Installing dependencies."
yarn
echo "🛠 Building internal packages."
yarn lerna run build --scope @stacks/connect-ui
echo "🛠 Compiling extension."
yarn lerna run prod:ext
cd packages/app && yarn lerna run prod:ext
echo "🛠 Packaging Browser Extension"
cd packages/app/dist
zip -r ../../../extension.zip *
cd dist
TS=$(date +%Y)$(date +%m)010000
find -print | while read file; do
touch -t $TS "$file"
done
zip -Xro /extension.zip *
echo "✅ Extension packaged as extension.zip"