From b1e775a1ab7a11cfbf118334e791d5adfbdbf2f7 Mon Sep 17 00:00:00 2001 From: Clement Denis Date: Wed, 17 Jun 2020 20:16:00 +0200 Subject: [PATCH] add entrypoint and Dockerfile and rename --- dom/Dockerfile | 8 +++++++ {puppeteer => dom}/build-brick-and-break.js | 0 .../build-brick-and-break_test.js | 0 dom/entrypoint.sh | 23 +++++++++++++++++++ {puppeteer => dom}/fifty-shades-of-cold.js | 0 .../fifty-shades-of-cold_test.js | 0 {puppeteer => dom}/get-them-all.js | 0 {puppeteer => dom}/get-them-all_test.js | 0 {puppeteer => dom}/gossip-grid.js | 0 {puppeteer => dom}/gossip-grid_test.js | 0 .../harder-bigger-bolder-stronger.js | 0 .../harder-bigger-bolder-stronger_test.js | 0 {puppeteer => dom}/keycodes-symphony.js | 0 {puppeteer => dom}/keycodes-symphony_test.js | 0 {puppeteer => dom}/mouse-trap.js | 0 {puppeteer => dom}/mouse-trap_test.js | 0 {puppeteer => dom}/package.json | 0 {puppeteer => dom}/pick-and-click.js | 0 {puppeteer => dom}/pick-and-click_test.js | 0 {puppeteer => dom}/pimp-my-style.js | 0 {puppeteer => dom}/pimp-my-style_test.js | 0 {puppeteer => dom}/subjects | 0 {puppeteer => dom}/test.js | 0 {puppeteer => dom}/where-do-we-go.js | 0 {puppeteer => dom}/yarn.lock | 0 25 files changed, 31 insertions(+) create mode 100644 dom/Dockerfile rename {puppeteer => dom}/build-brick-and-break.js (100%) rename {puppeteer => dom}/build-brick-and-break_test.js (100%) create mode 100644 dom/entrypoint.sh rename {puppeteer => dom}/fifty-shades-of-cold.js (100%) rename {puppeteer => dom}/fifty-shades-of-cold_test.js (100%) rename {puppeteer => dom}/get-them-all.js (100%) rename {puppeteer => dom}/get-them-all_test.js (100%) rename {puppeteer => dom}/gossip-grid.js (100%) rename {puppeteer => dom}/gossip-grid_test.js (100%) rename {puppeteer => dom}/harder-bigger-bolder-stronger.js (100%) rename {puppeteer => dom}/harder-bigger-bolder-stronger_test.js (100%) rename {puppeteer => dom}/keycodes-symphony.js (100%) rename {puppeteer => dom}/keycodes-symphony_test.js (100%) rename {puppeteer => dom}/mouse-trap.js (100%) rename {puppeteer => dom}/mouse-trap_test.js (100%) rename {puppeteer => dom}/package.json (100%) rename {puppeteer => dom}/pick-and-click.js (100%) rename {puppeteer => dom}/pick-and-click_test.js (100%) rename {puppeteer => dom}/pimp-my-style.js (100%) rename {puppeteer => dom}/pimp-my-style_test.js (100%) rename {puppeteer => dom}/subjects (100%) rename {puppeteer => dom}/test.js (100%) rename {puppeteer => dom}/where-do-we-go.js (100%) rename {puppeteer => dom}/yarn.lock (100%) diff --git a/dom/Dockerfile b/dom/Dockerfile new file mode 100644 index 000000000..6a184c092 --- /dev/null +++ b/dom/Dockerfile @@ -0,0 +1,8 @@ +FROM buildkite/puppeteer:latest + +ENV GIT_TERMINAL_PROMPT=0 +# RUN apk add --no-cache git +WORKDIR /app +COPY ./puppeteer . +COPY ./subjects ./subjects +ENTRYPOINT ["/bin/sh", "/app/entrypoint.sh"] diff --git a/puppeteer/build-brick-and-break.js b/dom/build-brick-and-break.js similarity index 100% rename from puppeteer/build-brick-and-break.js rename to dom/build-brick-and-break.js diff --git a/puppeteer/build-brick-and-break_test.js b/dom/build-brick-and-break_test.js similarity index 100% rename from puppeteer/build-brick-and-break_test.js rename to dom/build-brick-and-break_test.js diff --git a/dom/entrypoint.sh b/dom/entrypoint.sh new file mode 100644 index 000000000..e83193697 --- /dev/null +++ b/dom/entrypoint.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +set -o noglob +set -o errexit +set -o nounset +IFS=' +' + +mkdir student +cd student + +if test "$REPOSITORY"; then + password=$(cat) + git clone --quiet --depth=1 --shallow-submodules http://root:"${password}"@"$REPOSITORY" . +else + first_file=$(echo "$EXPECTED_FILES" | cut -d' ' -f1) + mkdir -p "$(dirname "$first_file")" + cat > "$first_file" +fi + +cd + +node --unhandled-rejections=strict /app/test.js "${EXERCISE}" diff --git a/puppeteer/fifty-shades-of-cold.js b/dom/fifty-shades-of-cold.js similarity index 100% rename from puppeteer/fifty-shades-of-cold.js rename to dom/fifty-shades-of-cold.js diff --git a/puppeteer/fifty-shades-of-cold_test.js b/dom/fifty-shades-of-cold_test.js similarity index 100% rename from puppeteer/fifty-shades-of-cold_test.js rename to dom/fifty-shades-of-cold_test.js diff --git a/puppeteer/get-them-all.js b/dom/get-them-all.js similarity index 100% rename from puppeteer/get-them-all.js rename to dom/get-them-all.js diff --git a/puppeteer/get-them-all_test.js b/dom/get-them-all_test.js similarity index 100% rename from puppeteer/get-them-all_test.js rename to dom/get-them-all_test.js diff --git a/puppeteer/gossip-grid.js b/dom/gossip-grid.js similarity index 100% rename from puppeteer/gossip-grid.js rename to dom/gossip-grid.js diff --git a/puppeteer/gossip-grid_test.js b/dom/gossip-grid_test.js similarity index 100% rename from puppeteer/gossip-grid_test.js rename to dom/gossip-grid_test.js diff --git a/puppeteer/harder-bigger-bolder-stronger.js b/dom/harder-bigger-bolder-stronger.js similarity index 100% rename from puppeteer/harder-bigger-bolder-stronger.js rename to dom/harder-bigger-bolder-stronger.js diff --git a/puppeteer/harder-bigger-bolder-stronger_test.js b/dom/harder-bigger-bolder-stronger_test.js similarity index 100% rename from puppeteer/harder-bigger-bolder-stronger_test.js rename to dom/harder-bigger-bolder-stronger_test.js diff --git a/puppeteer/keycodes-symphony.js b/dom/keycodes-symphony.js similarity index 100% rename from puppeteer/keycodes-symphony.js rename to dom/keycodes-symphony.js diff --git a/puppeteer/keycodes-symphony_test.js b/dom/keycodes-symphony_test.js similarity index 100% rename from puppeteer/keycodes-symphony_test.js rename to dom/keycodes-symphony_test.js diff --git a/puppeteer/mouse-trap.js b/dom/mouse-trap.js similarity index 100% rename from puppeteer/mouse-trap.js rename to dom/mouse-trap.js diff --git a/puppeteer/mouse-trap_test.js b/dom/mouse-trap_test.js similarity index 100% rename from puppeteer/mouse-trap_test.js rename to dom/mouse-trap_test.js diff --git a/puppeteer/package.json b/dom/package.json similarity index 100% rename from puppeteer/package.json rename to dom/package.json diff --git a/puppeteer/pick-and-click.js b/dom/pick-and-click.js similarity index 100% rename from puppeteer/pick-and-click.js rename to dom/pick-and-click.js diff --git a/puppeteer/pick-and-click_test.js b/dom/pick-and-click_test.js similarity index 100% rename from puppeteer/pick-and-click_test.js rename to dom/pick-and-click_test.js diff --git a/puppeteer/pimp-my-style.js b/dom/pimp-my-style.js similarity index 100% rename from puppeteer/pimp-my-style.js rename to dom/pimp-my-style.js diff --git a/puppeteer/pimp-my-style_test.js b/dom/pimp-my-style_test.js similarity index 100% rename from puppeteer/pimp-my-style_test.js rename to dom/pimp-my-style_test.js diff --git a/puppeteer/subjects b/dom/subjects similarity index 100% rename from puppeteer/subjects rename to dom/subjects diff --git a/puppeteer/test.js b/dom/test.js similarity index 100% rename from puppeteer/test.js rename to dom/test.js diff --git a/puppeteer/where-do-we-go.js b/dom/where-do-we-go.js similarity index 100% rename from puppeteer/where-do-we-go.js rename to dom/where-do-we-go.js diff --git a/puppeteer/yarn.lock b/dom/yarn.lock similarity index 100% rename from puppeteer/yarn.lock rename to dom/yarn.lock