Skip to content

Commit

Permalink
Merge pull request #350 from dgrebb/release/2.4.0
Browse files Browse the repository at this point in the history
Release/2.4.0
  • Loading branch information
dgrebb authored Jun 29, 2023
2 parents bb2bf3e + 6da4401 commit 9491ec6
Show file tree
Hide file tree
Showing 15 changed files with 722 additions and 490 deletions.
2 changes: 1 addition & 1 deletion .cz.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"commitizen": {
"name": "cz_conventional_commits",
"version": "2.3.1",
"version": "2.4.0",
"tag_format": "$major.$minor.$patch$prerelease",
"version_type": "semver",
"bump_message": "release $current_version \u2192 $new_version"
Expand Down
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,26 @@

All notable changes to this project will be documented in this file.

## [2.4.0] - 2023-06-29

### 💡 Features

- ***(docker)*** Adds patch-package step and improves caching
- ***(strapi)*** Upgrades strapi to v4.11.3
- ***(strapi)*** Adds plausible analytics dashboard to strapi
- ***(utils)*** Adds back/front package version bumps to bump script

### 🐛 Bug Fixes

- ***(front)*** Adjusts padding for `p`s and `h*`s

### 👷 Build

- ***(project)*** Updates package.json file versions and names
- ***(strapi)*** Upgrades patches for strapi 4.11.3
- ***(strapi)*** Uninstalls postinstall-postinstall
- ***(utils)*** Renames cdcms to cdback

## [2.3.1] - 2023-06-27

### 🐛 Bug Fixes
Expand Down
42 changes: 31 additions & 11 deletions _docker/back.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,46 @@
# -------- Base Node -------- #
FROM node:18-alpine AS base
# Installing libvips-dev for sharp Compatibility
RUN apk update && apk add --no-cache build-base gcc autoconf automake zlib-dev libpng-dev nasm bash vips-dev
RUN apk update && apk add --no-cache build-base \
gcc autoconf automake zlib-dev libpng-dev \
nasm bash vips-dev

# -------- Dependencies -------- #
FROM base AS dependencies
COPY package*.json /tmp
RUN cd /tmp && npm ci
WORKDIR /opt/
COPY package*.json ./
COPY ./patches ./patches
RUN npm ci --include=dev \
&& npm run postinstall --loglevel verbose \
&& npm cache clean --force

# -------- Build -------- #
FROM base AS build
WORKDIR /opt/
COPY --from=dependencies /opt/node_modules ./node_modules
ENV PATH /opt/node_modules/.bin:$PATH
ARG NODE_ENV=production
ENV NODE_ENV=${NODE_ENV}
WORKDIR /opt/app
COPY . .
RUN npm run build

# -------- Release -------- #
FROM base AS release
RUN mkdir -p /opt/app
COPY --from=dependencies /tmp /opt/app/
FROM node:18-alpine
RUN apk add --no-cache vips-dev
WORKDIR /opt/
COPY --from=build /opt/node_modules ./node_modules
WORKDIR /opt/app
COPY ./ .
ENV PATH /opt/app/node_modules/.bin:$PATH
RUN strapi build
COPY --from=build /opt/app ./
ENV PATH /opt/node_modules/.bin:$PATH

# -------- Healthcheck -------- #
HEALTHCHECK --interval=30s --timeout=60s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:1337/_health || exit 1
CMD wget --no-verbose --tries=1 --spider \
http://localhost:1337/_health || exit 1

# -------- Run -------- #
RUN chown -R node:node /opt/app
USER node
EXPOSE 1337
CMD strapi start
CMD ["npm", "run", "start"]
6 changes: 6 additions & 0 deletions _utils/_scripts/bump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,10 @@ echo # newline
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
exit 1
fi
cdfront
npm version $ver
cdback
npm version $ver
cd $directory/../
git add .
cz bump
10 changes: 5 additions & 5 deletions _utils/_scripts/cms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,33 @@ while test "$1" != --; do
case $1 in
d | dev)
setBackEnv ld
cdcms && \
cdback && \
trap 'printf "\n"; shred ; printDgMsg "Done!" ; exit 0' SIGINT; \
npm run develop
break
;;
ad | admin-dev)
setBackEnv ld
cdcms && \
cdback && \
trap 'printf "\n"; shred ; printDgMsg "Done!" ; exit 0' SIGINT; \
npm run develop -- --watch-admin
break
;;
ds | dev-stage)
setBackEnv ls
cdcms && \
cdback && \
trap 'printf "\n"; shred ; printDgMsg "Done!" ; exit 0' SIGINT; \
npm run develop -- --watch-admin
break
;;
i | install)
setBackEnv l
cdcms && npm i
cdback && npm i
break
;;
b | build)
setBackEnv l
cdcms && npm run build
cdback && npm run build
break
;;
?)
Expand Down
2 changes: 1 addition & 1 deletion _utils/_scripts/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ run() {
docker run -p 1337:1337 -it ${back_img}
}

cdcms() {
cdback() {
cd ${directory}/../back
}

Expand Down
3 changes: 2 additions & 1 deletion back/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
.cache
.tmp
build
build
public/uploads/*
Loading

0 comments on commit 9491ec6

Please sign in to comment.