class Object

Public Instance Methods

_write(fullpath, content) click to toggle source
# File lib/citasks/ci_lib.rb, line 7
def _write fullpath, content
  File.open fullpath, "w" do |fh|
    fh.puts content
  end
end
git_repo_url() click to toggle source
# File lib/citasks.rb, line 100
def git_repo_url
  sprintf("%s/%s/%s.git",ENV["GITLAB_BASE_URL"], ENV["GITLAB_USER"], ENV["REPO_NAME"])
end
git_repo_url_in_cluster() click to toggle source
# File lib/citasks.rb, line 56
def git_repo_url_in_cluster
  sprintf("%s/%s/%s.git",ENV["GITLAB_IN_CLUSTER_BASE_URL"], ENV["GITLAB_USER"], ENV["REPO_NAME"])
end
next_task_index() click to toggle source
# File lib/citasks/task_index.rb, line 2
def next_task_index
  @task_index += 1
  sprintf("%02d", @task_index)
end
token_shared_persistently() click to toggle source
# File lib/citasks/ci_lib.rb, line 13
def token_shared_persistently
  #create a shared token across tasks
  secret_token_file = ".token"
  if File.exists? secret_token_file
    token = File.read(secret_token_file).chomp
  else
    token = SecureRandom.uuid
    File.open secret_token_file, "w" do |fh|
      fh.puts token
    end
  end
  token
end