Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
75d45bdf
Unverified
Commit
75d45bdf
authored
Apr 21, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Apr 21, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #76856 from SataQiu/fix-hack-cherrypick-20190420
Fix shellcheck failures of hack/cherry_pick_pull.sh
parents
1377108c
e7e51743
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
9 deletions
+15
-9
.shellcheck_failures
hack/.shellcheck_failures
+0
-1
cherry_pick_pull.sh
hack/cherry_pick_pull.sh
+15
-8
No files found.
hack/.shellcheck_failures
View file @
75d45bdf
...
@@ -21,7 +21,6 @@
...
@@ -21,7 +21,6 @@
./cluster/restore-from-backup.sh
./cluster/restore-from-backup.sh
./cluster/test-e2e.sh
./cluster/test-e2e.sh
./cluster/validate-cluster.sh
./cluster/validate-cluster.sh
./hack/cherry_pick_pull.sh
./hack/ginkgo-e2e.sh
./hack/ginkgo-e2e.sh
./hack/grab-profiles.sh
./hack/grab-profiles.sh
./hack/lib/init.sh
./hack/lib/init.sh
...
...
hack/cherry_pick_pull.sh
View file @
75d45bdf
...
@@ -84,8 +84,10 @@ shift 1
...
@@ -84,8 +84,10 @@ shift 1
declare
-r
PULLS
=(
"
$@
"
)
declare
-r
PULLS
=(
"
$@
"
)
function
join
{
local
IFS
=
"
$1
"
;
shift
;
echo
"
$*
"
;
}
function
join
{
local
IFS
=
"
$1
"
;
shift
;
echo
"
$*
"
;
}
declare
-r
PULLDASH
=
$(
join
-
"
${
PULLS
[@]/#/#
}
"
)
# Generates something like "#12345-#56789"
PULLDASH
=
$(
join
-
"
${
PULLS
[@]/#/#
}
"
)
# Generates something like "#12345-#56789"
declare
-r
PULLSUBJ
=
$(
join
" "
"
${
PULLS
[@]/#/#
}
"
)
# Generates something like "#12345 #56789"
declare
-r
PULLDASH
PULLSUBJ
=
$(
join
" "
"
${
PULLS
[@]/#/#
}
"
)
# Generates something like "#12345 #56789"
declare
-r
PULLSUBJ
echo
"+++ Updating remotes..."
echo
"+++ Updating remotes..."
git remote update
"
${
UPSTREAM_REMOTE
}
"
"
${
FORK_REMOTE
}
"
git remote update
"
${
UPSTREAM_REMOTE
}
"
"
${
FORK_REMOTE
}
"
...
@@ -96,9 +98,12 @@ if ! git log -n1 --format=%H "${BRANCH}" >/dev/null 2>&1; then
...
@@ -96,9 +98,12 @@ if ! git log -n1 --format=%H "${BRANCH}" >/dev/null 2>&1; then
exit
1
exit
1
fi
fi
declare
-r
NEWBRANCHREQ
=
"automated-cherry-pick-of-
${
PULLDASH
}
"
# "Required" portion for tools.
NEWBRANCHREQ
=
"automated-cherry-pick-of-
${
PULLDASH
}
"
# "Required" portion for tools.
declare
-r
NEWBRANCH
=
"
$(
echo
"
${
NEWBRANCHREQ
}
-
${
BRANCH
}
"
|
sed
's/\//-/g'
)
"
declare
-r
NEWBRANCHREQ
declare
-r
NEWBRANCHUNIQ
=
"
${
NEWBRANCH
}
-
$(
date
+%s
)
"
NEWBRANCH
=
"
$(
echo
"
${
NEWBRANCHREQ
}
-
${
BRANCH
}
"
|
sed
's/\//-/g'
)
"
declare
-r
NEWBRANCH
NEWBRANCHUNIQ
=
"
${
NEWBRANCH
}
-
$(
date
+%s
)
"
declare
-r
NEWBRANCHUNIQ
echo
"+++ Creating local branch
${
NEWBRANCHUNIQ
}
"
echo
"+++ Creating local branch
${
NEWBRANCHUNIQ
}
"
cleanbranch
=
""
cleanbranch
=
""
...
@@ -128,7 +133,8 @@ trap return_to_kansas EXIT
...
@@ -128,7 +133,8 @@ trap return_to_kansas EXIT
SUBJECTS
=()
SUBJECTS
=()
function
make-a-pr
()
{
function
make-a-pr
()
{
local
rel
=
"
$(
basename
"
${
BRANCH
}
"
)
"
local
rel
rel
=
"
$(
basename
"
${
BRANCH
}
"
)
"
echo
echo
echo
"+++ Creating a pull request on GitHub at
${
GITHUB_USER
}
:
${
NEWBRANCH
}
"
echo
"+++ Creating a pull request on GitHub at
${
GITHUB_USER
}
:
${
NEWBRANCH
}
"
...
@@ -137,7 +143,8 @@ function make-a-pr() {
...
@@ -137,7 +143,8 @@ function make-a-pr() {
# when we shove the heredoc at hub directly, tickling the ioctl
# when we shove the heredoc at hub directly, tickling the ioctl
# crash.
# crash.
prtext
=
"
$(
mktemp
-t
prtext.XXXX
)
"
# cleaned in return_to_kansas
prtext
=
"
$(
mktemp
-t
prtext.XXXX
)
"
# cleaned in return_to_kansas
local
numandtitle
=
$(
printf
'%s\n'
"
${
SUBJECTS
[@]
}
"
)
local
numandtitle
numandtitle
=
$(
printf
'%s\n'
"
${
SUBJECTS
[@]
}
"
)
cat
>
"
${
prtext
}
"
<<
EOF
cat
>
"
${
prtext
}
"
<<
EOF
Automated cherry pick of
${
numandtitle
}
Automated cherry pick of
${
numandtitle
}
...
@@ -218,7 +225,7 @@ if [[ -n "${DRY_RUN}" ]]; then
...
@@ -218,7 +225,7 @@ if [[ -n "${DRY_RUN}" ]]; then
exit
0
exit
0
fi
fi
if
git remote
-v
|
grep
^
${
FORK_REMOTE
}
|
grep
${
MAIN_REPO_ORG
}
/
${
MAIN_REPO_NAME
}
.git
;
then
if
git remote
-v
|
grep
^
"
${
FORK_REMOTE
}
"
|
grep
"
${
MAIN_REPO_ORG
}
/
${
MAIN_REPO_NAME
}
.git"
;
then
echo
"!!! You have
${
FORK_REMOTE
}
configured as your
${
MAIN_REPO_ORG
}
/
${
MAIN_REPO_NAME
}
.git"
echo
"!!! You have
${
FORK_REMOTE
}
configured as your
${
MAIN_REPO_ORG
}
/
${
MAIN_REPO_NAME
}
.git"
echo
"This isn't normal. Leaving you with push instructions:"
echo
"This isn't normal. Leaving you with push instructions:"
echo
echo
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment