Enable arm64 and MacOS Docker build
This commit is contained in:
parent
309f05c166
commit
819596cb1f
@ -7,7 +7,7 @@ Build-Depends: debhelper, wget, tar, gzip, make, dh-exec
|
|||||||
Standards-Version: 3.9.5
|
Standards-Version: 3.9.5
|
||||||
|
|
||||||
Package: {{.Backend.PackageName}}
|
Package: {{.Backend.PackageName}}
|
||||||
Architecture: amd64
|
Architecture: {{.Env.Architecture}}
|
||||||
Depends: ${shlibs:Depends}, ${misc:Depends}, logrotate
|
Depends: ${shlibs:Depends}, ${misc:Depends}, logrotate
|
||||||
Description: Satoshilabs packaged {{.Coin.Name}} server
|
Description: Satoshilabs packaged {{.Coin.Name}} server
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|||||||
@ -7,7 +7,7 @@ Build-Depends: debhelper, dh-exec
|
|||||||
Standards-Version: 3.9.5
|
Standards-Version: 3.9.5
|
||||||
|
|
||||||
Package: {{.Blockbook.PackageName}}
|
Package: {{.Blockbook.PackageName}}
|
||||||
Architecture: amd64
|
Architecture: {{.Env.Architecture}}
|
||||||
Depends: ${shlibs:Depends}, ${misc:Depends}, coreutils, passwd, findutils, psmisc, {{.Backend.PackageName}}
|
Depends: ${shlibs:Depends}, ${misc:Depends}, coreutils, passwd, findutils, psmisc, {{.Backend.PackageName}}
|
||||||
Description: Satoshilabs blockbook server ({{.Coin.Name}})
|
Description: Satoshilabs blockbook server ({{.Coin.Name}})
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|||||||
@ -16,10 +16,10 @@ if [ -z "$IMG_CREATED_TIME" ]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
IMG_CREATED_TS=$(date -d $IMG_CREATED_TIME +%s)
|
IMG_CREATED_TS=$IMG_CREATED_TIME
|
||||||
GIT_COMMIT_TS=$(date -d $(git log --pretty="format:%cI" -1 $DIR) +%s)
|
GIT_COMMIT_TS=$(git log --pretty="format:%cI" -1 $DIR)
|
||||||
|
|
||||||
if [ $IMG_CREATED_TS -lt $GIT_COMMIT_TS ]; then
|
if [[ "$IMG_CREATED_TS" < "$GIT_COMMIT_TS" ]]; then
|
||||||
echo "out-of-time"
|
echo "out-of-time"
|
||||||
else
|
else
|
||||||
echo "ok"
|
echo "ok"
|
||||||
|
|||||||
@ -8,10 +8,36 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"reflect"
|
||||||
|
"runtime"
|
||||||
"text/template"
|
"text/template"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Backend contains backend specific fields
|
||||||
|
type Backend struct {
|
||||||
|
PackageName string `json:"package_name"`
|
||||||
|
PackageRevision string `json:"package_revision"`
|
||||||
|
SystemUser string `json:"system_user"`
|
||||||
|
Version string `json:"version"`
|
||||||
|
BinaryURL string `json:"binary_url"`
|
||||||
|
VerificationType string `json:"verification_type"`
|
||||||
|
VerificationSource string `json:"verification_source"`
|
||||||
|
ExtractCommand string `json:"extract_command"`
|
||||||
|
ExcludeFiles []string `json:"exclude_files"`
|
||||||
|
ExecCommandTemplate string `json:"exec_command_template"`
|
||||||
|
LogrotateFilesTemplate string `json:"logrotate_files_template"`
|
||||||
|
PostinstScriptTemplate string `json:"postinst_script_template"`
|
||||||
|
ServiceType string `json:"service_type"`
|
||||||
|
ServiceAdditionalParamsTemplate string `json:"service_additional_params_template"`
|
||||||
|
ProtectMemory bool `json:"protect_memory"`
|
||||||
|
Mainnet bool `json:"mainnet"`
|
||||||
|
ServerConfigFile string `json:"server_config_file"`
|
||||||
|
ClientConfigFile string `json:"client_config_file"`
|
||||||
|
AdditionalParams interface{} `json:"additional_params,omitempty"`
|
||||||
|
Platforms map[string]Backend `json:"platforms,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
// Config contains the structure of the config
|
// Config contains the structure of the config
|
||||||
type Config struct {
|
type Config struct {
|
||||||
Coin struct {
|
Coin struct {
|
||||||
@ -33,27 +59,7 @@ type Config struct {
|
|||||||
RPCTimeout int `json:"rpc_timeout"`
|
RPCTimeout int `json:"rpc_timeout"`
|
||||||
MessageQueueBindingTemplate string `json:"message_queue_binding_template"`
|
MessageQueueBindingTemplate string `json:"message_queue_binding_template"`
|
||||||
} `json:"ipc"`
|
} `json:"ipc"`
|
||||||
Backend struct {
|
Backend Backend `json:"backend"`
|
||||||
PackageName string `json:"package_name"`
|
|
||||||
PackageRevision string `json:"package_revision"`
|
|
||||||
SystemUser string `json:"system_user"`
|
|
||||||
Version string `json:"version"`
|
|
||||||
BinaryURL string `json:"binary_url"`
|
|
||||||
VerificationType string `json:"verification_type"`
|
|
||||||
VerificationSource string `json:"verification_source"`
|
|
||||||
ExtractCommand string `json:"extract_command"`
|
|
||||||
ExcludeFiles []string `json:"exclude_files"`
|
|
||||||
ExecCommandTemplate string `json:"exec_command_template"`
|
|
||||||
LogrotateFilesTemplate string `json:"logrotate_files_template"`
|
|
||||||
PostinstScriptTemplate string `json:"postinst_script_template"`
|
|
||||||
ServiceType string `json:"service_type"`
|
|
||||||
ServiceAdditionalParamsTemplate string `json:"service_additional_params_template"`
|
|
||||||
ProtectMemory bool `json:"protect_memory"`
|
|
||||||
Mainnet bool `json:"mainnet"`
|
|
||||||
ServerConfigFile string `json:"server_config_file"`
|
|
||||||
ClientConfigFile string `json:"client_config_file"`
|
|
||||||
AdditionalParams interface{} `json:"additional_params,omitempty"`
|
|
||||||
} `json:"backend"`
|
|
||||||
Blockbook struct {
|
Blockbook struct {
|
||||||
PackageName string `json:"package_name"`
|
PackageName string `json:"package_name"`
|
||||||
SystemUser string `json:"system_user"`
|
SystemUser string `json:"system_user"`
|
||||||
@ -87,6 +93,7 @@ type Config struct {
|
|||||||
BackendDataPath string `json:"backend_data_path"`
|
BackendDataPath string `json:"backend_data_path"`
|
||||||
BlockbookInstallPath string `json:"blockbook_install_path"`
|
BlockbookInstallPath string `json:"blockbook_install_path"`
|
||||||
BlockbookDataPath string `json:"blockbook_data_path"`
|
BlockbookDataPath string `json:"blockbook_data_path"`
|
||||||
|
Architecture string `json:"architecture"`
|
||||||
} `json:"-"`
|
} `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -136,6 +143,16 @@ func (c *Config) ParseTemplate() *template.Template {
|
|||||||
return t
|
return t
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func copyNonZeroBackendFields(toValue *Backend, fromValue *Backend) {
|
||||||
|
from := reflect.ValueOf(*fromValue)
|
||||||
|
to := reflect.ValueOf(toValue).Elem()
|
||||||
|
for i := 0; i < from.NumField(); i++ {
|
||||||
|
if from.Field(i).IsValid() && !from.Field(i).IsZero() {
|
||||||
|
to.Field(i).Set(from.Field(i))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// LoadConfig loads the config files
|
// LoadConfig loads the config files
|
||||||
func LoadConfig(configsDir, coin string) (*Config, error) {
|
func LoadConfig(configsDir, coin string) (*Config, error) {
|
||||||
config := new(Config)
|
config := new(Config)
|
||||||
@ -161,8 +178,15 @@ func LoadConfig(configsDir, coin string) (*Config, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
config.Meta.BuildDatetime = time.Now().Format("Mon, 02 Jan 2006 15:04:05 -0700")
|
config.Meta.BuildDatetime = time.Now().Format("Mon, 02 Jan 2006 15:04:05 -0700")
|
||||||
|
config.Env.Architecture = runtime.GOARCH
|
||||||
|
|
||||||
if !isEmpty(config, "backend") {
|
if !isEmpty(config, "backend") {
|
||||||
|
// set platform specific fields to config
|
||||||
|
platform, found := config.Backend.Platforms[runtime.GOARCH]
|
||||||
|
if found {
|
||||||
|
copyNonZeroBackendFields(&config.Backend, &platform)
|
||||||
|
}
|
||||||
|
|
||||||
switch config.Backend.ServiceType {
|
switch config.Backend.ServiceType {
|
||||||
case "forking":
|
case "forking":
|
||||||
case "simple":
|
case "simple":
|
||||||
|
|||||||
@ -41,6 +41,12 @@
|
|||||||
"client_config_file": "bitcoin_client.conf",
|
"client_config_file": "bitcoin_client.conf",
|
||||||
"additional_params": {
|
"additional_params": {
|
||||||
"deprecatedrpc": "estimatefee"
|
"deprecatedrpc": "estimatefee"
|
||||||
|
},
|
||||||
|
"platforms": {
|
||||||
|
"arm64": {
|
||||||
|
"binary_url": "https://bitcoincore.org/bin/bitcoin-core-23.0/bitcoin-23.0-aarch64-linux-gnu.tar.gz",
|
||||||
|
"verification_source": "06f4c78271a77752ba5990d60d81b1751507f77efda1e5981b4e92fd4d9969fb"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"blockbook": {
|
"blockbook": {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user