Skip to content

Commit

Permalink
Helper script to build and tag the OSCAL env
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitawootten-nist authored and aj-stein-nist committed Apr 19, 2023
1 parent 32d474f commit 720012c
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions build/build-oscal-env-dockerfile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash
# Build and tag the oscal-common-env dockerfile
#
# By default the tag is the sanitized branch name, but can be overidden
# by an argument.

set -Eeuo pipefail

IMAGE="csd773/oscal-common-env"
BRANCH=$(git branch --show-current)
BRANCH_SANITIZED=${BRANCH/\//_}

TAG="${1:-$BRANCH_SANITIZED}"

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)"

docker build \
-f "$SCRIPT_DIR/Dockerfile" \
-t "$IMAGE:$TAG" \
"$SCRIPT_DIR"

echo "Built and tagged $IMAGE:$TAG, to push run:"
echo " docker push $IMAGE:$TAG"

0 comments on commit 720012c

Please sign in to comment.