From 506ae8772e1bf6591081dccfdd02caea8892b3d0 Mon Sep 17 00:00:00 2001 From: Kevin J Hoerr Date: Tue, 21 Sep 2021 03:05:09 +0000 Subject: Tweaks and Fixes - Change default port for Dockerfile to 80 - Use cobertura for coverage report :) - Add starter data for .devcontainer - Add FORMAT var for sh script (*needs change) --- .devcontainer/Dockerfile | 3 + .../badge.svg | 20 + .../index.xml | 498 +++++++++++++++++++++ .devcontainer/docker-compose.yml | 16 +- .devcontainer/mongo/0100-data.js | 16 + Dockerfile | 4 +- package.json | 2 +- public/templates/sh.template | 2 +- 8 files changed, 549 insertions(+), 12 deletions(-) create mode 100644 .devcontainer/data/kjhoerr/ao-coverage/trunk/400ab021c92101bc6db1f70fba41e673de7ee14a/badge.svg create mode 100644 .devcontainer/data/kjhoerr/ao-coverage/trunk/400ab021c92101bc6db1f70fba41e673de7ee14a/index.xml create mode 100644 .devcontainer/mongo/0100-data.js diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 0c2907b..bd84abc 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -28,3 +28,6 @@ RUN mkdir -p $HOST_DIR RUN chown $USER_UID:$USER_GID $HOST_DIR VOLUME [ "${HOST_DIR}" ] ENV HOST_DIR=${HOST_DIR} + +# Copy in starter data +COPY data $HOST_DIR diff --git a/.devcontainer/data/kjhoerr/ao-coverage/trunk/400ab021c92101bc6db1f70fba41e673de7ee14a/badge.svg b/.devcontainer/data/kjhoerr/ao-coverage/trunk/400ab021c92101bc6db1f70fba41e673de7ee14a/badge.svg new file mode 100644 index 0000000..505b421 --- /dev/null +++ b/.devcontainer/data/kjhoerr/ao-coverage/trunk/400ab021c92101bc6db1f70fba41e673de7ee14a/badge.svg @@ -0,0 +1,20 @@ + + coverage: 99% + + + + + + + + + + + + + \ No newline at end of file diff --git a/.devcontainer/data/kjhoerr/ao-coverage/trunk/400ab021c92101bc6db1f70fba41e673de7ee14a/index.xml b/.devcontainer/data/kjhoerr/ao-coverage/trunk/400ab021c92101bc6db1f70fba41e673de7ee14a/index.xml new file mode 100644 index 0000000..da9bc52 --- /dev/null +++ b/.devcontainer/data/kjhoerr/ao-coverage/trunk/400ab021c92101bc6db1f70fba41e673de7ee14a/index.xml @@ -0,0 +1,498 @@ + + + + + /workspace + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 74b5210..3f03bc3 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -10,10 +10,10 @@ services: USER_UID: 1000 USER_GID: 1000 - # Change this if you want zsh as your shell INSTALL_ZSH: false + MONGO_TOOLS_VERSION: 4.2 - # Volume directory for hosted files. This directory is created in the Dockerfile with proper permissions. This is set as an env-var in the Dockerfile + # Volume directory for hosted files. This directory is created on image build with proper permissions. This is set as an env-var in the Dockerfile HOST_DIR: /dist environment: @@ -35,6 +35,7 @@ services: volumes: - ..:/workspace:cached - node-nm:/workspace/node_modules:cached + - dev-dist:/dist:cached # Overrides default command so things don't shut down after the process ends. command: sleep infinity @@ -53,16 +54,15 @@ services: restart: unless-stopped volumes: - mongodb-data:/data/db + - ./mongo:/docker-entrypoint-initdb.d - # Uncomment to change startup options - # environment: - # MONGO_INITDB_ROOT_USERNAME: root - # MONGO_INITDB_ROOT_PASSWORD: example - # MONGO_INITDB_DATABASE: your-database-here + environment: + MONGO_INITDB_DATABASE: ao-coverage # Add "forwardPorts": ["27017"] to **devcontainer.json** to forward MongoDB locally. # (Adding the "ports" property to this file will not forward from a Codespace.) volumes: mongodb-data: - node-nm: \ No newline at end of file + node-nm: + dev-dist: \ No newline at end of file diff --git a/.devcontainer/mongo/0100-data.js b/.devcontainer/mongo/0100-data.js new file mode 100644 index 0000000..dec22ae --- /dev/null +++ b/.devcontainer/mongo/0100-data.js @@ -0,0 +1,16 @@ + +db.createCollection("repository"); +db.repository.insertMany([ + { + organization: "kjhoerr", + name: "ao-coverage", + branches: { + "trunk": { + head: { + commit: "400ab021c92101bc6db1f70fba41e673de7ee14a", + format: "cobertura" + } + } + } + } +]); \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 510681f..9af85dd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,7 +34,7 @@ COPY --from=build /app/build ./build COPY public ./public ENV NODE_ENV=production \ - PORT=8080 \ + PORT=80 \ BIND_ADDRESS=0.0.0.0 \ UPLOAD_LIMIT=134217700 \ LOG_LEVEL=info \ @@ -44,4 +44,4 @@ RUN mkdir -p ${HOST_DIR} VOLUME [ "${HOST_DIR}" ] EXPOSE ${PORT} -CMD [ "node", "./build/index.js" ] \ No newline at end of file +CMD [ "node", "./build/index.js" ] diff --git a/package.json b/package.json index 1c052fa..747e1a5 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "lint": "eslint 'src/**/*.ts'", "lint:fix": "eslint --fix 'src/**/*.ts'", "test": "jest -i", - "test:coverage": "jest -i --coverage", + "test:coverage": "jest -i --coverage --coverageReporters cobertura", "tsc": "tsc", "doc": "typedoc src" }, diff --git a/public/templates/sh.template b/public/templates/sh.template index 0e8e34c..ebb78f0 100644 --- a/public/templates/sh.template +++ b/public/templates/sh.template @@ -8,7 +8,7 @@ url="{{TARGET_URL}}" commit="" branch="" repo="" -format="tarpaulin" +format="${FORMAT:-tarpaulin}" report="" token="$COV_TOKEN" curl_verbosity="" -- cgit