build(docker): clean-up needed env vars, use sane defaults #21
6 changed files with 5 additions and 21 deletions
3
.github/workflows/build.yml
vendored
3
.github/workflows/build.yml
vendored
|
|
@ -11,8 +11,5 @@ jobs:
|
||||||
name: Build and push
|
name: Build and push
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
build-args: |
|
|
||||||
MANIFEST_ID="community.webstreamr"
|
|
||||||
MANIFEST_NAME="WebStreamr"
|
|
||||||
push: false
|
push: false
|
||||||
tags: webstreamr/webstreamr:latest
|
tags: webstreamr/webstreamr:latest
|
||||||
|
|
|
||||||
11
Dockerfile
11
Dockerfile
|
|
@ -16,17 +16,6 @@ WORKDIR /app
|
||||||
COPY --from=builder /app/dist ./dist
|
COPY --from=builder /app/dist ./dist
|
||||||
COPY --from=builder /app/node_modules ./node_modules
|
COPY --from=builder /app/node_modules ./node_modules
|
||||||
|
|
||||||
ARG PORT
|
|
||||||
|
|
||||||
ARG MANIFEST_ID
|
|
||||||
RUN test -n "$MANIFEST_ID" || (echo "MANIFEST_ID is not set" && exit 1)
|
|
||||||
|
|
||||||
ARG MANIFEST_NAME
|
|
||||||
RUN test -n "$MANIFEST_NAME" || (echo "MANIFEST_NAME is not set" && exit 1)
|
|
||||||
|
|
||||||
ENV MANIFEST_ID=$MANIFEST_ID
|
|
||||||
ENV MANIFEST_NAME=$MANIFEST_NAME
|
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
ENV PORT=$PORT
|
|
||||||
|
|
||||||
CMD ["node", "dist/server.js"]
|
CMD ["node", "dist/server.js"]
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@ const config: Config = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
restoreMocks: true,
|
restoreMocks: true,
|
||||||
setupFilesAfterEnv: ['./jest.setup.ts'],
|
|
||||||
testEnvironment: 'node',
|
testEnvironment: 'node',
|
||||||
transform: {
|
transform: {
|
||||||
'^.+.tsx?$': ['ts-jest', {}],
|
'^.+.tsx?$': ['ts-jest', {}],
|
||||||
|
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
process.env['MANIFEST_ID'] = 'community.webstreamr';
|
|
||||||
process.env['MANIFEST_NAME'] = 'WebStreamr';
|
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
import addon from './addon';
|
import addon from './addon';
|
||||||
|
|
||||||
describe('addon', () => {
|
describe('addon', () => {
|
||||||
test('manifest can be retrieved', () => {
|
test('manifest can be retrieved with defaults', () => {
|
||||||
expect(addon.manifest).toStrictEqual(
|
expect(addon.manifest).toStrictEqual(
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
id: 'community.webstreamr',
|
id: 'webstreamr',
|
||||||
|
name: 'WebStreamr',
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,9 @@ const handlers: Handler[] = [
|
||||||
];
|
];
|
||||||
|
|
||||||
const manifest: Manifest = {
|
const manifest: Manifest = {
|
||||||
id: process.env['MANIFEST_ID'] || '',
|
id: process.env['MANIFEST_ID'] || 'webstreamr',
|
||||||
version: '0.2.0', // x-release-please-version
|
version: '0.2.0', // x-release-please-version
|
||||||
name: process.env['MANIFEST_NAME'] || '',
|
name: process.env['MANIFEST_NAME'] || 'WebStreamr',
|
||||||
description: `Provides HTTP URLs from streaming websites.`,
|
description: `Provides HTTP URLs from streaming websites.`,
|
||||||
resources: [
|
resources: [
|
||||||
'stream',
|
'stream',
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue