Documentation ¶
Index ¶
- func ActivateRepositories(db *sql.DB, client drone.Client) error
- func DumpTokens(source *sql.DB, w io.Writer) error
- func MigrateBuilds(source, target *sql.DB) error
- func MigrateLogs(source, target *sql.DB) error
- func MigrateLogsS3(source *sql.DB, bucket, prefix string, resume int64) error
- func MigrateRegistries(source, target *sql.DB) error
- func MigrateRepos(source, target *sql.DB) error
- func MigrateSecrets(source, target *sql.DB) error
- func MigrateStages(source, target *sql.DB) error
- func MigrateSteps(source, target *sql.DB) error
- func MigrateUsers(source, target *sql.DB) error
- func RemoveNotFound(db *sql.DB, client *scm.Client) error
- func RemoveRenamed(db *sql.DB, client *scm.Client) error
- func UpdateRepoIdentifiers(db *sql.DB, client *scm.Client) error
- type AuthConfig
- type BuildV0
- type BuildV1
- type DockerConfig
- type LogsV0
- type LogsV1
- type RegistryV0
- type RepoV0
- type RepoV1
- type SecretV0
- type SecretV1
- type StageV0
- type StageV1
- type StepV0
- type StepV1
- type UserV0
- type UserV1
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ActivateRepositories ¶
ActivateRepositories re-activates the repositories. This will create new webhooks and populate any empty values (security keys, etc).
func DumpTokens ¶ added in v1.1.0
DumpTokens dumps the database tokens from the V0 database to io.Writer w in JSON format.
func MigrateBuilds ¶
MigrateBuilds migrates the builds from the V0 database to the V1 database.
func MigrateLogs ¶
MigrateLogs migrates the steps from the V0 database to the V1 database.
func MigrateLogsS3 ¶ added in v1.0.4
MigrateLogsS3 migrates the steps from the V0 database to S3.
func MigrateRegistries ¶
MigrateRegistries migrates the registry crendeitals from the V0 database to the V1 database.
func MigrateRepos ¶
MigrateRepos migrates the repositories from the V0 database to the V1 database.
func MigrateSecrets ¶
MigrateSecrets migrates the secrets V0 database to the V1 database.
func MigrateStages ¶
MigrateStages migrates the stages from the V0 database to the V1 database.
func MigrateSteps ¶
MigrateSteps migrates the steps from the V0 database to the V1 database.
func MigrateUsers ¶
MigrateUsers migrates the user accounts from the V0 database to the V1 database.
func RemoveNotFound ¶ added in v1.2.0
RemoveNotFound removes repositories that are not found in the remote system.
func RemoveRenamed ¶ added in v1.2.0
RemoveRenamed removes repositories that have been renamed or cannot be found in the remote system.
Types ¶
type AuthConfig ¶
type AuthConfig struct { Email string `json:"email,omitempty"` Username string `json:"username,omitempty"` Password string `json:"password,omitempty"` Auth string `json:"auth,omitempty"` }
AuthConfig contains authorization information for connecting to a Registry.
func (AuthConfig) MarshalJSON ¶
func (c AuthConfig) MarshalJSON() ([]byte, error)
type BuildV0 ¶
type BuildV0 struct { ID int64 `meddler:"build_id"` RepoID int64 `meddler:"build_repo_id"` ConfigID int64 `meddler:"build_config_id"` Number int64 `meddler:"build_number"` Parent int64 `meddler:"build_parent"` Event string `meddler:"build_event"` Status string `meddler:"build_status"` Error string `meddler:"build_error"` Enqueued int64 `meddler:"build_enqueued"` Created int64 `meddler:"build_created"` Started int64 `meddler:"build_started"` Finished int64 `meddler:"build_finished"` Deploy string `meddler:"build_deploy"` Commit string `meddler:"build_commit"` Branch string `meddler:"build_branch"` Ref string `meddler:"build_ref"` Refspec string `meddler:"build_refspec"` Remote string `meddler:"build_remote"` Title string `meddler:"build_title"` Message string `meddler:"build_message"` Timestamp int64 `meddler:"build_timestamp"` Sender string `meddler:"build_sender"` Author string `meddler:"build_author"` Avatar string `meddler:"build_avatar"` Email string `meddler:"build_email"` Link string `meddler:"build_link"` Signed bool `meddler:"build_signed"` // deprecate Verified bool `meddler:"build_verified"` // deprecate Reviewer string `meddler:"build_reviewer"` Reviewed int64 `meddler:"build_reviewed"` }
BuildV0 is a Drone 0.x build.
type BuildV1 ¶
type BuildV1 struct { ID int64 `meddler:"build_id"` RepoID int64 `meddler:"build_repo_id"` Trigger string `meddler:"build_trigger"` Number int64 `meddler:"build_number"` Parent int64 `meddler:"build_parent"` Status string `meddler:"build_status"` Error string `meddler:"build_error"` Event string `meddler:"build_event"` Action string `meddler:"build_action"` Link string `meddler:"build_link"` Timestamp int64 `meddler:"build_timestamp"` Title string `meddler:"build_title"` Message string `meddler:"build_message"` Before string `meddler:"build_before"` After string `meddler:"build_after"` Ref string `meddler:"build_ref"` Fork string `meddler:"build_source_repo"` Source string `meddler:"build_source"` Target string `meddler:"build_target"` Author string `meddler:"build_author"` AuthorName string `meddler:"build_author_name"` AuthorEmail string `meddler:"build_author_email"` AuthorAvatar string `meddler:"build_author_avatar"` Sender string `meddler:"build_sender"` Params map[string]string `meddler:"build_params,json"` Deploy string `meddler:"build_deploy"` Started int64 `meddler:"build_started"` Finished int64 `meddler:"build_finished"` Created int64 `meddler:"build_created"` Updated int64 `meddler:"build_updated"` Version int64 `meddler:"build_version"` }
BuildV1 is a Drone 1.x build.
type DockerConfig ¶
type DockerConfig struct {
AuthConfigs map[string]AuthConfig `json:"auths"`
}
DockerConfig defines required attributes from Docker registry credentials.
type LogsV0 ¶
type LogsV0 struct { ID int64 `meddler:"log_id"` ProcID int64 `meddler:"log_job_id"` Data []byte `meddler:"log_data"` }
LogsV0 is a Drone 0.x logs.
type RegistryV0 ¶
type RegistryV0 struct { ID int64 `meddler:"registry_id"` RepoID int64 `meddler:"registry_repo_id"` RepoFullname string `meddler:"repo_full_name"` Addr string `meddler:"registry_addr"` Email string `meddler:"registry_email"` Username string `meddler:"registry_username"` Password string `meddler:"registry_password"` Token string `meddler:"registry_token"` }
RegistryV0 is a Drone 0.x registry.
type RepoV0 ¶
type RepoV0 struct { ID int64 `meddler:"repo_id"` UserID int64 `meddler:"repo_user_id"` Owner string `meddler:"repo_owner"` Name string `meddler:"repo_name"` FullName string `meddler:"repo_full_name"` Avatar string `meddler:"repo_avatar"` Link string `meddler:"repo_link"` Kind string `meddler:"repo_scm"` Clone string `meddler:"repo_clone"` Branch string `meddler:"repo_branch"` Timeout int64 `meddler:"repo_timeout"` Visibility string `meddler:"repo_visibility"` IsPrivate bool `meddler:"repo_private"` IsTrusted bool `meddler:"repo_trusted"` IsGated bool `meddler:"repo_gated"` IsActive bool `meddler:"repo_active"` AllowPull bool `meddler:"repo_allow_pr"` AllowPush bool `meddler:"repo_allow_push"` AllowDeploy bool `meddler:"repo_allow_deploys"` AllowTag bool `meddler:"repo_allow_tags"` Counter int `meddler:"repo_counter"` Config string `meddler:"repo_config_path"` Hash string `meddler:"repo_hash"` }
RepoV0 is a Drone 0.x repository.
type RepoV1 ¶
type RepoV1 struct { ID int64 `meddler:"repo_id"` UID string `meddler:"repo_uid"` UserID int64 `meddler:"repo_user_id"` Namespace string `meddler:"repo_namespace"` Name string `meddler:"repo_name"` Slug string `meddler:"repo_slug"` SCM string `meddler:"repo_scm"` HTTPURL string `meddler:"repo_clone_url"` SSHURL string `meddler:"repo_ssh_url"` Link string `meddler:"repo_html_url"` Branch string `meddler:"repo_branch"` Private bool `meddler:"repo_private"` Visibility string `meddler:"repo_visibility"` Active bool `meddler:"repo_active"` Config string `meddler:"repo_config"` Trusted bool `meddler:"repo_trusted"` Protected bool `meddler:"repo_protected"` IgnoreForks bool `meddler:"repo_no_forks"` IgnorePulls bool `meddler:"repo_no_pulls"` Timeout int64 `meddler:"repo_timeout"` Counter int64 `meddler:"repo_counter"` Synced int64 `meddler:"repo_synced"` Created int64 `meddler:"repo_created"` Updated int64 `meddler:"repo_updated"` Version int64 `meddler:"repo_version"` Signer string `meddler:"repo_signer"` Secret string `meddler:"repo_secret"` }
RepoV1 is a Drone 1.x repository.
type SecretV0 ¶
type SecretV0 struct { ID int64 `meddler:"secret_id"` RepoID int64 `meddler:"secret_repo_id"` Name string `meddler:"secret_name"` Value string `meddler:"secret_value"` Images string `meddler:"secret_images"` Events []string `meddler:"secret_events,json"` SkipVerify bool `meddler:"secret_skip_verify"` Conceal bool `meddler:"secret_conceal"` }
SecretV0 is a Drone 0.x secret.
type SecretV1 ¶
type SecretV1 struct { ID int64 `meddler:"secret_id"` RepoID int64 `meddler:"secret_repo_id"` Name string `meddler:"secret_name"` Data string `meddler:"secret_data"` PullRequest bool `meddler:"secret_pull_request"` PullRequestPush bool `meddler:"secret_pull_request_push"` }
SecretV1 is a Drone 1.x secret.
type StageV0 ¶
type StageV0 struct { ID int64 `meddler:"proc_id"` BuildID int64 `meddler:"proc_build_id"` PID int `meddler:"proc_pid"` PPID int `meddler:"proc_ppid"` PGID int `meddler:"proc_pgid"` Name string `meddler:"proc_name"` State string `meddler:"proc_state"` Error string `meddler:"proc_error"` ExitCode int `meddler:"proc_exit_code"` Started int64 `meddler:"proc_started"` Stopped int64 `meddler:"proc_stopped"` Machine string `meddler:"proc_machine"` Platform string `meddler:"proc_platform"` Environ map[string]string `meddler:"proc_environ,json"` }
StageV0 is a Drone 0.x stage.
type StageV1 ¶
type StageV1 struct { ID int64 `meddler:"stage_id"` RepoID int64 `meddler:"stage_repo_id"` BuildID int64 `meddler:"stage_build_id"` Number int `meddler:"stage_number"` Name string `meddler:"stage_name"` Kind string `meddler:"stage_kind"` Type string `meddler:"stage_type"` Status string `meddler:"stage_status"` Error string `meddler:"stage_error"` ErrIgnore bool `meddler:"stage_errignore"` ExitCode int `meddler:"stage_exit_code"` Machine string `meddler:"stage_machine"` OS string `meddler:"stage_os"` Arch string `meddler:"stage_arch"` Variant string `meddler:"stage_variant"` Kernel string `meddler:"stage_kernel"` Limit int `meddler:"stage_limit"` Started int64 `meddler:"stage_started"` Stopped int64 `meddler:"stage_stopped"` Created int64 `meddler:"stage_created"` Updated int64 `meddler:"stage_updated"` Version int64 `meddler:"stage_version"` OnSuccess bool `meddler:"stage_on_success"` OnFailure bool `meddler:"stage_on_failure"` DependsOn []string `meddler:"stage_depends_on,json"` Labels map[string]string `meddler:"stage_labels,json"` }
StageV1 is a Drone 1.x stage.
type StepV0 ¶
type StepV0 struct { ID int64 `meddler:"proc_id"` BuildID int64 `meddler:"proc_build_id"` PID int `meddler:"proc_pid"` PPID int `meddler:"proc_ppid"` PGID int `meddler:"proc_pgid"` Name string `meddler:"proc_name"` State string `meddler:"proc_state"` Error string `meddler:"proc_error"` ExitCode int `meddler:"proc_exit_code"` Started int64 `meddler:"proc_started"` Stopped int64 `meddler:"proc_stopped"` Machine string `meddler:"proc_machine"` Platform string `meddler:"proc_platform"` Environ map[string]string `meddler:"proc_environ,json"` }
StepV0 is a Drone 0.x step.
type StepV1 ¶
type StepV1 struct { ID int64 `meddler:"step_id"` StageID int64 `meddler:"step_stage_id"` Number int `meddler:"step_number"` Name string `meddler:"step_name"` Status string `meddler:"step_status"` Error string `meddler:"step_error"` ErrIgnore bool `meddler:"step_errignore"` ExitCode int `meddler:"step_exit_code"` Started int64 `meddler:"step_started"` Stopped int64 `meddler:"step_stopped"` Version int64 `meddler:"step_version"` }
StepV1 is a Drone 1.x step.
type UserV0 ¶
type UserV0 struct { ID int64 `meddler:"user_id"` Login string `meddler:"user_login"` Token string `meddler:"user_token"` Secret string `meddler:"user_secret"` Expiry int64 `meddler:"user_expiry"` Email string `meddler:"user_email"` Avatar string `meddler:"user_avatar"` Active bool `meddler:"user_active"` Admin bool `meddler:"user_admin"` Synced int64 `meddler:"user_synced"` Hash string `meddler:"user_hash"` }
UserV0 is a Drone 0.x user.
type UserV1 ¶
type UserV1 struct { ID int64 `meddler:"user_id"` Login string `meddler:"user_login"` Email string `meddler:"user_email"` Machine bool `meddler:"user_machine"` Admin bool `meddler:"user_admin"` Active bool `meddler:"user_active"` Avatar string `meddler:"user_avatar"` Syncing bool `meddler:"user_syncing"` Synced int64 `meddler:"user_synced"` Created int64 `meddler:"user_created"` Updated int64 `meddler:"user_updated"` LastLogin int64 `meddler:"user_last_login"` Token string `meddler:"user_oauth_token"` Refresh string `meddler:"user_oauth_refresh"` Expiry int64 `meddler:"user_oauth_expiry"` Hash string `meddler:"user_hash"` }
UserV1 is a Drone 1.x user.