-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathpatch-image.sh
More file actions
executable file
·29 lines (23 loc) · 838 Bytes
/
patch-image.sh
File metadata and controls
executable file
·29 lines (23 loc) · 838 Bytes
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
#!/usr/bin/bash
set -ex
patch_file="/tmp/${PATCH_LIST}"
while IFS= read -r line
do
# each line is in the form "project_dir refsspec" where:
# - project is the last part of the project url including the org,
# for example openstack/ironic
# - refspec is the gerrit refspec of the patch we want to test,
# for example refs/changes/67/759567/1
PROJECT=$(echo $line | cut -d " " -f1)
PROJ_NAME=$(echo $PROJECT | cut -d "/" -f2)
PROJ_URL="https://opendev.org/$PROJECT"
REFSPEC=$(echo $line | cut -d " " -f2)
cd /tmp
git clone "$PROJ_URL"
cd "$PROJ_NAME"
git fetch "$PROJ_URL" "$REFSPEC"
git checkout FETCH_HEAD
SKIP_GENERATE_AUTHORS=1 SKIP_WRITE_GIT_CHANGELOG=1 python3 setup.py sdist
pip3 install --prefix=/usr --no-index --no-deps dist/*.tar.gz
done < "$patch_file"
cd /