FIx code review

This commit is contained in:
Jasder
2020-08-26 16:24:51 +08:00
parent 518e966a87
commit 2866c060c7
3 changed files with 10 additions and 4 deletions

View File

@@ -3,5 +3,8 @@ class Ci::RemoteBase < ApplicationRecord
establish_connection Rails.configuration.database_configuration[Rails.env]["ci_server_db"]
def generate_code
[*'a'..'z',*'0'..'9',*'A'..'Z'].sample(32).join
end
end

View File

@@ -16,11 +16,13 @@ class Ci::Repo < Ci::RemoteBase
[user, repo]
end
def enable
def config_trustie_pipeline
update_column(:repo_config, '.trustie-pipeline.yml')
end
def activate
# repo_active、repo_signer、repo_secret、repo_updated
update_columns(repo_active: 1, repo_signer: generate_code, repo_secret: generate_code, repo_updated: Time.now.to_i)
end
end