-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathpackage.sh
36 lines (29 loc) · 996 Bytes
/
package.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
set -e
PLUGIN=`basename "$PWD"`
VERSION=`echo *.rockspec | sed "s/^kong-plugin-.*-\([0-9.]*.[0-9]*.[0-9]*-[0-9]*\).rockspec/\1/"`
#-------------------------------------------------------
# Remove existing archive directory and create a new one
#-------------------------------------------------------
rm -rf $PLUGIN || true
rm -f kong-plugin-$PLUGIN-$VERSION.tar.gz || true
mkdir -p $PLUGIN
#----------------------------------------------
# Copy files to be archived to archive directory
#----------------------------------------------
cp -R ./kong $PLUGIN
cp INSTALL.txt README.md LICENSE *.rockspec $PLUGIN
#--------------
# Archive files
#--------------
tar cvzf kong-plugin-$PLUGIN-$VERSION.tar.gz $PLUGIN
#-------------------------
# Remove archive directory
#-------------------------
rm -rf $PLUGIN || true
#-------------------------
# Create a rock
#-------------------------
luarocks make
echo "kong-plugin-$PLUGIN $VERSION"
luarocks pack kong-plugin-$PLUGIN $VERSION