mirror of
https://framagit.org/les/gancio.git
synced 2025-01-31 08:32:23 +01:00
chore: packaging / docker / yarn, release ...
This commit is contained in:
parent
30c932a7f2
commit
d2372eaa71
7 changed files with 352 additions and 636 deletions
|
@ -3,6 +3,7 @@ node_modules
|
|||
webcomponents
|
||||
yunohost
|
||||
releases
|
||||
!releases/latest.tgz
|
||||
uploads
|
||||
_nuxt2
|
||||
wp_plugin
|
||||
|
|
32
Dockerfile
32
Dockerfile
|
@ -1,9 +1,6 @@
|
|||
# prepare dependencies
|
||||
FROM node:20-slim AS dependencies
|
||||
|
||||
## test with
|
||||
# RUN apk add --update --no-cache vips-dev build-base vips
|
||||
WORKDIR /app
|
||||
WORKDIR /home/node
|
||||
RUN corepack enable
|
||||
COPY package.json yarn.lock ./
|
||||
RUN yarn install --frozen-lockfile --production && \
|
||||
|
@ -17,22 +14,23 @@ RUN yarn install --frozen-lockfile --production && \
|
|||
# RUN yarn test-sqlite
|
||||
|
||||
## build
|
||||
FROM node:20-slim AS build
|
||||
WORKDIR /usr/src/app
|
||||
COPY package.json yarn.lock ./
|
||||
COPY --from=dependencies /app/node_modules ./node_modules
|
||||
COPY . .
|
||||
ENV NODE_ENV=production
|
||||
RUN yarn build --production
|
||||
RUN yarn pack --filename /tmp/package.tgz
|
||||
# FROM node:20-slim AS build
|
||||
# WORKDIR /usr/src/app
|
||||
# COPY package.json yarn.lock ./
|
||||
# COPY --from=dependencies /app/node_modules ./node_modules
|
||||
# COPY . .
|
||||
# ENV NODE_ENV=production
|
||||
# RUN yarn build --production
|
||||
# RUN yarn pack --filename /tmp/package.tgz
|
||||
|
||||
## production
|
||||
FROM node:20-slim
|
||||
RUN mkdir -p /app
|
||||
RUN --mount=type=bind,from=build,source=/tmp/package.tgz,target=/tmp/package.tgz \
|
||||
tar xf /tmp/package.tgz -C /app --strip-components 1
|
||||
COPY --from=dependencies /app/prod_node_modules /app/node_modules
|
||||
# RUN --mount=type=bind,from=build,source=/tmp/package.tgz,target=/tmp/package.tgz \
|
||||
# tar xf /tmp/package.tgz --owner node --group node -C /home/node --strip-components 1
|
||||
ADD releases/latest.tgz /home/node/
|
||||
COPY --from=dependencies /home/node/prod_node_modules /home/node/package/node_modules
|
||||
|
||||
RUN ln -s /home/node/package/server/cli.js /usr/local/bin/gancio
|
||||
|
||||
EXPOSE 13120
|
||||
ENTRYPOINT ["/app/server/cli.js"]
|
||||
ENTRYPOINT ["/home/node/package/server/cli.js"]
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
FROM node:18-slim AS nodejs-base
|
||||
RUN apt-get -q update && \
|
||||
env DEBIAN_FRONTEND=noninteractive apt-get -y install git && \
|
||||
apt-get clean && rm -fr /var/lib/apt/lists/*
|
||||
|
||||
FROM nodejs-base AS build
|
||||
RUN yarnpkg global add --network-timeout 1000000000 --latest --production --silent https://gancio.org/latest.tgz && \
|
||||
apt-get clean && rm -fr /var/lib/apt/lists/* && \
|
||||
yarnpkg cache clean
|
||||
|
||||
FROM nodejs-base
|
||||
COPY --from=build /usr/local/share/.config/yarn/ /usr/local/share/.config/yarn/
|
||||
RUN ln -s ../share/.config/yarn/global/node_modules/.bin/gancio /usr/local/bin/gancio
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/gancio"]
|
||||
|
||||
|
|
@ -13,9 +13,9 @@ sudo apt install curl gcc g++ make wget libpq-dev
|
|||
```
|
||||
|
||||
|
||||
1. Install Node.js & yarn
|
||||
1. Install Node.js & yarn package manager
|
||||
```bash
|
||||
curl -sL https://deb.nodesource.com/setup_18.x | sudo bash -
|
||||
curl -sL https://deb.nodesource.com/setup_20.x | sudo bash -
|
||||
sudo apt-get install -y nodejs
|
||||
sudo npm install -g yarn
|
||||
```
|
||||
|
@ -53,6 +53,9 @@ sudo adduser --group --system --shell /bin/false --home /opt/gancio gancio
|
|||
sudo yarn global add --network-timeout 1000000000 --silent {{site.url}}/latest.tgz
|
||||
```
|
||||
|
||||
> Note "Use yarn"
|
||||
> Only `yarn` is supported as package manager
|
||||
|
||||
> info "Install another release"
|
||||
> You can found old releases at [{{site.url}}/releases]({{site.url}}/releases)
|
||||
|
||||
|
|
|
@ -140,5 +140,6 @@
|
|||
"type": "git",
|
||||
"url": "https://framagit.org/les/gancio"
|
||||
},
|
||||
"snyk": true
|
||||
"snyk": true,
|
||||
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
||||
}
|
||||
|
|
16
release.sh
16
release.sh
|
@ -1,17 +1,19 @@
|
|||
RELEASE=v$(cat package.json | jq ".version" | sed -e 's/"//g')
|
||||
echo "Releasing $RELEASE"
|
||||
rm -fr node_modules
|
||||
yarn
|
||||
yarn build
|
||||
yarn pack
|
||||
yarn publish
|
||||
yarn --frozen-lockfile
|
||||
yarn --frozen-lockfile build
|
||||
yarn --frozen-lockfile pack
|
||||
gpg --pinentry-mode loopback --passphrase `pass underscore/pgp` --detach-sign --local-user 5DAC477D5441B7A15ACBF680BBEB4DD39AC6CCA9 gancio-$RELEASE.tgz
|
||||
cp gancio-$RELEASE.tgz releases/
|
||||
mv gancio-$RELEASE.tgz releases/latest.tgz
|
||||
cp gancio-$RELEASE.tgz.sig releases/
|
||||
mv gancio-$RELEASE.tgz.sig releases/latest.tgz.sig
|
||||
docker build . -t cisti/gancio
|
||||
|
||||
|
||||
yarn doc
|
||||
rsync -a docs/_site/ --chown=www-data:www-data cisti.web:/var/www/gancio/
|
||||
git tag $RELEASE
|
||||
git push --tags
|
||||
cd docs
|
||||
# git tag $RELEASE
|
||||
# git push --tags
|
||||
# cd docs
|
Loading…
Reference in a new issue