-
Notifications
You must be signed in to change notification settings - Fork 520
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add pipeline tooling for signing tool
- Loading branch information
Showing
4 changed files
with
74 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
version: 0.2 | ||
|
||
phases: | ||
pre_build: | ||
commands: | ||
- environment-report | ||
- write-build-meta | ||
build: | ||
commands: | ||
- sign-tuf-repo | ||
|
||
artifacts: | ||
base-directory: '/tmp/tuf_out' | ||
files: | ||
- '*' | ||
secondary-artifacts: | ||
meta: | ||
base-directory: 'build/meta' | ||
files: | ||
- '*' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# sign-tuf-repo - wrapper for the Rust binary that signs a tuf repo | ||
# | ||
# usage: | ||
# | ||
# sign-tuf-repo | ||
# | ||
|
||
# shellcheck source=../lib/lib.bash | ||
source "${RUNTIME_SCRIPT_LIB:-../lib}/lib.bash" | ||
|
||
# $INPUT_BUILDSYS_ARTIFACTS_VAR comes from CodePipelines and is a reference to a | ||
# CODEBUILD provided variable that points to artifacts. We remap them in | ||
# order to remove references to CodeBuild. | ||
if [[ -z "${INPUT_BUILDSYS_ARTIFACTS}" ]] && [[ -n "${INPUT_BUILDSYS_ARTIFACTS_VAR}" ]]; then | ||
export INPUT_BUILDSYS_ARTIFACTS="${!INPUT_BUILDSYS_ARTIFACTS_VAR}" | ||
fi | ||
|
||
if [[ -z "${INPUT_BUILDSYS_ARTIFACTS}" ]]; then | ||
logger -t ERROR "unable to resolve expected environment variable 'INPUT_BUILDSYS_ARTIFACTS'" | ||
exit 1 | ||
fi | ||
|
||
if [[ -d "${INPUT_BUILDSYS_ARTIFACTS}" ]]; then | ||
logger -t ERROR "provided path to artifacts is not present (provided: ${INPUT_BUILDSYS_ARTIFACTS})" | ||
exit 1 | ||
fi | ||
|
||
|
||
if !update_sign_tuf_repo; then | ||
logger -t ERROR "signing failed" | ||
exit 1 | ||
fi |