Skip to content

Commit

Permalink
Merge pull request #3042 from metacpan/haarg/cleanups
Browse files Browse the repository at this point in the history
misc cleanups
  • Loading branch information
haarg authored May 1, 2024
2 parents fa5af80 + f70da2e commit a7177e7
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 60 deletions.
6 changes: 0 additions & 6 deletions .hadolint.yaml

This file was deleted.

32 changes: 18 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,45 +1,48 @@
################### Asset Builder

FROM node:22 AS build-assets
SHELL [ "/bin/bash", "-euo", "pipefail", "-c" ]
ENV NO_UPDATE_NOTIFIER=1

WORKDIR /build/

COPY package.json package-lock.json .
COPY package.json package-lock.json ./
RUN \
--mount=type=cache,target=/root/.npm,sharing=private \
<<EOT /bin/bash -euo pipefail
<<EOT
npm install --verbose
npm audit fix
EOT

# not supported yet
#COPY --parents build-assets.mjs root/static .

COPY build-assets.mjs .
COPY build-assets.mjs ./
COPY root/static root/static
RUN <<EOT /bin/bash -euo pipefail
RUN <<EOT
npm run build:min
EOT

################### Web Server
# hadolint ignore=DL3007
FROM metacpan/metacpan-base:latest AS server
SHELL [ "/bin/bash", "-euo", "pipefail", "-c" ]

RUN \
--mount=type=cache,target=/var/cache/apt,sharing=private \
--mount=type=cache,target=/var/lib/apt/lists,sharing=private \
<<EOT /bin/bash -euo pipefail
apt update
apt install -y -f libcmark-dev
<<EOT
apt-get update
apt-get satisfy -y -f --no-install-recommends 'libcmark-dev (>= 0.30.2)'
EOT

WORKDIR /metacpan-web/

COPY cpanfile cpanfile.snapshot .
COPY cpanfile cpanfile.snapshot ./
RUN \
--mount=type=cache,target=/root/.perl-cpm,sharing=private \
<<EOT /bin/bash -euo pipefail
cpm install
cpm install --show-build-log-on-failure
EOT

RUN mkdir var && chown metacpan:users var
Expand Down Expand Up @@ -85,6 +88,7 @@ CMD [ \

################### Test Runner
FROM develop AS test
SHELL [ "/bin/bash", "-euo", "pipefail", "-c" ]

ENV NO_UPDATE_NOTIFIER=1
ENV PLACK_ENV=
Expand All @@ -97,12 +101,12 @@ RUN \
--mount=type=cache,target=/root/.npm,sharing=private \
<<EOT /bin/bash -euo pipefail
curl -fsSL https://deb.nodesource.com/setup_21.x | bash -
apt update
apt install -y -f --no-install-recommends nodejs
npm install -g npm
apt-get update
apt-get satisfy -y -f --no-install-recommends 'nodejs (>= 21.6.1)'
npm install -g npm@^10.4.0
EOT

COPY package.json package-lock.json .
COPY package.json package-lock.json ./
RUN \
--mount=type=cache,target=/root/.npm,sharing=private \
<<EOT /bin/bash -euo pipefail
Expand All @@ -113,7 +117,7 @@ EOT
RUN \
--mount=type=cache,target=/root/.perl-cpm \
<<EOT /bin/bash -euo pipefail
cpm install --with-test
cpm install --show-build-log-on-failure --with-test
EOT

COPY .perlcriticrc .perltidyrc perlimports.toml tidyall.ini ./
Expand Down
1 change: 0 additions & 1 deletion git/setup.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/bash

chmod +x git/hooks/pre-commit
cd .git/hooks
ln -s ../../git/hooks/pre-commit
1 change: 0 additions & 1 deletion lib/MetaCPAN/Web/Controller/Account.pm
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ sub profile : Local : Args(0) {
$c->stash( { author => $data, errors => $res->{errors} } );
}
else {
$c->purge_author_key( $data->{pauseid} ) if exists $data->{pauseid};
$c->stash( { success => 1, author => $res } );
}
}
Expand Down
18 changes: 0 additions & 18 deletions t/lib/TestApp.pm

This file was deleted.

19 changes: 0 additions & 19 deletions t/lib/TestContext.pm

This file was deleted.

1 change: 0 additions & 1 deletion t/model/release-info.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use strict;
use warnings;

use lib 't/lib';
use Test::More;
use Module::Runtime qw( use_module );

Expand Down

0 comments on commit a7177e7

Please sign in to comment.