BREAKING: replace custom build scripts with nix

General:
- Switched to yarn to better work with nix-based tooling
- Switched package system to use nix. This stops double dependencies and slow cloud compile times, while providing more compile/runtime support to the Nix project
- Removed container builder in favor of internal container tooling
- Package versions no-longer need to be SemVer compliant
- Removed "piston package spec" files, replaced with nix-flake based runtimes
- Exported nosocket and piston-api as packages within the nix-flake
- Removed repo container
- Switched docker building to nix-based container outputting
- Removed docker compose as this is a single container
- Removed package commands from CLI

Packages:
- Move bash, clojure, cobol, node, python2, python3 to new format
- Remainder of packages still need to be moved

v2 API:
- Removed "version" specifier. To select specific versions, use the v3 api
- Removed "/package" endpoints as this doesn't work with the new nix-based system

v3 API:
- Duplicate of v2 API, except instead of passing in a language name an ID is used intead.
This commit is contained in:
Thomas Hobson 2022-01-30 18:41:24 +13:00
parent e06b59d82c
commit 564da5a7eb
No known key found for this signature in database
GPG key ID: 9F1FD9D87950DB6F
110 changed files with 2293 additions and 2793 deletions

37
runtimes/scaffold.sh Executable file
View file

@ -0,0 +1,37 @@
#!/usr/bin/env sh
if [[ $# -eq 0 ]]; then
echo "Usage: $0 <language name> [runtime name]"
echo
echo "language name: The name of the language to add, e.g. javascript"
echo "runtime name: The name of the runtime to add, e.g. node"
echo " In most cases runtime won't be required, e.g. python3 is both a language and runtime"
exit 1;
fi
LANGUAGE=$1
RUNTIME=$1
NAME=$1
if [[ $# -eq 2 ]]; then
RUNTIME=$2
NAME=$LANGUAGE-$RUNTIME
fi
if grep "./$NAME.nix" default.nix > /dev/null; then
echo "ERROR: $NAME already exists"
echo "Remove it from default.nix and retry if this is intended"
exit 1
else
sed -i '$d' default.nix
echo " \"$NAME\" = import ./$NAME.nix args;" >> default.nix
sed -e 's/%LANGUAGE%/'"$LANGUAGE"'/g' \
-e 's/%RUNTIME%/'"$RUNTIME"'/g' \
.scaffold.nix > $NAME.nix
git add $NAME.nix
echo "}" >> default.nix
echo "Scaffolded $NAME"
echo "Edit $NAME.nix to get started"
fi