diff --git a/.github/workflows/package-pr.yaml b/.github/workflows/package-pr.yaml index db016b2..ac940d9 100644 --- a/.github/workflows/package-pr.yaml +++ b/.github/workflows/package-pr.yaml @@ -91,7 +91,7 @@ jobs: docker run -v $(pwd)'/repo:/piston/repo' -v $(pwd)'/packages:/piston/packages' -d --name repo docker.pkg.github.com/engineer-man/piston/repo-builder --no-build docker run --network container:repo -v $(pwd)'/data:/piston' -d --name api docker.pkg.github.com/engineer-man/piston/api echo Waiting for API to start.. - docker run --network container:api appropriate/curl -s --retry 10 --retry-connrefused http://localhost:2000/runtimes + docker run --network container:api appropriate/curl -s --retry 10 --retry-connrefused http://localhost:2000/api/v1/runtimes echo Waiting for Index to start.. docker run --network container:repo appropriate/curl -s --retry 999 --retry-max-time 0 --retry-connrefused http://localhost:8000/index @@ -100,7 +100,7 @@ jobs: sed -i 's/repo/localhost/g' repo/index echo Listing Packages - PACKAGES_JSON=$(docker run --network container:api appropriate/curl -s http://localhost:2000/packages) + PACKAGES_JSON=$(docker run --network container:api appropriate/curl -s http://localhost:2000/api/v1/packages) echo $PACKAGES_JSON echo Getting CLI ready @@ -114,7 +114,7 @@ jobs: PKG_VERSION=$(awk -F- '{ print $2 }' <<< $package) echo "Installing..." - docker run --network container:api appropriate/curl -sXPOST http://localhost:2000/packages/$PKG_PATH + docker run --network container:api appropriate/curl -sXPOST http://localhost:2000/api/v1/packages/$PKG_PATH TEST_SCRIPTS=packages/$PKG_PATH/test.* echo "Tests: $TEST_SCRIPTS" @@ -123,7 +123,7 @@ jobs: do TEST_RUNTIME=$(awk -F. '{print $2}' <<< $(basename $tscript)) echo Running $tscript with runtime=$TEST_RUNTIME - docker run --network container:api -v "$PWD/cli:/app" -v "$PWD/$(dirname $tscript):/pkg" node:15 /app/index.js run $TEST_RUNTIME $PKG_VERSION /pkg/$(basename $tscript) > test_output + docker run --network container:api -v "$PWD/cli:/app" -v "$PWD/$(dirname $tscript):/pkg" node:15 /app/index.js run $TEST_RUNTIME -l $PKG_VERSION /pkg/$(basename $tscript) > test_output cat test_output grep "OK" test_output done @@ -134,7 +134,7 @@ jobs: if: ${{ always() }} run: | docker logs api - docker logs piston_fs_repo + docker logs repo diff --git a/packages/groovy/3.0.7/build.sh b/packages/groovy/3.0.7/build.sh index ae1ecc5..fb6321d 100755 --- a/packages/groovy/3.0.7/build.sh +++ b/packages/groovy/3.0.7/build.sh @@ -8,6 +8,7 @@ tar xzf java.tar.gz --strip-components=1 rm java.tar.gz cd .. -curl -L "https://dl.bintray.com/groovy/maven/apache-groovy-binary-3.0.7.zip" -o groovy.zip +# Download Groovy binaries +curl -L "https://groovy.jfrog.io/artifactory/dist-release-local/groovy-zips/apache-groovy-binary-3.0.7.zip" -o groovy.zip unzip -q groovy.zip rm groovy.zip diff --git a/packages/groovy/3.0.7/compile b/packages/groovy/3.0.7/compile new file mode 100644 index 0000000..c501c9e --- /dev/null +++ b/packages/groovy/3.0.7/compile @@ -0,0 +1,17 @@ +#!/bin/bash + +# Compile groovy scripts into a separate "classes" directory +# NOTE: - Main file MUST be a groovy script +# - not supporting object class entry points as of now +groovyc -d classes "$@" + +# Create the Manifest and include groovy jars: +# NOTE: - main class will be the first file ('.' becomes '_' and without the extension) +# - groovy lib jars MUST be in the class path in order to work properly +echo "Main-Class: $(sed 's/\./\_/g'<<<${1%.*}) +Class-Path: $(echo $GROOVY_HOME/lib/*.jar | sed 's/\s/\n /g') + +" > manifest.txt + +# Create the jar from the manifest and classes +jar cfm out.jar manifest.txt -C classes . diff --git a/packages/groovy/3.0.7/environment b/packages/groovy/3.0.7/environment index 842a62b..1817781 100644 --- a/packages/groovy/3.0.7/environment +++ b/packages/groovy/3.0.7/environment @@ -2,4 +2,9 @@ # Groovy requires JAVA_HOME to be set export JAVA_HOME=$PWD/java -export PATH=$PWD/groovy-3.0.7/bin:$PATH + +# GROOVY_HOME needed to get the groovy libs +export GROOVY_HOME=$PWD/groovy-3.0.7 + +# Add java and groovy binaries to the path +export PATH=$PWD/java/bin:$PWD/groovy-3.0.7/bin:$PATH diff --git a/packages/groovy/3.0.7/run b/packages/groovy/3.0.7/run index e31d7d4..813d3bc 100644 --- a/packages/groovy/3.0.7/run +++ b/packages/groovy/3.0.7/run @@ -1,3 +1,5 @@ #!/bin/bash -groovy "$@" +# Run the jar created during compile +shift +java -jar out.jar "$@"