Skip to content

Commit

Permalink
continue with docs and compatibility migration helper on web ui
Browse files Browse the repository at this point in the history
  • Loading branch information
lowlighter committed Nov 25, 2023
1 parent be78a61 commit 8122c4c
Show file tree
Hide file tree
Showing 41 changed files with 772 additions and 1,007 deletions.
13 changes: 12 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
# Auto detect text files and perform LF normalization
* text=auto

# TODO(@lowlighter): linguist-attributes
# Hidden files
.github/** -linguist-detectable

# Documentation
CODE_OF_CONDUCT.md linguist-documentation
CONTRIBUTING.md linguist-documentation
SECURITY.md linguist-documentation
README.md linguist-documentation
LICENSE linguist-documentation

# Generated files
deno.lock linguist-generated
2 changes: 0 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
# 🏗️ We're working on it !

<!-- TODO(@lowlighter): write contributing guide -->
18 changes: 14 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
FROM alpine:3.18
RUN apk upgrade --no-cache --available

# Install sudo
RUN apk add --update --no-cache sudo \
&& echo 'metrics ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/metrics

# Install licensed
RUN apk add --no-cache ruby \
&& apk add --no-cache --virtual .licensed ruby-dev make cmake g++ heimdal-dev \
Expand All @@ -17,10 +21,15 @@ RUN apk add --no-cache chromium ttf-freefont font-noto-emoji \
&& apk add --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community font-wqy-zenhei \
&& chromium --version

# Install docker
RUN apk add --update --no-cache docker-cli \
&& addgroup docker \
&& docker --version

# Install deno
ENV DENO_INSTALL /
ENV DENO_NO_UPDATE_CHECK true
ENV DENO_VERSION 1.38.0
ENV DENO_VERSION 1.38.3
ENV GLIBC_VERSION 2.34-r0
RUN apk add --no-cache --virtual .deno curl wget unzip \
&& wget --no-hsts --quiet --output-document /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub \
Expand All @@ -46,16 +55,17 @@ RUN apk add --no-cache npm \

# General configuration
RUN apk add --no-cache git \
&& adduser --system metrics
&& adduser --system metrics \
&& addgroup metrics docker

# Metrics
USER metrics
WORKDIR /metrics
ENV TZ Europe/Paris
ENV TMP /tmp
COPY source /metrics/source
COPY deno.jsonc /metrics/deno.jsonc
COPY deno.lock /metrics/deno.lock
COPY LICENSE /metrics/LICENSE
RUN deno task make cache
RUN deno task make get:browser
ENTRYPOINT [ "deno", "task", "make", "run" ]
ENTRYPOINT [ "deno", "task", "make", "run", "github-action" ]
456 changes: 1 addition & 455 deletions README.md

Large diffs are not rendered by default.

37 changes: 26 additions & 11 deletions deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@
]
},
"tasks": {
// '
"qq": "rm -rf .coverage && deno test --coverage=.coverage --no-check --unstable --trace-ops --allow-all source --filter='base64' && deno coverage .coverage --include='^file:.*/transform.base64/mod.ts'",
"q": "rm -rf .coverage && deno test --coverage=.coverage --unstable --trace-ops --fail-fast --allow-all source && deno coverage .coverage --exclude='/dom/'",
"z": " export CHROME_BIN=$(deno task make get:browser) && deno test --unstable -A source/engine/components/plugin_test.ts", //utils/browser_test.ts
"make": "deno run --allow-env --allow-read --allow-write=.deno-make.json --allow-run=deno https://deno.land/x/[email protected]/mod.ts $0"
},
"+tasks": {
Expand Down Expand Up @@ -116,7 +112,6 @@
"coverage": ".coverage",
"traceOps": true,
"unstable": ["kv", "http"],
//"parallel": true //TODO(@lowlighter): check if it's possible to run tests in parallel
"modules": {
"check": false
},
Expand Down Expand Up @@ -191,12 +186,12 @@
"description": "🔎 Format and lint code",
"task": [
"deno fmt &&",
"deno check **/*.ts &&",
"deno lint"
"deno lint &&",
"deno check **/*.ts"
],
"flags": {
"check": {
"description": "Check only" //TODO(@lowlighter): need to patch deno_make upstream
"description": "Check only"
}
}
},
Expand All @@ -214,22 +209,42 @@
}
}
},
"docker:run": {
"description": "🐋 Run docker image interactively",
"task": [
"docker run --rm --interactive --tty --entrypoint='' --volume //var/run/docker.sock:/var/run/docker.sock --volume $PWD/source:/metrics/source --volume $PWD/deno.jsonc:/metrics/deno.jsonc --user $<user> $<tag> $<command>"
],
"flags": {
"tag": {
"default": "metrics:dev",
"description": "Docker image tag"
},
"user": {
"default": "metrics",
"description": "User to run command as"
},
"command": {
"default": "sh -c 'sudo chgrp docker /var/run/docker.sock && sudo rm /etc/sudoers.d/metrics && sh'",
"description": "Command to execute"
}
}
},
"ci:lint": {
"description": "🤖 Lint code (CI)",
"task": "deno task make lint" // --check
"task": "deno task make lint --check"
},
"ci:test": {
"description": "🤖 Build container and run tests and coverage inside the image (CI)",
"task": [
"deno task make docker &&",
"docker run --rm --entrypoint='' metrics:dev sh -c 'deno task make test && deno task make coverage'"
"docker run --rm --entrypoint='' --volume //var/run/docker.sock:/var/run/docker.sock metrics:dev sh -c 'sudo chgrp docker /var/run/docker.sock && sudo rm /etc/sudoers.d/metrics && deno task make test && deno task make coverage'"
]
},
"deploy:deno": {
"description": "🦕 Deploy metrics on https://deno.com/deploy",
"task": [
"export CACHE_DIRECTORY=$(deno task make get:cache) &&",
"export DENO_DEPLOY_TOKEN=$(deno eval \"console.log(Deno.env.get('DENO_DEPLOY_TOKEN'))\") &&",
"export DENO_DEPLOY_TOKEN=$(deno eval --env \"console.log(Deno.env.get('DENO_DEPLOY_TOKEN'))\") &&",
"deno run source/run/serve/imports.ts &&",
"deployctl deploy --project=$<project> --include=source,deno.jsonc --prod source/run/mod.ts"
],
Expand Down
Loading

0 comments on commit 8122c4c

Please sign in to comment.