forked from composer/getcomposer.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update.sh
executable file
·42 lines (38 loc) · 1.12 KB
/
update.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
# config
root=`pwd`
build="composer-src"
buildscript="bin/compile"
buildphar="composer.phar"
target="web"
repo="https://github.com/composer/composer.git"
composer="composer"
# init
if [ ! -d "$root/$build" ]
then
cd $root
git clone $repo $build
fi
cd "$root/$build"
# update master
git fetch -q origin && \
git fetch --tags -q origin && \
git checkout master -q && \
git rebase origin/master -q && \
$composer install -q && \
php -d phar.readonly=0 $buildscript && \
mv $buildphar "$root/$target/$buildphar" && \
git log --pretty="%H" -n1 HEAD > "$root/$target/version"
# create tagged releases
for version in `git tag`; do
if [ ! -f "$root/$target/download/$version/$buildphar" ]
then
mkdir -p "$root/$target/download/$version/"
git checkout $version -q && \
$composer install -q && \
php -d phar.readonly=0 $buildscript && \
touch --date="`git log -n1 --pretty=%ci $version`" $buildphar && \
mv $buildphar "$root/$target/download/$version/$buildphar"
else
touch --date="`git log -n1 --pretty=%ci $version`" "$root/$target/download/$version/$buildphar"
fi
done