-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackage.sh
executable file
·28 lines (20 loc) · 820 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
#!/usr/bin/env bash
#Script for create the plugin artifact
echo "Travis tag: $TRAVIS_TAG"
if [ "$TRAVIS_TAG" = "" ]
then
TRAVIS_TAG='1.0.1'
fi
SRC_DIR="."
FILE1="etc/module.xml"
FILE2="composer.json"
sed -i.bkp "s/3.1.1/${TRAVIS_TAG}/g" "$SRC_DIR/$FILE1"
sed -i.bkp "s/\"version\": \"3.1.1\"/\"version\": \"${TRAVIS_TAG}\"/g" "$SRC_DIR/$FILE2"
PLUGIN_FILE="plugin-transbank-webpay-magento2-$TRAVIS_TAG.zip"
zip -FSr $PLUGIN_FILE . -x docs/\* *.git/\* .DS_Store* .editorconfig* .gitignore* .vscode/\* package.sh .idea/\* .gitattributes .travis* README.md *.zip docker-magento2/\* "$FILE1.bkp" "$FILE2.bkp"
cp "$SRC_DIR/$FILE1.bkp" "$SRC_DIR/$FILE1"
cp "$SRC_DIR/$FILE2.bkp" "$SRC_DIR/$FILE2"
rm "$SRC_DIR/$FILE1.bkp"
rm "$SRC_DIR/$FILE2.bkp"
echo "Plugin version: $TRAVIS_TAG"
echo "Plugin file: $PLUGIN_FILE"