forked from metwork-framework/mfext
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
69 lines (67 loc) · 3.41 KB
/
.drone.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
68
69
pipeline:
bootstrap:
image: metwork/mfext-${OS_VERSION}-buildimage:${DRONE_BRANCH}
pull: true
commands:
- if test "$${FORCED_OS_VERSION}" != ""; then if test "$${FORCED_OS_VERSION}" != "${OS_VERSION}"; then echo "step bypass"; exit 0; fi; fi
- mkdir -p /opt/metwork-mfext-${DRONE_BRANCH}
- ./bootstrap.sh /opt/metwork-mfext-${DRONE_BRANCH}
- cat adm/root.mk
- cat adm/root.mk >.drone_cache_tmp
- rpm -qa >>.drone_cache_tmp
- DRONE_CACHE_HASH=`cat .drone_cache_tmp |sort |md5sum |awk '{print $1;}'`
- rm -f .drone_cache_tmp
- if ! test -f /buildcache/build_$${DRONE_CACHE_HASH}; then echo $${DRONE_CACHE_HASH} >.drone_cache; fi
volumes:
- /buildcache:/buildcache
when:
event: [push]
build:
image: metwork/mfext-${OS_VERSION}-buildimage:${DRONE_BRANCH}
commands:
- if test "$${FORCED_OS_VERSION}" != ""; then if test "$${FORCED_OS_VERSION}" != "${OS_VERSION}"; then echo "step bypass"; exit 0; fi; fi
- if ! test -f .drone_cache; then echo "publish bypass"; exit 0; fi
- export METWORK_BUILD_OS=${OS_VERSION}
- mkdir -p /opt/metwork-mfext-${DRONE_BRANCH}
- mkdir -p /pub/metwork/continuous_integration/buildlogs/${DRONE_BRANCH}/mfext/${OS_VERSION}/${DRONE_BUILD_NUMBER}
- make >/pub/metwork/continuous_integration/buildlogs/${DRONE_BRANCH}/mfext/${OS_VERSION}/${DRONE_BUILD_NUMBER}/make.log 2>&1
- make doc >>/pub/metwork/continuous_integration/buildlogs/${DRONE_BRANCH}/mfext/${OS_VERSION}/${DRONE_BUILD_NUMBER}/make.log 2>&1
- rm -Rf html_doc
- cp -Rf /opt/metwork-mfext-${DRONE_BRANCH}/html_doc .
- make test >>/pub/metwork/continuous_integration/buildlogs/${DRONE_BRANCH}/mfext/${OS_VERSION}/${DRONE_BUILD_NUMBER}/make.log 2>&1
- make RELEASE_BUILD=${DRONE_BUILD_NUMBER} rpm >>/pub/metwork/continuous_integration/buildlogs/${DRONE_BRANCH}/mfext/${OS_VERSION}/${DRONE_BUILD_NUMBER}/make.log 2>&1
- mv /opt/metwork-mfext-${DRONE_BRANCH}/*.rpm .
- echo ${DRONE_BUILD_NUMBER} >/buildcache/build_`cat .drone_cache`
volumes:
- /buildcache:/buildcache
- /pub:/pub
when:
event: [push]
publish_ci:
image: metwork/mfext-${OS_VERSION}-buildimage:${DRONE_BRANCH}
commands:
- if test "$${FORCED_OS_VERSION}" != ""; then if test "$${FORCED_OS_VERSION}" != "${OS_VERSION}"; then echo "step bypass"; exit 0; fi; fi
- if ! test -f .drone_cache; then echo "publish bypass"; exit 0; fi
- mkdir -p /pub/metwork/continuous_integration/rpms/${DRONE_BRANCH}/${OS_VERSION}/
- cp *.rpm /pub/metwork/continuous_integration/rpms/${DRONE_BRANCH}/${OS_VERSION}/
- yum -y install createrepo
- createrepo --update /pub/metwork/continuous_integration/rpms/${DRONE_BRANCH}/${OS_VERSION}
- if test "${OS_VERSION}" = "centos6"; then rm -Rf /pub/metwork/continuous_integration/docs/${DRONE_BRANCH}/mfext; mkdir -p /pub/metwork/continuous_integration/docs/${DRONE_BRANCH}/mfext ; cp -Rf html_doc/* /pub/metwork/continuous_integration/docs/${DRONE_BRANCH}/mfext/ ; fi
volumes:
- /pub:/pub
when:
event: [push]
trigger:
image: plugins/downstream
fork: true
repositories:
- metwork-framework/docker-mfcom-${OS_VERSION}-buildimage@${DRONE_BRANCH}
secrets: [ downstream_token, downstream_server ]
when:
status: [ success ]
event: push
matrix:
OS_VERSION:
- centos6
- centos7
branches: [ master, integration ]