<commit_before>FROM node:8 as builder

RUN mkdir /app
WORKDIR /app
COPY . /app

RUN yarn --ignore-scripts

ARG RELEASE

ENV NODE_ENV production
ENV RELEASE ${RELEASE}

RUN yarn build:all # includes styleguide

FROM getsentry/sentry-cli as sentry

RUN mkdir /app
WORKDIR /app/

ARG SENTRY_AUTH_KEY
ARG SENTRY_ORG
ARG SENTRY_PROJECT
ARG SENTRY_URL
ARG RELEASE

ENV SENTRY_AUTH_TOKEN ${SENTRY_AUTH_KEY}
ENV SENTRY_ORG ${SENTRY_ORG}
ENV SENTRY_PROJECT ${SENTRY_PROJECT}
ENV SENTRY_URL ${SENTRY_URL}

COPY --from=builder /app/dist dist
COPY --from=builder /app/dist-client dist-client

RUN sentry-cli releases new ${RELEASE}
RUN sentry-cli releases \
files ${RELEASE} upload-sourcemaps \
'./dist-client/'
RUN sentry-cli releases \
files ${RELEASE} upload-sourcemaps \
'./dist/' \
--url-prefix="/app/dist/"
RUN sentry-cli releases finalize ${RELEASE}

FROM node:8-alpine
MAINTAINER <NAME> <<EMAIL>>
RUN mkdir /app
WORKDIR /app/

COPY --from=builder /app/dist dist
COPY --from=builder /app/dist-client dist-client
COPY --from=builder /app/package.json .
COPY --from=builder /app/styleguide styleguide
COPY --from=builder /app/node_modules node_modules

RUN yarn delete-sourcemaps
<commit_msg>Add release to final build stage<commit_after>FROM node:8 as builder

RUN mkdir /app
WORKDIR /app
COPY . /app

RUN yarn --ignore-scripts

ARG RELEASE

ENV NODE_ENV production
ENV RELEASE ${RELEASE}

RUN yarn build:all # includes styleguide

FROM getsentry/sentry-cli as sentry

RUN mkdir /app
WORKDIR /app/

ARG SENTRY_AUTH_KEY
ARG SENTRY_ORG
ARG SENTRY_PROJECT
ARG SENTRY_URL
ARG RELEASE

ENV SENTRY_AUTH_TOKEN ${SENTRY_AUTH_KEY}
ENV SENTRY_ORG ${SENTRY_ORG}
ENV SENTRY_PROJECT ${SENTRY_PROJECT}
ENV SENTRY_URL ${SENTRY_URL}

COPY --from=builder /app/dist dist
COPY --from=builder /app/dist-client dist-client

RUN sentry-cli releases new ${RELEASE}
RUN sentry-cli releases \
files ${RELEASE} upload-sourcemaps \
'./dist-client/'
RUN sentry-cli releases \
files ${RELEASE} upload-sourcemaps \
'./dist/' \
--url-prefix="/app/dist/"
RUN sentry-cli releases finalize ${RELEASE}

FROM node:8-alpine
MAINTAINER <NAME> <<EMAIL>>
RUN mkdir /app
WORKDIR /app/

ARG RELEASE
ENV RELEASE ${RELEASE}

COPY --from=builder /app/dist dist
COPY --from=builder /app/dist-client dist-client
COPY --from=builder /app/package.json .
COPY --from=builder /app/styleguide styleguide
COPY --from=builder /app/node_modules node_modules

RUN yarn delete-sourcemaps

{'fraction_non_alphanumeric': 0.10762886597938144, 'fraction_numerical': 0.0016494845360824743, 'mean_word_length': 4.367256637168142, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '39591', 'n_tokens_mistral': 871, 'n_tokens_neox': 841, 'n_words': 256}