mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 09:53:48 +00:00
Merge 6a3ec6e277 into 1a8894b3d5
This commit is contained in:
commit
fdaf66fe1d
4 changed files with 57 additions and 14 deletions
|
|
@ -65,9 +65,11 @@ matrix:
|
||||||
- dput
|
- dput
|
||||||
- gcc-multilib
|
- gcc-multilib
|
||||||
- fakeroot
|
- fakeroot
|
||||||
|
- python-bzrlib
|
||||||
|
- python-paramiko
|
||||||
script:
|
script:
|
||||||
# Build for the primary platforms that Trusty can manage
|
# Build for the primary platforms that Trusty can manage
|
||||||
- go run build/ci.go debsrc -signer "Go Ethereum Linux Builder <geth-ci@ethereum.org>" -upload ppa:ethereum/ethereum
|
- go run build/ci.go debsrc -signer "Go Ethereum Linux Builder <geth-ci@ethereum.org>" -sftp-user geth-ci -upload ethereum/ethereum
|
||||||
- go run build/ci.go install
|
- go run build/ci.go install
|
||||||
- go run build/ci.go archive -type tar -signer LINUX_SIGNING_KEY -upload gethstore/builds
|
- go run build/ci.go archive -type tar -signer LINUX_SIGNING_KEY -upload gethstore/builds
|
||||||
- go run build/ci.go install -arch 386
|
- go run build/ci.go install -arch 386
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ Add the gophers PPA and install Go 1.10 and Debian packaging tools:
|
||||||
|
|
||||||
$ sudo apt-add-repository ppa:gophers/ubuntu/archive
|
$ sudo apt-add-repository ppa:gophers/ubuntu/archive
|
||||||
$ sudo apt-get update
|
$ sudo apt-get update
|
||||||
$ sudo apt-get install build-essential golang-1.10 devscripts debhelper
|
$ sudo apt-get install build-essential golang-1.10 devscripts debhelper python-bzrlib python-paramiko
|
||||||
|
|
||||||
Create the source packages:
|
Create the source packages:
|
||||||
|
|
||||||
|
|
|
||||||
52
build/ci.go
52
build/ci.go
|
|
@ -461,7 +461,8 @@ func maybeSkipArchive(env build.Environment) {
|
||||||
func doDebianSource(cmdline []string) {
|
func doDebianSource(cmdline []string) {
|
||||||
var (
|
var (
|
||||||
signer = flag.String("signer", "", `Signing key name, also used as package author`)
|
signer = flag.String("signer", "", `Signing key name, also used as package author`)
|
||||||
upload = flag.String("upload", "", `Where to upload the source package (usually "ppa:ethereum/ethereum")`)
|
upload = flag.String("upload", "", `Upload to a Launchpad PPA (usually "ethereum/ethereum")`)
|
||||||
|
sftpUser = flag.String("sftp-user", "", `Username for sftp upload`)
|
||||||
workdir = flag.String("workdir", "", `Output directory for packages (uses temp dir if unset)`)
|
workdir = flag.String("workdir", "", `Output directory for packages (uses temp dir if unset)`)
|
||||||
now = time.Now()
|
now = time.Now()
|
||||||
)
|
)
|
||||||
|
|
@ -470,16 +471,35 @@ func doDebianSource(cmdline []string) {
|
||||||
env := build.Env()
|
env := build.Env()
|
||||||
maybeSkipArchive(env)
|
maybeSkipArchive(env)
|
||||||
|
|
||||||
// Import the signing key.
|
// Import the GPG signing key and the SSH key for sftp.
|
||||||
if b64key := os.Getenv("PPA_SIGNING_KEY"); b64key != "" {
|
if gpgkey := decodeEnvKey("PPA_SIGNING_KEY"); gpgkey != nil {
|
||||||
key, err := base64.StdEncoding.DecodeString(b64key)
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal("invalid base64 PPA_SIGNING_KEY")
|
|
||||||
}
|
|
||||||
gpg := exec.Command("gpg", "--import")
|
gpg := exec.Command("gpg", "--import")
|
||||||
gpg.Stdin = bytes.NewReader(key)
|
gpg.Stdin = bytes.NewReader(gpgkey)
|
||||||
build.MustRun(gpg)
|
build.MustRun(gpg)
|
||||||
}
|
}
|
||||||
|
sshkeyFile := ""
|
||||||
|
if sshkey := decodeEnvKey("PPA_SSH_KEY"); sshkey != nil {
|
||||||
|
sshkeyFile = filepath.Join(*workdir, ".ssh-key")
|
||||||
|
ioutil.WriteFile(sshkeyFile, sshkey, 0600)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Render dput.cf
|
||||||
|
dputConfig := filepath.Join(*workdir, "dput.cf")
|
||||||
|
if *upload != "" {
|
||||||
|
p := strings.Split(*upload, "/")
|
||||||
|
if len(p) != 2 {
|
||||||
|
log.Fatal("-upload PPA name must contain single /")
|
||||||
|
}
|
||||||
|
if *sftpUser == "" {
|
||||||
|
log.Fatal("-sftp-user is required for sftp upload")
|
||||||
|
}
|
||||||
|
build.Render("build/dput-launchpad.cf", dputConfig, 0644, map[string]string{
|
||||||
|
"LaunchpadUser": p[0],
|
||||||
|
"LaunchpadPPA": p[1],
|
||||||
|
"LaunchpadUserSSH": *sftpUser,
|
||||||
|
"IdentityFile": sshkeyFile,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// Create the packages.
|
// Create the packages.
|
||||||
for _, distro := range debDistros {
|
for _, distro := range debDistros {
|
||||||
|
|
@ -495,11 +515,25 @@ func doDebianSource(cmdline []string) {
|
||||||
build.MustRunCommand("debsign", changes)
|
build.MustRunCommand("debsign", changes)
|
||||||
}
|
}
|
||||||
if *upload != "" {
|
if *upload != "" {
|
||||||
build.MustRunCommand("dput", *upload, changes)
|
dput := exec.Command("dput", "--no-upload-log", "-c", dputConfig, *upload, changes)
|
||||||
|
dput.Stdin = strings.NewReader("yes\n") // accept SSH host key
|
||||||
|
build.MustRun(dput)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func decodeEnvKey(variable string) []byte {
|
||||||
|
b64key := os.Getenv(variable)
|
||||||
|
if b64key == "" {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
key, err := base64.StdEncoding.DecodeString(b64key)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal("invalid base64 " + variable)
|
||||||
|
}
|
||||||
|
return key
|
||||||
|
}
|
||||||
|
|
||||||
func makeWorkdir(wdflag string) string {
|
func makeWorkdir(wdflag string) string {
|
||||||
var err error
|
var err error
|
||||||
if wdflag != "" {
|
if wdflag != "" {
|
||||||
|
|
|
||||||
7
build/dput-launchpad.cf
Normal file
7
build/dput-launchpad.cf
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
[{{.LaunchpadUser}}/{{.LaunchpadPPA}}]
|
||||||
|
fqdn = ppa.launchpad.net
|
||||||
|
method = sftp
|
||||||
|
incoming = ~{{.LaunchpadUser}}/ubuntu/{{.LaunchpadPPA}}/
|
||||||
|
login = {{.LaunchpadUserSSH}}
|
||||||
|
allow_unsigned_uploads = 0
|
||||||
|
{{if .IdentityFile}}ssh_config_options = IdentityFile {{.IdentityFile}}{{end}}
|
||||||
Loading…
Reference in a new issue