-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide a way to apply upstream patches to the image
This change allows users to apply patches to the images during build time directly from gerrit using the new arg PATCH. At the moment, it's limited to upstream projects with patches on gerrit; future changes will allow different sources, including local directories.
- Loading branch information
Showing
4 changed files
with
48 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/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 dist/*.tar.gz | ||
done < "$patch_file" | ||
|
||
cd / | ||
|
Empty file.