-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.sh
70 lines (52 loc) · 1.35 KB
/
build.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash
####################
CUR_DIR=$(pwd)
BASEDIR=$(dirname $0)
cd $BASEDIR
BASEDIR=$(pwd)
BUILD_FILENAME="smartling-connector.zip"
TMP_BUILD_DIR=/tmp
SMARTLING_BUILD_DIR=$TMP_BUILD_DIR/smartling-builds
#clean composer cache
rm -rf ~/.composer/cache
# remove old build
rm -rf $BASEDIR/$BUILD_FILENAME
# create temporary build directory
rm -rf $SMARTLING_BUILD_DIR
mkdir $SMARTLING_BUILD_DIR
$BASEDIR/composer self-update
$BASEDIR/composer update --no-dev
cp -r $BASEDIR/* $SMARTLING_BUILD_DIR
# remove dev dependencies
$BASEDIR/composer update
cd $SMARTLING_BUILD_DIR
cd ./inc/third-party/
# cleanup from tests
#find . -name "tests" -type d|xargs rm -Rf
#find . -name "Tests" -type d|xargs rm -Rf
#find . -name "docs" -type d|xargs rm -Rf
#find . -name "phpunit.xml*" -type f|xargs rm -Rf
#find . -name "composer" -type f|xargs rm -Rf
find . -name "*.md" -type f|xargs rm -Rf
find . -name "*travis*" -type f|xargs rm -Rf
#find . -name "*LICENSE*" -type f|xargs rm -Rf
cd ./../../
rm -f ./*.zip
rm -f ./*.log
rm -f ./composer*
rm -Rf ./*.sh
rm -Rf ./*.sql
rm -Rf ./phpunit*
rm -Rf ./tests*
rm -Rf ./upload
rm -Rf ./logs/logfile*
rm -Rf ./*.pid
rm -Rf ./nginx*
rm -Rf ./install-composer
rm -Rf ./inc/third-party/bin
rm -Rf ./Buildplan
zip -9 ./$BUILD_FILENAME -r ./*
echo "#$BASEDIR#"
mv ./$BUILD_FILENAME $BASEDIR/
cd $CUR_DIR
rm -rf $SMARTLING_BUILD_DIR