forked from php4umagento/falcon-magento2-development
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
67 lines (64 loc) · 2.71 KB
/
.gitlab-ci.yml
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
image: php:7.1.11
stages:
- release
packagist:
stage: release
before_script:
- echo "deb [check-valid-until=no] http://archive.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/jessie-backports.list
- sed -i '/deb http:\/\/deb.debian.org\/debian jessie-updates main/d' /etc/apt/sources.list
- apt-get -o Acquire::Check-Valid-Until=false update
- 'which ssh-agent || ( apt-get install openssh-client git -y )'
- eval $(ssh-agent -s)
- git config --global user.email "[email protected]"
- git config --global user.name "Sergii Gozhedrianov"
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- ssh-keyscan github.com >> ~/.ssh/known_hosts
- if [ `which git 2> /dev/null` ]; then
OUT_REVISION=`git describe --always`;
if [ "`git rev-parse tags/$CI_COMMIT_REF_NAME 2>/dev/null`" = "tags/$CI_COMMIT_REF_NAME" ]; then
BRANCH_NAME=$CI_COMMIT_REF_NAME;
else
BRANCH_NAME=$(git branch -a --contains $(git rev-parse tags/$CI_COMMIT_REF_NAME)|grep origin|awk -F/ '{print $3}');
fi;
else
OUT_REVISION=nevermind;
BRANCH_NAME=$CI_COMMIT_REF_NAME;
fi;
- echo -e "\n\n\033[47m\033[1;30m\n\n ----------------------------------------------------------"
"\n `date`\n Building branch $BRANCH_NAME\n Revision $OUT_REVISION\n"
" From working dir $CI_PROJECT_DIR\n Out Image ${IMAGE_TAG}\n Building tag $CI_BUILD_REF_NAME\n --------\n\n\033[0m"
script:
- echo "$GIT_SSH_PRIV_KEY" | tr -d '\r' | ssh-add - > /dev/null
- git clone -b $BRANCH_NAME --single-branch [email protected]:deity-io/falcon-magento2-module.git
- rm -fr falcon-magento2-module/src/*
- cp -r app/code/Deity/ falcon-magento2-module/src/
- cd falcon-magento2-module
- if [ `git status --porcelain | wc -l` -ne 0 ]; then
echo "sync changes to module repo";
git add src;
git commit -m "$CI_COMMIT_MESSAGE";
git push origin $BRANCH_NAME;
else
echo "nothing to release";
fi;
- cd ../
- ssh-add -D
- echo "$GIT_DEV_REPO" | tr -d '\r' | ssh-add - > /dev/null
- git clone -b develop-m2.2 --single-branch [email protected]:deity-io/falcon-magento2-development.git m22
- rm -fr m22/app/code/Deity
- cp -r app/code/Deity/ m22/app/code/
- cp dev/tests/static/testsuite/Magento/Test/Php/_files/whitelist/common.txt m22/dev/tests/static/testsuite/Magento/Test/Php/_files/whitelist/common.txt
- cp dev/travis/config/static_php_common.txt m22/dev/travis/config/static_php_common.txt
- cd m22
- git config core.fileMode false
- if [ `git status --porcelain | wc -l` -ne 0 ]; then
echo "sync changes to m2.2 branch";
git add . ;
git commit -m "$CI_COMMIT_MESSAGE";
git push origin develop-m2.2;
else
echo "nothing to back sync";
fi;
only:
- develop