mirror of
https://github.com/caprover/caprover
synced 2025-12-12 14:25:39 +00:00
Consolidated release build
This commit is contained in:
@@ -16,35 +16,44 @@ else
|
|||||||
echo "Running on CI"
|
echo "Running on CI"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
|
||||||
|
|
||||||
|
|
||||||
IMAGE_NAME=caprover/caprover
|
IMAGE_NAME=caprover/caprover
|
||||||
|
|
||||||
if [ ! -f ./package-lock.json ]; then
|
if [ ! -f ./package-lock.json ]; then
|
||||||
echo "package-lock.json not found!"
|
echo "package-lock.json not found!"
|
||||||
exit 1;
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
# BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
||||||
# On Github the line above does not work, instead:
|
# On Github the line above does not work, instead:
|
||||||
BRANCH=${GITHUB_REF##*/}
|
BRANCH=${GITHUB_REF##*/}
|
||||||
echo "on branch $BRANCH"
|
echo "on branch $BRANCH"
|
||||||
if [[ "$BRANCH" != "release" ]]; then
|
if [[ "$BRANCH" != "release" ]]; then
|
||||||
echo 'Not on release branch! Aborting script!';
|
echo 'Not on release branch! Aborting script!'
|
||||||
exit 1;
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
FRONTEND_COMMIT_HASH=3a5f5d584e1e51ac22f07dea09be171bec9425a5
|
||||||
|
|
||||||
git clean -fdx .
|
## Building frontend app
|
||||||
npm ci
|
ORIG_DIR=$(pwd)
|
||||||
npm run build
|
FRONTEND_DIR=/home/runner/app-frontend
|
||||||
|
curl -Iv https://registry.yarnpkg.com/
|
||||||
|
mkdir -p $FRONTEND_DIR && cd $FRONTEND_DIR
|
||||||
|
git clone https://github.com/githubsaturn/caprover-frontend.git
|
||||||
|
cd caprover-frontend
|
||||||
|
git reset --hard $FRONTEND_COMMIT_HASH
|
||||||
|
git log --max-count=1
|
||||||
|
yarn install --no-cache --frozen-lockfile --network-timeout 600000
|
||||||
|
echo "Installation finished"
|
||||||
|
yarn run build
|
||||||
|
echo "Building finished"
|
||||||
|
cd $ORIG_DIR
|
||||||
|
mv $FRONTEND_DIR/caprover-frontend/build ./dist-frontend
|
||||||
|
|
||||||
node ./dev-scripts/validate-build-version-docker-hub.js
|
node ./dev-scripts/validate-build-version-docker-hub.js
|
||||||
|
|
||||||
source ./version
|
source ./version
|
||||||
|
|
||||||
|
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
||||||
export DOCKER_CLI_EXPERIMENTAL=enabled
|
export DOCKER_CLI_EXPERIMENTAL=enabled
|
||||||
docker buildx ls
|
docker buildx ls
|
||||||
docker buildx create --name mybuilder
|
docker buildx create --name mybuilder
|
||||||
|
|||||||
@@ -14,24 +14,6 @@ RUN npm ci && \
|
|||||||
npm run build
|
npm run build
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Build frontend code using a fixed hash commit.
|
|
||||||
|
|
||||||
ENV FRONTEND_COMMIT_HASH 3a5f5d584e1e51ac22f07dea09be171bec9425a5
|
|
||||||
|
|
||||||
# armV7 fails: https://github.com/yarnpkg/yarn/issues/5259 https://github.com/nodejs/docker-node/issues/1335
|
|
||||||
RUN curl -Iv https://registry.yarnpkg.com/@ant-design/icons-svg/-/icons-svg-4.1.0.tgz && \
|
|
||||||
mkdir -p /usr/src/app-frontend && cd /usr/src/app-frontend && \
|
|
||||||
git clone https://github.com/githubsaturn/caprover-frontend.git && \
|
|
||||||
cd caprover-frontend && \
|
|
||||||
git reset --hard ${FRONTEND_COMMIT_HASH} && \
|
|
||||||
yarn install --no-cache --frozen-lockfile --network-timeout 600000 && echo "Installation finished" && \
|
|
||||||
yarn run build && echo "Building finished" && \
|
|
||||||
mv ./build ../../app/dist-frontend && \
|
|
||||||
cd / && \
|
|
||||||
rm -rf /usr/src/app-frontend
|
|
||||||
|
|
||||||
ENV NODE_ENV production
|
ENV NODE_ENV production
|
||||||
ENV PORT 3000
|
ENV PORT 3000
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|||||||
Reference in New Issue
Block a user