-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathinsert_commit_into_db
executable file
·71 lines (59 loc) · 1.84 KB
/
insert_commit_into_db
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
#!/bin/bash
# SPDX-Identifier: gpl-2.0-or-later
# Copyright (C) 2021, Red Hat, Inc.
#
# Inserts SERIES_ID, patch_id, patch_url, patch_name, and sha into db so
# that github_mon is able to get build status on a patch by patch basis.
#
# Licensed under the terms of the GNU General Public License as published
# by the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version. You may obtain a copy of the
# license at
#
# https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
[ -f "$(dirname $0)/series_db_lib.sh" ] && source "$(dirname $0)/series_db_lib.sh"
if [ "X" = "X$series_id" ]; then
series_id="$1"
shift
fi
if [ "X" = "X$patch_id" ]; then
patch_id="$1"
shift
fi
if [ "X" = "X$patch_url" ]; then
patch_url="$1"
shift
fi
if [ "X" = "X$patch_name" ]; then
patch_name="$1"
shift
fi
if [ "X" = "X$sha" ]; then
sha="$1"
shift
fi
if [ "X" = "X$pw_instance" ]; then
pw_instance="$1"
shift
fi
if [ "X" = "X$project" ]; then
project="$1"
shift
fi
if [ "X" = "X$repo_name" ]; then
repo_name="$1"
shift
fi
if [ "X" = "X$series_id" -o "X" = "X$patch_id" -o "X" = "X$patch_url" -o "X" = "X$patch_name" -o \
"X" = "X$sha" -o "X" = "X$pw_instance" -o "X" = "X$project" -o "X" = "X$repo_name" ]; then
echo "Missing arguments to $0. Nothing pushed to database. Exiting" 1>&2
exit 1
fi
patch_name=$(echo "$patch_name" | sed 's@"@""@g')
insert_commit "$series_id" "$patch_id" "$patch_url" "$patch_name" "$sha" "$pw_instance" "$project" "$repo_name"