build pill if none yet uploaded

This commit is contained in:
Anton Dyudin 2017-12-01 19:20:24 -08:00
parent 2eb5349802
commit e7b6a365da
7 changed files with 82 additions and 32 deletions

View File

@ -8,11 +8,11 @@ before_install:
echo "FIXME downloaded raw urbit binary releaseinstead of .deb";
echo "FIXME read full pinned url instead of tag name"
before_script: bash make-pill.sh
before_script: bash get-or-build-pill.sh
before_deploy: mkdir piers && tar cvzSf piers/zod-$TRAVIS_COMMIT.tgz zod/
deploy:
skip_cleanup: true
- skip_cleanup: true
provider: gcs
access_key_id: GOOGW5WD4W7RF3TQ5EBM
secret_access_key:
@ -23,3 +23,16 @@ deploy:
on:
repo: urbit/arvo
all_branches: true
#
- skip_cleanup: true
provider: gcs
access_key_id: GOOGW5WD4W7RF3TQ5EBM
secret_access_key:
secure: cbMrx/jloYtTiMc9b+gujrpdzmB05yHC7C2PN1dqHoe25JqwS1c8ne0jhzYOanSkJptPEjwpKeEYLyF87CStCglMJaHwsx1wAm94D8Vh6WL96pgxFbMdVRD+g2dAcSXYnSX5C0QpFrnxY8ujg9yqhItpvd+whsPYjxZahIUd5rPPS1gCP2O6hGpKFCv5++DB1RgqL5y1Hlm9efsLxsnkS7cuzrSX6o8I6Yns5pFlDDRED7Tgpp5DYYfq6ZmiIpxbuYZK+AYJKK7N2zC4RfFXstgL+M9h7joFE1r8RlzrVHLXL7+3qg8POWEEu47008ORByDCmlt5VKoMBJ3q4J4ykDKI2qmx3jw68tGIu2o5uVf6KpxtAM2IJSNZ4mOEYjs7ieR1GOrLKr7lSSYEOIShJhx7J1MMjBOaS17Ho7Uc4iNLGpH4M7DpiKwVLnjfsYiasv/1xq71ed386wLTpI5YyY/SfsNPoIbgv1IjkKIMRLl5l85tEUK10h8dxQi3mXeaP698LnQLdHdxeBKJB08hwJrl7kIOJnqZxWPBp8i7OQeIvKcu+WzMg5UIR4hR7wj7NEga/+1jjjDQeo7EHQB2Tk9dhXtTmozOGpsW49H7+VBThhhNODEYeX3CIcdOtSyjuwBLZ45HsKIhhWA00b+YyE8boBkV1yQeFh/IYCZBn7s=
bucket: bootstrap.urbit.org
local-dir: built-pill/
acl: public-read
on:
condition: -d built-pill/
repo: urbit/arvo
all_branches: true

View File

@ -0,0 +1,50 @@
#!/bin/bash
# XX use -s instead of hash pill
HASH=$(git -C .. log -1 HEAD --format="%H" -- sys/)
export PILL_NAME="git-${HASH:0:10}"
if [ ! $PILL_FORCE ]; then
wget https://bootstrap.urbit.org/$PILL_NAME.pill -O urbit.pill && exit 0
fi
# if wget failed
if [ $TRAVIS_COMMIT ] && [ $TRAVIS_COMMIT != $HASH ]; then
echo Directory sys/ not modified in commit $TRAVIS_COMMIT
echo For auto-build please tag and push $HASH
exit 1
fi
mkdir prev
curl < pin-parent-pill-pier.url | tar xvz -C prev/ ||
{ echo "FIXME not building directly from pill"; exit 1}
lsc -e <<done
do
require! <[ stream-snitch once recursive-copy wait-on ]>
pty = require \pty.js
urbit = pty.spawn './urbit' <[-FI zod prev/zod]>
.on \data -> process.stdout.write it
on-next = (re,cb)->
urbit.pipe (new stream-snitch re).on \match once cb
on-next /\n(\/~|ford: )/ ->
console.log "\n\n---\nnode: detected error\n---\n\n"
set-timeout (-> process.exit 1), 1000
<- on-next /dojo> /
{PILL_NAME} = process.env
urbit.write "|autoload |\r"
urbit.write "|mount %\r"
<- wait-on resources: <[ prev/zod/home ]>
<- recursive-copy '../sys/' 'prev/zod/home/sys/' {+overwrite} .then
<- on-next /sync/
urbit.write "|label %home %#PILL_NAME\r"
urbit.write ".urbit/pill +solid /==/#PILL_NAME/sys, =dub &\r"
<- wait-on resources: <[ prev/zod/.urb/put/urbit.pill ]>
urbit.write "\04"
process.exit 0
done
cp prev/zod/.urb/put/urbit.pill urbit.pill
mkdir built-pill; cp urbit.pill built-pill/$PILL_NAME.pill

View File

@ -1,16 +0,0 @@
#!/bin/bash
# XX use -s instead of hash pill
HASH=$(git -C .. log -1 HEAD --format="%H" -- sys/)
echo FIXME blindly assuming master pill
wget https://bootstrap.urbit.org/$HASH-master.pill -O urbit.pill && exit 0
# if wget failed
if [ $TRAVIS_COMMIT ] && [ $TRAVIS_COMMIT != $HASH ]; then
echo Directory sys/ not modified in commit $TRAVIS_COMMIT
# echo For auto-build please tag and push $HASH
echo FIXME Please manually build and upload $HASH-master.pill
exit 1
fi
echo STUB should build a pill here
exit 1

View File

@ -10,7 +10,10 @@
"license": "MIT",
"dependencies": {
"livescript": "^1.5.0",
"once": "^1.4.0",
"pty.js": "^0.3.1",
"stream-snitch": "0.0.3"
"recursive-copy": "^2.0.7",
"stream-snitch": "0.0.3",
"wait-on": "^2.0.2"
}
}

View File

@ -0,0 +1 @@
https://ci-piers.urbit.org/zod-d8eef9cc46aaf076453b996677d644798847c3e4.tgz

View File

@ -1 +0,0 @@
https://github.com/ohAitch/urbit/releases/download/untagged-4dd5d7e977e58b5f1e21/urbit

View File

@ -13,7 +13,7 @@ urbit.pipe (new stream-snitch /dojo> /g).on \match ->
console.log "\n\n---\nnode: got dojo!\n---\n\n"
set-timeout (-> process.exit 0), 1000 # should probably test further
urbit.pipe (new stream-snitch /ford: /g).on \match ->
urbit.pipe (new stream-snitch /\n(\/~|ford: )/g).on \match ->
return if fin
fin := yes
console.log "\n\n---\nnode: detected error\n---\n\n"
@ -23,4 +23,4 @@ set-timeout ...
-> console.log "\n\n---\nnode: timed out after 5 min\n---"
5*60000
process.on \exit -> urbit.write '\x04' # send EOF to gracefully checkpoint
process.on \exit -> urbit.write '\04' # send EOF to gracefully checkpoint