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
e7e51743
Commit
e7e51743
authored
Apr 20, 2019
by
SataQiu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix shellcheck failures of hack/cherry_pick_pull.sh
parent
b3847120
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 @
e7e51743
...
...
@@ -23,7 +23,6 @@
./cluster/test-network.sh
./cluster/test-smoke.sh
./cluster/validate-cluster.sh
./hack/cherry_pick_pull.sh
./hack/ginkgo-e2e.sh
./hack/grab-profiles.sh
./hack/lib/init.sh
...
...
hack/cherry_pick_pull.sh
View file @
e7e51743
...
...
@@ -84,8 +84,10 @@ shift 1
declare
-r
PULLS
=(
"
$@
"
)
function
join
{
local
IFS
=
"
$1
"
;
shift
;
echo
"
$*
"
;
}
declare
-r
PULLDASH
=
$(
join
-
"
${
PULLS
[@]/#/#
}
"
)
# Generates something like "#12345-#56789"
declare
-r
PULLSUBJ
=
$(
join
" "
"
${
PULLS
[@]/#/#
}
"
)
# Generates something like "#12345 #56789"
PULLDASH
=
$(
join
-
"
${
PULLS
[@]/#/#
}
"
)
# Generates something like "#12345-#56789"
declare
-r
PULLDASH
PULLSUBJ
=
$(
join
" "
"
${
PULLS
[@]/#/#
}
"
)
# Generates something like "#12345 #56789"
declare
-r
PULLSUBJ
echo
"+++ Updating remotes..."
git remote update
"
${
UPSTREAM_REMOTE
}
"
"
${
FORK_REMOTE
}
"
...
...
@@ -96,9 +98,12 @@ if ! git log -n1 --format=%H "${BRANCH}" >/dev/null 2>&1; then
exit
1
fi
declare
-r
NEWBRANCHREQ
=
"automated-cherry-pick-of-
${
PULLDASH
}
"
# "Required" portion for tools.
declare
-r
NEWBRANCH
=
"
$(
echo
"
${
NEWBRANCHREQ
}
-
${
BRANCH
}
"
|
sed
's/\//-/g'
)
"
declare
-r
NEWBRANCHUNIQ
=
"
${
NEWBRANCH
}
-
$(
date
+%s
)
"
NEWBRANCHREQ
=
"automated-cherry-pick-of-
${
PULLDASH
}
"
# "Required" portion for tools.
declare
-r
NEWBRANCHREQ
NEWBRANCH
=
"
$(
echo
"
${
NEWBRANCHREQ
}
-
${
BRANCH
}
"
|
sed
's/\//-/g'
)
"
declare
-r
NEWBRANCH
NEWBRANCHUNIQ
=
"
${
NEWBRANCH
}
-
$(
date
+%s
)
"
declare
-r
NEWBRANCHUNIQ
echo
"+++ Creating local branch
${
NEWBRANCHUNIQ
}
"
cleanbranch
=
""
...
...
@@ -128,7 +133,8 @@ trap return_to_kansas EXIT
SUBJECTS
=()
function
make-a-pr
()
{
local
rel
=
"
$(
basename
"
${
BRANCH
}
"
)
"
local
rel
rel
=
"
$(
basename
"
${
BRANCH
}
"
)
"
echo
echo
"+++ Creating a pull request on GitHub at
${
GITHUB_USER
}
:
${
NEWBRANCH
}
"
...
...
@@ -137,7 +143,8 @@ function make-a-pr() {
# when we shove the heredoc at hub directly, tickling the ioctl
# crash.
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
Automated cherry pick of
${
numandtitle
}
...
...
@@ -218,7 +225,7 @@ if [[ -n "${DRY_RUN}" ]]; then
exit
0
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
"This isn't normal. Leaving you with push instructions:"
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