module

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)
Source
add_task(repository : String, branch : String, source_file : String, arch : String, commit : String, username : String | Nil = nil, password : String | Nil = nil, force = false) : TaskStatus
Source
arch
Source
attempts(checksum, status)
Source
build_driver(repository : String, branch : String, source_file : String, arch : String, commit : String | Nil = nil, username : String | Nil = nil, password : String | Nil = nil)
Source
cancel_task(task_id : String)
Source
check_db
Source
checksum(repository, source_file, branch, commit, arch)
Source
compiler
Source
connection
Source
executable_name(repo_uri, branch, driver_source, arch, commit)

Generate driver binary name for S3

Source
executable_name(driver_source, arch, commit)

Generate driver binary name

Source
get_incomplete_tasks
Source
get_job_queue(state : State = State::Pending)
Source
get_last_result(csum)
Source
get_status(id)
Source
job_exists?(csum)
Source
log_backend
Source
on_start
Source
repository(uri : String, branch : String | Nil = nil, username : String | Nil = nil, password : String | Nil = nil)
Source
running?(id : String, pending_only = false)
Source
running_in_production?
Source
task_lock
Source
task_runner
Source
task_status(id : String) : TaskStatus | Nil
Source
update_status(id, checksum, state, msg)
Source
update_status(id, state, msg)
Source
with_repository(uri : String, branch : String, source_file : String, commit : String | Nil, username : String | Nil, password : String | Nil, & : Repository -> )
Source
with_s3
Source

Nested types