-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yaml
78 lines (76 loc) · 1.78 KB
/
.gitlab-ci.yaml
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
71
72
73
74
75
76
77
78
stages:
- build
#before_script:
#- if git rev-parse "0.10.1^{tag}" >/dev/null 2>&1
# then
# echo "Found 0.10.1";
# else
# echo "0.10.1 not found";
# fi;
#- if git rev-parse "0.10.2^{tag}" >/dev/null 2>&1
# then
# echo "Found 0.10.2";
# else
# echo "0.10.2 not found";
# fi;
#- if git rev-parse "0.10.3^{tag}" >/dev/null 2>&1
# then
# echo "Found 0.10.3";
# else
# echo "0.10.3 not found";
# fi;
release:
# only:
# - tags
stage: build
image: edbizarro/gitlab-ci-pipeline-php:7.0
tags:
- docker
- gce
script:
- sudo apt-get update && sudo apt-get install -y zip wget
# set remote for further local/dist use
- git remote set-url origin git@github.com:joomplace/X.git
- mkdir -p library && mkdir -p packages
- composer install
- grep -E -o '<filename>(.*?)</filename>' ./manifest.xml
|
while read in;
do
rootdir=`pwd`;
file=$(echo $in | sed -r "s/.*?>(.*?)<\/.*?/\1/g");
cp -f $file $rootdir/library/;
done;
- grep -E -o '<folder>(.*?)</folder>' ./manifest.xml
|
while read in;
do
rootdir=`pwd`;
folder=$(echo $in | sed -r "s/.*?>(.*?)<\/.*?/\1/g");
cp -rf $folder $rootdir/library/;
done
- cp -f ./manifest.xml ./library/
- grep -E -o '<file.*>(.*?)</file>' ./package.xml
|
while read in;
do
rootdir=`pwd`;
source=$(echo $in | sed -r "s/.*src=\"([^\"]*)\".*/\1/g");
dest=$(echo $in | sed -r "s/.*>([^\.]*).zip<\/.*/\1/g");
if [[ $source =~ ^https? ]];
then
cd $rootdir/packages/;
wget --output-document=$dest.zip $source;
cd $rootdir;
else
cd $rootdir/$dest;
zip -r $rootdir/packages/$dest.zip .;
cd $rootdir/;
fi;
done
artifacts:
paths:
- packages/
- package.xml
name: "pkg_JoomPlaceX_${CI_BUILD_REF_NAME}"
when: on_success