mirror of
https://github.com/zhigang1992/wallet.git
synced 2026-01-12 22:53:27 +08:00
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:
15
Dockerfile
15
Dockerfile
@@ -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
|
||||
|
||||
12
build-ext.sh
12
build-ext.sh
@@ -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"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user