Esempio n. 1
0
 def __call__(self):
     self._print_compliance()
     payload = {
         "sha256": self.fingerprint.sha,
         "filename": self.fingerprint.artifact_basename,
         "description": f"Created by build {self.ci_build_number.value}",
         "git_commit": self.artifact_git_commit.value,
         "commit_url": self.artifact_git_url.value,
         "build_url": self.ci_build_url.value,
         "is_compliant": self.is_compliant.value == 'TRUE',
         "user_data": self.user_data.value
     }
     url = ApiSchema.url_for_artifacts(self.host.value, self.merkelypipe)
     http_put_payload(url, payload, self.api_token.value)
     return 'Putting', url, payload
Esempio n. 2
0
def create_artifact(api_token, host, project_config_file,
                    sha256, filename, description, git_commit, commit_url, build_url,
                    is_compliant):
    project_data = load_project_configuration(project_config_file)

    create_artifact_payload = {
        "sha256": sha256,
        "filename": filename,
        "description": description,
        "git_commit": git_commit,
        "commit_url": commit_url,
        "build_url": build_url,
        "is_compliant": is_compliant
    }
    url = ApiSchema.url_for_artifacts(host, project_data)
    http_put_payload(url, create_artifact_payload, api_token)