Skip to content

Commit

Permalink
Deprecate CODIMD_REPOSITORY in favor of HEDGEDOC_REPOSITORY
Browse files Browse the repository at this point in the history
People using CODIMD_REPOSITORY will now see an error in their docker
build prompting them to change to HEDGEDOC_REPOSITORY.
  • Loading branch information
hugopeixoto committed Nov 17, 2020
1 parent 2fb0b14 commit f579abb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
9 changes: 6 additions & 3 deletions alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
FROM node:12.19.0-alpine

# Build arguments to change source url, branch or tag
ARG CODIMD_REPOSITORY=https://github.com/hedgedoc/server.git
ARG HEDGEDOC_REPOSITORY=https://github.com/hedgedoc/hedgedoc.git
ARG VERSION=master
ARG UID=10000

ARG CODIMD_REPOSITORY
RUN if [ -n "${CODIMD_REPOSITORY}" ]; then echo "CODIMD_REPOSITORY is deprecated. Please use HEDGEDOC_REPOSITORY instead" && exit 1; fi

# Set some default config variables
ENV DOCKERIZE_VERSION=v0.6.1
ENV NODE_ENV=production
Expand Down Expand Up @@ -35,7 +38,7 @@ RUN apk add --no-cache --virtual .dep \
apk add --no-cache --no-progress --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ \
gosu && \
# Clone the source
git clone --depth 1 --branch "$VERSION" "$CODIMD_REPOSITORY" /hedgedoc && \
git clone --depth 1 --branch "$VERSION" "$HEDGEDOC_REPOSITORY" /hedgedoc && \
ln -s /hedgedoc /codimd && \
# Print the cloned version and clean up git files
cd /hedgedoc && \
Expand All @@ -45,7 +48,7 @@ RUN apk add --no-cache --virtual .dep \
# Mime the git repository for fullversion
mkdir /hedgedoc/.git && \
mv /tmp/gitref /hedgedoc/.git/HEAD && \
jq ".repository.url = \"${CODIMD_REPOSITORY}\"" /hedgedoc/package.json > /hedgedoc/package.new.json && \
jq ".repository.url = \"${HEDGEDOC_REPOSITORY}\"" /hedgedoc/package.json > /hedgedoc/package.new.json && \
mv /hedgedoc/package.new.json /hedgedoc/package.json && \
\
# Symlink configuration files
Expand Down
9 changes: 6 additions & 3 deletions debian/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
FROM node:12.19.0-slim

# Build arguments to change source url, branch or tag
ARG CODIMD_REPOSITORY=https://github.com/hedgedoc/server.git
ARG HEDGEDOC_REPOSITORY=https://github.com/hedgedoc/hedgedoc.git
ARG VERSION=master
ARG UID=10000

ARG CODIMD_REPOSITORY
RUN if [ -n "${CODIMD_REPOSITORY}" ]; then echo "CODIMD_REPOSITORY is deprecated. Please use HEDGEDOC_REPOSITORY instead" && exit 1; fi

# Set some default config variables
ARG DEBIAN_FRONTEND=noninteractive
ENV DOCKERIZE_VERSION=v0.6.1
Expand Down Expand Up @@ -37,7 +40,7 @@ RUN export dev_apt=( \
gosu && \
\
# Clone the source
git clone --depth 1 --branch "$VERSION" "$CODIMD_REPOSITORY" /hedgedoc && \
git clone --depth 1 --branch "$VERSION" "$HEDGEDOC_REPOSITORY" /hedgedoc && \
ln -s /hedgedoc /codimd && \
# Print the cloned version and clean up git files
cd /hedgedoc && \
Expand All @@ -48,7 +51,7 @@ RUN export dev_apt=( \
# Mime the git repository for fullversion
mkdir /hedgedoc/.git && \
mv /tmp/gitref /hedgedoc/.git/HEAD && \
jq ".repository.url = \"${CODIMD_REPOSITORY}\"" /hedgedoc/package.json > /hedgedoc/package.new.json && \
jq ".repository.url = \"${HEDGEDOC_REPOSITORY}\"" /hedgedoc/package.json > /hedgedoc/package.new.json && \
mv /hedgedoc/package.new.json /hedgedoc/package.json && \
\
# Symlink configuration files
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ services:
# dockerfile: debian/Dockerfile
# args:
# - "VERSION=master"
# - "CODIMD_REPOSITORY=https://github.com/hedgedoc/server.git"
# - "HEDGEDOC_REPOSITORY=https://github.com/hedgedoc/hedgedoc.git"
image: quay.io/hedgedoc/server:1.6.0
#mem_limit: 256mb # version 2 only
#memswap_limit: 512mb # version 2 only
Expand Down

0 comments on commit f579abb

Please sign in to comment.