blob: 142892e729776579778b2ac83e8c9a28d08a677d [file] [log] [blame]
Gary Wud04e4402017-07-28 12:26:54 -07001#!/bin/bash
2#
3# Copyright 2016-2017 Huawei Technologies Co., Ltd.
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16#
17
18# autorelease root dir
19ROOT=`git rev-parse --show-toplevel`/autorelease
20
21BUILD_DIR=$ROOT/build
22JJB_DIR=$BUILD_DIR/ci-management/jjb
23
24cd $BUILD_DIR
25
26# docker root dir
27DOCKER=`git rev-parse --show-toplevel`/test/csit/docker
28
29cd $DOCKER
30
31OUTFILE=$JJB_DIR/integration/integration-docker-microservices.yaml
32
33cat > $OUTFILE <<EOF
34---
35- project:
36 name: integration-docker-microservices
37 project: 'integration'
38 branch: 'master'
39 version: '1.1.0-SNAPSHOT'
40 mvn-settings: 'autorelease-settings'
41 build-node: 'centos7-robot-8c-8g'
42 jobs:
43 - 'integration-{microservice}-verify-docker'
44 - 'integration-{microservice}-merge-docker'
45 microservice:
46EOF
47
48TMPDIR=`$ROOT/scripts/generate-jjbs/gen-job-lists.sh`
49IFS=$'\n'
50for line in `$ROOT/scripts/ls-microservice-repos.py | sort`; do
51 IFS=' '
52 array=($line)
53 microservice=${array[0]}
54 repo=${array[1]}
55 trigger=${array[2]}
56 echo $microservice $repo $trigger
57 cat >> $OUTFILE <<EOF
58 - '${microservice}':
59 trigger_jobs:
60EOF
61 for job in `cat ${TMPDIR}/merge-jobs/${repo}.txt | grep "${trigger}"`; do
62 cat >> $OUTFILE <<EOF
63 - '${job}'
64EOF
65 done
66done