PlaceOS::Api
Constants
ALLOWED_FAILED_ATTEMPTS = (ENV["ALLOWED_FAILED_ATTEMPTS"]? || 2).to_i
API_VERSION = "v1"
APP_NAME = "build-api"
AWS_KEY = ENV["AWS_KEY"]?.presence || (abort("AWS_KEY not in environment"))
AWS_REGION = ENV["AWS_REGION"]?.presence || (abort("AWS_REGION not in environment"))
AWS_S3_BUCKET = ENV["AWS_S3_BUCKET"]?.presence || (abort("AWS_S3_BUCKET not in environment"))
AWS_S3_ENDPOINT = ENV["AWS_S3_ENDPOINT"]?
AWS_S3_LINK_EXPIRY = ENV["AWS_S3_LINK_EXPIRY"]?.try do |__arg0| __arg0.to_i.minutes end || 5.minutes
AWS_SECRET = ENV["AWS_SECRET"]?.presence || (abort("AWS_SECRET not in environment"))
BUILD_COMMIT = {{ (env("PLACE_COMMIT")) || "DEV" }}
BUILD_TIME = {{ (system("date -u")).stringify }}
COOKIE_SESSION_KEY = ENV["COOKIE_SESSION_KEY"]? || "_spider_gazelle_"
COOKIE_SESSION_SECRET = ENV["COOKIE_SESSION_SECRET"]? || TOTP_SECRET
DATABASE = "build.db"
DEFAULT_HOST = ENV["SG_SERVER_HOST"]? || "127.0.0.1"
DEFAULT_PORT = (ENV["SG_SERVER_PORT"]? || 3000).to_i
DEFAULT_PROCESS_COUNT = (ENV["SG_PROCESS_COUNT"]? || 1).to_i
DEFAULT_TIMEOUT = (ENV["TIMEOUT"]? || 300).to_i
ENVIRONMENT = ENV["SG_ENV"]? || "development"
IS_PRODUCTION = ENVIRONMENT == "production"
Log = ::Log.for(self)
LOG_STDOUT = ActionController.default_backend
LOGSTASH_HOST = ENV["LOGSTASH_HOST"]?
LOGSTASH_PORT = ENV["LOGSTASH_PORT"]?
PARALELL_JOBS = (ENV["PARALELL_JOBS"]? || 1).to_i
RECOMPILE_PREFIX = "RECOMPILE-"
TOTP_SECRET = ENV["TOTP_SECRET"]? || (TOTP.generate_base32_secret(32))
security
VERSION = {{ (system("shards version \"/tmp/tmp.OjohJP/src/src\"")).chomp.stringify.downcase }}
Class methods
add_job(task)
Sourceadd_task(repository : String, branch : String, source_file : String, arch : String, commit : String, username : String | Nil = nil, password : String | Nil = nil, force = false) : TaskStatus
Sourcearch
Sourceattempts(checksum, status)
Sourcebuild_driver(repository : String, branch : String, source_file : String, arch : String, commit : String | Nil = nil, username : String | Nil = nil, password : String | Nil = nil)
Sourcecancel_task(task_id : String)
Sourcecheck_db
Sourcechecksum(repository, source_file, branch, commit, arch)
Sourcecompiler
Sourceconnection
Sourceexecutable_name(repo_uri, branch, driver_source, arch, commit)
Generate driver binary name for S3
get_incomplete_tasks
Sourceget_job_queue(state : State = State::Pending)
Sourceget_last_result(csum)
Sourceget_status(id)
Sourcejob_exists?(csum)
Sourcelog_backend
Sourceon_start
Sourcerepository(uri : String, branch : String | Nil = nil, username : String | Nil = nil, password : String | Nil = nil)
Sourcerunning?(id : String, pending_only = false)
Sourcerunning_in_production?
Sourcetask_lock
Sourcetask_runner
Sourcetask_status(id : String) : TaskStatus | Nil
Sourceupdate_status(id, checksum, state, msg)
Sourceupdate_status(id, state, msg)
Sourcewith_repository(uri : String, branch : String, source_file : String, commit : String | Nil, username : String | Nil, password : String | Nil, & : Repository -> )
Sourcewith_s3
Source