good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
github
maticnetwork
bor
Commits
90ffcfde
Unverified
Commit
90ffcfde
authored
3 years ago
by
Péter Szilágyi
Browse files
Options
Downloads
Patches
Plain Diff
travis, build: own docker builder and hub pusher
parent
a675c89c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.travis.yml
+31
-0
31 additions, 0 deletions
.travis.yml
build/ci.go
+52
-0
52 additions, 0 deletions
build/ci.go
with
83 additions
and
0 deletions
.travis.yml
+
31
−
0
View file @
90ffcfde
...
@@ -24,6 +24,37 @@ jobs:
...
@@ -24,6 +24,37 @@ jobs:
script
:
script
:
-
go run build/ci.go lint
-
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
# This builder does the Ubuntu PPA upload
-
stage
:
build
-
stage
:
build
if
:
type = push
if
:
type = push
...
...
This diff is collapsed.
Click to expand it.
build/ci.go
+
52
−
0
View file @
90ffcfde
...
@@ -182,6 +182,8 @@ func main() {
...
@@ -182,6 +182,8 @@ func main() {
doLint
(
os
.
Args
[
2
:
])
doLint
(
os
.
Args
[
2
:
])
case
"archive"
:
case
"archive"
:
doArchive
(
os
.
Args
[
2
:
])
doArchive
(
os
.
Args
[
2
:
])
case
"docker"
:
doDockerImage
(
os
.
Args
[
2
:
])
case
"debsrc"
:
case
"debsrc"
:
doDebianSource
(
os
.
Args
[
2
:
])
doDebianSource
(
os
.
Args
[
2
:
])
case
"nsis"
:
case
"nsis"
:
...
@@ -452,6 +454,56 @@ func maybeSkipArchive(env build.Environment) {
...
@@ -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
// Debian Packaging
func
doDebianSource
(
cmdline
[]
string
)
{
func
doDebianSource
(
cmdline
[]
string
)
{
var
(
var
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment