Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
fd14c4e7
Commit
fd14c4e7
authored
Apr 15, 2020
by
Madhura Bhave
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch docker upgrade script to submit issue rather than PR
Closes gh-20976
parent
c98fe519
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
78 deletions
+21
-78
pipeline.yml
ci/pipeline.yml
+1
-22
create-pull-request.sh
ci/scripts/create-pull-request.sh
+0
-16
detect-docker-updates.sh
ci/scripts/detect-docker-updates.sh
+18
-22
create-pull-request.yml
ci/tasks/create-pull-request.yml
+0
-14
detect-docker-updates.yml
ci/tasks/detect-docker-updates.yml
+2
-4
No files found.
ci/pipeline.yml
View file @
fd14c4e7
...
@@ -27,14 +27,6 @@ resources:
...
@@ -27,14 +27,6 @@ resources:
username
:
((github-username))
username
:
((github-username))
password
:
((github-password))
password
:
((github-password))
branch
:
((branch))
branch
:
((branch))
-
name
:
git-repo-ci-docker
type
:
git
icon
:
github-circle
source
:
uri
:
((github-repo))
username
:
((github-username))
password
:
((github-password))
branch
:
ci-docker-((branch))
-
name
:
git-repo-windows
-
name
:
git-repo-windows
type
:
git
type
:
git
source
:
source
:
...
@@ -192,7 +184,6 @@ jobs:
...
@@ -192,7 +184,6 @@ jobs:
-
name
:
detect-docker-updates
-
name
:
detect-docker-updates
plan
:
plan
:
-
get
:
git-repo
-
get
:
git-repo
-
get
:
git-repo-ci-docker
-
get
:
every-wednesday
-
get
:
every-wednesday
trigger
:
true
trigger
:
true
-
get
:
spring-boot-ci-image
-
get
:
spring-boot-ci-image
...
@@ -200,23 +191,11 @@ jobs:
...
@@ -200,23 +191,11 @@ jobs:
-
task
:
detect-docker-updates
-
task
:
detect-docker-updates
file
:
git-repo/ci/tasks/detect-docker-updates.yml
file
:
git-repo/ci/tasks/detect-docker-updates.yml
params
:
params
:
GITHUB_REPO
:
spring-boot
GITHUB_ORGANIZATION
:
spring-projects
MILESTONE
:
((milestone))
image
:
spring-boot-ci-image
-
put
:
git-repo-ci-docker
params
:
repository
:
git-repo-updated
force
:
true
-
task
:
create-pull-request
file
:
git-repo/ci/tasks/create-pull-request.yml
params
:
BASE_BRANCH
:
((branch))
BRANCH
:
ci-docker-((branch))
GITHUB_REPO
:
spring-boot
GITHUB_REPO
:
spring-boot
GITHUB_ORGANIZATION
:
spring-projects
GITHUB_ORGANIZATION
:
spring-projects
GITHUB_PASSWORD
:
((github-password))
GITHUB_PASSWORD
:
((github-password))
GITHUB_USERNAME
:
((github-username))
GITHUB_USERNAME
:
((github-username))
MILESTONE
:
((milestone))
image
:
spring-boot-ci-image
image
:
spring-boot-ci-image
-
name
:
build
-
name
:
build
serial
:
true
serial
:
true
...
...
ci/scripts/create-pull-request.sh
deleted
100755 → 0
View file @
c98fe519
#!/bin/bash
set
-e
if
[[
-f
commit-details/message
]]
;
then
ISSUE_TITLE
=
"
$(
cat
commit-details/message
)
"
curl
\
-s
\
-u
${
GITHUB_USERNAME
}
:
${
GITHUB_PASSWORD
}
\
-H
"Content-type:application/json"
\
-d
"{
\"
head
\"
:
\"
${
BRANCH
}
\"
,
\"
base
\"
:
\"
${
BASE_BRANCH
}
\"
,
\"
title
\"
:
\"
${
ISSUE_TITLE
}
\"
,
\"
body
\"
:
\"\"
,
\"
labels
\"
:[
\"
status: waiting-for-triage
\"
,
\"
type: task
\"
]}"
\
-f
\
-X
\
POST
"https://api.github.com/repos/
${
GITHUB_ORGANIZATION
}
/
${
GITHUB_REPO
}
/pulls"
>
/dev/null
||
{
echo
"Failed to create pull request"
>
&2
;
exit
1
;
}
else
echo
"Already up-to-date."
fi
\ No newline at end of file
ci/scripts/detect-docker-updates.sh
View file @
fd14c4e7
#!/bin/bash
#!/bin/bash
latest_version
=
$(
curl
-I
-s
https://github.com/docker/docker-ce/releases/latest |
grep
"location:"
|
awk
'{n=split($0, parts, "/"); print substr(parts[n],2);}'
|
awk
'{$1=$1;print}'
|
tr
-d
'\r'
|
tr
-d
'\n'
)
latest_version
=
$(
curl
-I
-s
https://github.com/docker/docker-ce/releases/latest |
grep
"location:"
|
awk
'{n=split($0, parts, "/"); print substr(parts[n],2);}'
|
awk
'{$1=$1;print}'
|
tr
-d
'\r'
|
tr
-d
'\n'
)
title_prefix
=
"Upgrade CI to Docker"
milestone_number
=
$(
curl
-s
https://api.github.com/repos/
${
GITHUB_ORGANIZATION
}
/
${
GITHUB_REPO
}
/milestones
\?
state
\=
open | jq
-c
--arg
MILESTONE
"
$MILESTONE
"
'.[] | select(.title==$MILESTONE)'
| jq
-r
'.number'
)
existing_upgrade_issues
=
$(
curl
-s
https://api.github.com/repos/
${
GITHUB_ORGANIZATION
}
/
${
GITHUB_REPO
}
/issues
\?
labels
\=
type
:%20task
\&
state
\=
open
\&
creator
\=
spring-buildmaster
\&
milestone
\=
${
milestone_number
}
| jq
-c
--arg
TITLE_PREFIX
"
$title_prefix
"
'.[] | select(.pull_request != null) | select(.title | startswith($TITLE_PREFIX))'
)
if
[[
${
existing_upgrade_issues
}
=
""
]]
;
then
git clone git-repo git-repo-updated
>
/dev/null
else
git clone git-repo-ci-docker git-repo-updated
>
/dev/null
echo
"Pull request already exists."
exit
0
fi
if
[[
$latest_version
=
~
(
beta|rc
)
]]
;
then
if
[[
$latest_version
=
~
(
beta|rc
)
]]
;
then
echo
"Skip pre-release versions"
echo
"Skip pre-release versions"
exit
0
;
exit
0
;
fi
fi
title_prefix
=
"Upgrade CI to Docker"
milestone_number
=
$(
curl
-s
https://api.github.com/repos/
${
GITHUB_ORGANIZATION
}
/
${
GITHUB_REPO
}
/milestones
\?
state
\=
open | jq
-c
--arg
MILESTONE
"
$MILESTONE
"
'.[] | select(.title==$MILESTONE)'
| jq
-r
'.number'
)
existing_upgrade_issues
=
$(
curl
-s
https://api.github.com/repos/
${
GITHUB_ORGANIZATION
}
/
${
GITHUB_REPO
}
/issues
\?
labels
\=
type
:%20task
\&
state
\=
open
\&
creator
\=
spring-buildmaster
\&
milestone
\=
${
milestone_number
}
| jq
-c
--arg
TITLE_PREFIX
"
$title_prefix
"
'.[] | select(.title | startswith($TITLE_PREFIX))'
)
latest
=
"https://download.docker.com/linux/static/stable/x86_64/docker-
$latest_version
.tgz"
latest
=
"https://download.docker.com/linux/static/stable/x86_64/docker-
$latest_version
.tgz"
current
=
$(
git-repo/ci/images/get-docker-url.sh
)
current
=
$(
git-repo/ci/images/get-docker-url.sh
)
...
@@ -28,12 +19,17 @@ if [[ $current = $latest ]]; then
...
@@ -28,12 +19,17 @@ if [[ $current = $latest ]]; then
exit
0
;
exit
0
;
fi
fi
pushd
git-repo-updated
>
/dev/null
ISSUE_TITLE
=
"
$title_prefix
$latest_version
"
git config user.name
"Spring Buildmaster"
>
/dev/null
git config user.email
"buildmaster@springframework.org"
>
/dev/null
if
[[
${
existing_upgrade_issues
}
=
""
]]
;
then
sed
-i
"s/version=.*/version=
\"
$latest_version
\"
/"
ci/images/get-docker-url.sh
curl
\
git add ci/images/get-docker-url.sh
>
/dev/null
-s
\
commit_message
=
"
$title_prefix
$latest_version
"
-u
${
GITHUB_USERNAME
}
:
${
GITHUB_PASSWORD
}
\
git commit
-m
"
$commit_message
"
>
/dev/null
-H
"Content-type:application/json"
\
popd
-d
"{
\"
title
\"
:
\"
${
ISSUE_TITLE
}
\"
,
\"
milestone
\"
:
\"
${
milestone_number
}
\"
,
\"
body
\"
:
\"
${
latest
}
\"
,
\"
labels
\"
:[
\"
status: waiting-for-triage
\"
,
\"
type: task
\"
]}"
\
echo
${
commit_message
}
>
commit-details/message
-f
\
\ No newline at end of file
-X
\
POST
"https://api.github.com/repos/
${
GITHUB_ORGANIZATION
}
/
${
GITHUB_REPO
}
/issues"
>
/dev/null
||
{
echo
"Failed to create issue"
>
&2
;
exit
1
;
}
else
echo
"Issue already exists."
fi
\ No newline at end of file
ci/tasks/create-pull-request.yml
deleted
100644 → 0
View file @
c98fe519
---
platform
:
linux
inputs
:
-
name
:
git-repo
-
name
:
commit-details
params
:
BASE_BRANCH
:
BRANCH
:
GITHUB_REPO
:
GITHUB_ORGANIZATION
:
GITHUB_PASSWORD
:
GITHUB_USERNAME
:
run
:
path
:
git-repo/ci/scripts/create-pull-request.sh
ci/tasks/detect-docker-updates.yml
View file @
fd14c4e7
...
@@ -2,13 +2,11 @@
...
@@ -2,13 +2,11 @@
platform
:
linux
platform
:
linux
inputs
:
inputs
:
-
name
:
git-repo
-
name
:
git-repo
-
name
:
git-repo-ci-docker
outputs
:
-
name
:
git-repo-updated
-
name
:
commit-details
params
:
params
:
GITHUB_REPO
:
GITHUB_REPO
:
GITHUB_ORGANIZATION
:
GITHUB_ORGANIZATION
:
GITHUB_PASSWORD
:
GITHUB_USERNAME
:
MILESTONE
:
MILESTONE
:
run
:
run
:
path
:
git-repo/ci/scripts/detect-docker-updates.sh
path
:
git-repo/ci/scripts/detect-docker-updates.sh
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