1
0
mirror of https://github.com/lxsang/antd-web-apps synced 2024-11-20 02:18:20 +01:00

use atd for task planning

This commit is contained in:
lxsang 2020-06-26 01:34:09 +02:00
parent 2dd98bc20f
commit 757ebdd4ee
2 changed files with 22 additions and 27 deletions

View File

@ -47,16 +47,8 @@ function NotfoundController:index(...)
local path = WWW_ROOT..DIR_SEP.."scripts"..DIR_SEP..repository..".sh" local path = WWW_ROOT..DIR_SEP.."scripts"..DIR_SEP..repository..".sh"
if ulib.exists(path) then if ulib.exists(path) then
result("Build done, log file: https://ci.iohub.dev/log/"..repository.."_"..branch..".txt") result("Build action triggered, log file will soon be available at: https://ci.iohub.dev/log/"..repository.."_"..branch..".txt")
local cmd = "/bin/bash "..path.." "..branch os.execute("at now -f "..path)
local handle = io.popen(cmd)
local f = io.open(WWW_ROOT..DIR_SEP.."log"..DIR_SEP..repository.."_"..branch..".txt", "w")
for line in handle:lines() do
f:write(line)
f:write("\n")
end
handle:close()
f:close()
else else
fail("No build script found") fail("No build script found")
end end

View File

@ -1,25 +1,28 @@
#! /bin/bash #! /bin/bash
BRANCH="master" BRANCH="ci"
REPO="https://github.com/lxsang/antos.git" REPO="https://github.com/lxsang/antos.git"
DEST="/opt/www/htdocs/os" DEST="/opt/www/htdocs/os"
if [ ! -z $1 ]; then if [ ! -z $1 ]; then
BRANCH="$1" BRANCH="$1"
fi fi
echo "Build date: $(date)" {
echo "Building AntOS using branch $BRANCH..." echo "Build date: $(date)"
if [ -d "/tmp/ci" ]; then echo "Building AntOS using branch $BRANCH..."
echo "Clean up /tmp/ci" if [ -d "/tmp/ci" ]; then
rm -rf /tmp/ci/* echo "Clean up /tmp/ci"
else rm -rf /tmp/ci/*
echo "Creating /tmp/ci" else
mkdir -p "/tmp/ci" echo "Creating /tmp/ci"
fi mkdir -p "/tmp/ci"
cd /tmp/ci || (echo "Unable to change directory to /tmp/ci" && exit 1) fi
echo "Cloning Antos (branch $BRANCH) to /tmp/ci..." cd /tmp/ci || (echo "Unable to change directory to /tmp/ci" && exit 1)
git clone -b "$BRANCH" --single-branch --depth=1 "$REPO" echo "Cloning Antos (branch $BRANCH) to /tmp/ci..."
npm i @types/jquery git clone -b "$BRANCH" --single-branch --depth=1 "$REPO"
cd antos || (echo "Unable to change directory to source code folder" && exit 1) npm i @types/jquery
BUILDDIR="$DEST" make release cd antos || (echo "Unable to change directory to source code folder" && exit 1)
echo "Done!" BUILDDIR="$DEST" make release
echo "Done!"
} > "/opt/www/htdocs/ci/log/antos_$BRANCH.txt"