blob: a9aafd76b5ad7299eebf178eb3ce2f9d962d66f8 [file] [log] [blame]
Paladox70d2fcd2016-11-23 19:35:16 +00001#!/bin/bash -e
2
Luca Milanesio511503c2021-12-13 22:21:18 +00003. set-java.sh 11
Luca Milanesio66abd9e2020-10-23 15:28:43 +01004
Antonio Barone68dc5fe2019-08-21 11:02:53 +01005git checkout -fb {branch} gerrit/{branch}
6git submodule update --init
Paladox70d2fcd2016-11-23 19:35:16 +00007rm -rf plugins/{name}
8git read-tree -u --prefix=plugins/{name} origin/{branch}
Luca Milanesio9ccd2962019-12-10 15:20:42 +00009git fetch --tags origin
Paladox70d2fcd2016-11-23 19:35:16 +000010
Thomas Draebing783f1e42020-06-16 17:28:56 +020011for file in external_plugin_deps.bzl package.json
12do
13 if [ -f plugins/{name}/$file ]
14 then
15 cp -f plugins/{name}/$file plugins/
16 fi
17done
Luca Milanesio63748642017-01-26 10:01:28 +000018
Paladox70d2fcd2016-11-23 19:35:16 +000019TARGETS=$(echo "{targets}" | sed -e 's/{{name}}/{name}/g')
Paladox70d2fcd2016-11-23 19:35:16 +000020
David Pursehousea19f76a2019-10-30 16:07:24 +090021java -fullversion
Luca Milanesio4e826372019-06-07 15:19:35 +010022bazelisk version
Luca Milanesio4041dd82020-12-10 15:13:32 +000023bazelisk build $BAZEL_OPTS $TARGETS
Luca Milanesio78fd2e92020-10-07 13:36:35 +010024bazelisk test $BAZEL_OPTS --test_env DOCKER_HOST=$DOCKER_HOST //tools/bzl:always_pass_test plugins/{name}/...
Luca Milanesio7bd7a362018-07-31 08:17:06 -070025
Marcin Czech35c8e8c2020-07-16 18:34:48 +020026for JAR in $(find bazel-bin/plugins/{name} -maxdepth 1 -name {name}*.jar)
27do
28 PLUGIN_VERSION=$(git describe --always origin/{branch})
29 echo -e "Implementation-Version: $PLUGIN_VERSION" > MANIFEST.MF
30 jar ufm $JAR MANIFEST.MF && rm MANIFEST.MF
31 DEST_JAR=bazel-bin/plugins/{name}/$(basename $JAR)
32 [ "$JAR" -ef "$DEST_JAR" ] || mv $JAR $DEST_JAR
33 echo "$PLUGIN_VERSION" > bazel-bin/plugins/{name}/$(basename $JAR-version)
34done