Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
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
张蕾
Geth-Modification
Commits
90ffcfde
Unverified
Commit
90ffcfde
authored
Jun 17, 2021
by
Péter Szilágyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
travis, build: own docker builder and hub pusher
parent
a675c89c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
83 additions
and
0 deletions
+83
-0
.travis.yml
.travis.yml
+31
-0
ci.go
build/ci.go
+52
-0
No files found.
.travis.yml
View file @
90ffcfde
...
...
@@ -24,6 +24,37 @@ jobs:
script
:
-
go run build/ci.go lint
# This builder does the Docker Hub build and upload for amd64
-
stage
:
build
if
:
type = push
os
:
linux
dist
:
bionic
go
:
1.16.x
env
:
-
docker
services
:
-
docker
git
:
submodules
:
false
# avoid cloning ethereum/tests
script
:
-
go run build/ci.go docker -upload karalabe/geth-docker-test
# This builder does the Docker Hub build and upload for arm64
-
stage
:
build
if
:
type = push
os
:
linux
arch
:
arm64
dist
:
bionic
go
:
1.16.x
env
:
-
docker
services
:
-
docker
git
:
submodules
:
false
# avoid cloning ethereum/tests
script
:
-
go run build/ci.go docker -upload karalabe/geth-docker-test
# This builder does the Ubuntu PPA upload
-
stage
:
build
if
:
type = push
...
...
build/ci.go
View file @
90ffcfde
...
...
@@ -182,6 +182,8 @@ func main() {
doLint
(
os
.
Args
[
2
:
])
case
"archive"
:
doArchive
(
os
.
Args
[
2
:
])
case
"docker"
:
doDockerImage
(
os
.
Args
[
2
:
])
case
"debsrc"
:
doDebianSource
(
os
.
Args
[
2
:
])
case
"nsis"
:
...
...
@@ -452,6 +454,56 @@ func maybeSkipArchive(env build.Environment) {
}
}
// Builds the docker images and optionally uploads them to Docker Hub.
func
doDockerImage
(
cmdline
[]
string
)
{
var
(
upload
=
flag
.
String
(
"upload"
,
""
,
`Where to upload the docker image (usually "ethereum/client-go")`
)
)
flag
.
CommandLine
.
Parse
(
cmdline
)
// Skip building and pushing docker images for PR builds
env
:=
build
.
Env
()
maybeSkipArchive
(
env
)
// Retrieve the version infos to build and push to the following paths:
// - ethereum/client-go:latest - Pushes to the master branch, Geth only
// - ethereum/client-go:stable - Version tag publish on GitHub, Geth only
// - ethereum/client-go:alltools-latest - Pushes to the master branch, Geth & tools
// - ethereum/client-go:alltools-stable - Version tag publish on GitHub, Geth & tools
// - ethereum/client-go:release-<major>.<minor> - Version tag publish on GitHub, Geth only
// - ethereum/client-go:alltools-release-<major>.<minor> - Version tag publish on GitHub, Geth & tools
// - ethereum/client-go:v<major>.<minor>.<patch> - Version tag publish on GitHub, Geth only
// - ethereum/client-go:alltools-v<major>.<minor>.<patch> - Version tag publish on GitHub, Geth & tools
var
tags
[]
string
switch
{
case
env
.
Branch
==
"master"
:
tags
=
[]
string
{
"latest"
}
case
strings
.
HasPrefix
(
env
.
Tag
,
"v1."
)
:
tags
=
[]
string
{
"stable"
,
fmt
.
Sprintf
(
"release-1.%d"
,
params
.
VersionMinor
),
params
.
Version
}
}
// Build the docker images via CLI (don't pull in the `moby` dep to call 3 commands)
build
.
MustRunCommand
(
"docker"
,
"build"
,
"--tag"
,
fmt
.
Sprintf
(
"%s:TAG"
,
*
upload
),
"."
)
build
.
MustRunCommand
(
"docker"
,
"build"
,
"--tag"
,
fmt
.
Sprintf
(
"%s:alltools-TAG"
,
*
upload
),
"-f"
,
"Dockerfile.alltools"
,
"."
)
// Retrieve the upload credentials and authenticate
user
:=
getenvBase64
(
"DOCKER_HUB_USERNAME"
)
pass
:=
getenvBase64
(
"DOCKER_HUB_PASSWORD"
)
if
len
(
user
)
>
0
&&
len
(
pass
)
>
0
{
auther
:=
exec
.
Command
(
"docker"
,
"login"
,
"-u"
,
string
(
user
),
"--password-stdin"
)
auther
.
Stdin
=
bytes
.
NewReader
(
pass
)
build
.
MustRun
(
auther
)
}
// Tag and upload the images to Docker Hub
for
_
,
tag
:=
range
tags
{
build
.
MustRunCommand
(
"docker"
,
"image"
,
"tag"
,
fmt
.
Sprintf
(
"%s:TAG"
,
*
upload
),
fmt
.
Sprintf
(
"%s:%s"
,
*
upload
,
tag
))
build
.
MustRunCommand
(
"docker"
,
"image"
,
"tag"
,
fmt
.
Sprintf
(
"%s:alltools-TAG"
,
*
upload
),
fmt
.
Sprintf
(
"%s:alltools-%s"
,
*
upload
,
tag
))
build
.
MustRunCommand
(
"docker"
,
"push"
,
fmt
.
Sprintf
(
"%s:%s"
,
*
upload
,
tag
))
build
.
MustRunCommand
(
"docker"
,
"push"
,
fmt
.
Sprintf
(
"%s:alltools-%s"
,
*
upload
,
tag
))
}
}
// Debian Packaging
func
doDebianSource
(
cmdline
[]
string
)
{
var
(
...
...
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