From c97566be332c05de9ea6864871368021843e62e7 Mon Sep 17 00:00:00 2001 From: Nulo Date: Sat, 28 Jan 2023 11:59:34 -0300 Subject: [PATCH] repro-run --- .env.example | 1 + .gitignore | 3 +++ build-repro | 37 +++++++++++++++++++++++++++++++++++++ repro-run.json | 8 ++++++++ 4 files changed, 49 insertions(+) create mode 100644 .env.example create mode 100755 build-repro create mode 100644 repro-run.json diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..824f2a0 --- /dev/null +++ b/.env.example @@ -0,0 +1 @@ +SSH_KEY=-----BEGIN OPENSSH PRIVATE KEY-----\n #... diff --git a/.gitignore b/.gitignore index 1f93929..28ec882 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ build/ node_modules/ build.js/ +.env +cache/ +rootfs/ diff --git a/build-repro b/build-repro new file mode 100755 index 0000000..5ee0051 --- /dev/null +++ b/build-repro @@ -0,0 +1,37 @@ +#!/bin/sh -e + +runprint() { + echo "==> $@" + "$@" +} + +runprint apk add --quiet nodejs npm git icu-data-full lua5.1 + +runprint npm install --silent -g pnpm +export PATH="$PATH:/usr/local/bin" + +# https://gitea.nulo.in/Nulo/openring/releases/tag/1.0.1-nulo-sitio-2 +runprint wget -nv -O /usr/local/bin/openring https://gitea.nulo.in/attachments/3ddb2799-3af7-4239-a7fd-9d31670aefb8 +chmod +x /usr/local/bin/openring + +runprint git clone file:///src sitio +cd sitio + +runprint pnpm install --store-dir ~/pnpm-store --package-import-method copy +runprint ./tool refresh_feeds +runprint ./tool check +runprint ./tool build + +runprint apk add --quiet rsync openssh-client-default + +if test -n "$SSH_KEY"; then + eval $(ssh-agent -s) + # https://stackoverflow.com/questions/46147228/dotenv-multiline-variables + echo "${SSH_KEY}" | tr -d '\r' | ssh-add - + mkdir -p ~/.ssh + echo "[nulo.in]:420,[186.136.121.7]:420 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGPkgRVWYcVcgjI0xAjDgZQsYuXU9edcya8zna01ibyUMlfKHIMD9yOoq0R+fQPTCqwiol/2tKMPJ2hlKshc+H8=" > ~/.ssh/known_hosts + + runprint ./upload +else + echo ==> No tengo SSH_KEY, no voy a subir el sitio. +fi diff --git a/repro-run.json b/repro-run.json new file mode 100644 index 0000000..305bf37 --- /dev/null +++ b/repro-run.json @@ -0,0 +1,8 @@ +{ + "Command": "/src/build-repro", + "Cache": [ + "/home/repro/pnpm-store", + "/home/repro/.cache/pnpm", + "/home/repro/.npm" + ] +}