"Fossies" - the Fresh Open Source Software Archive

Member "cli-1.1259.0/scripts/create-build-image.sh" (30 Nov 2023, 906 Bytes) of package /linux/misc/snyk-cli-1.1259.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/usr/bin/env bash
    2 set -exuo pipefail
    3 # determine script directory
    4 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
    5 NOW=$(date "+%Y%m%d-%H%M%S")
    6 
    7 
    8 pushd "$SCRIPT_DIR/.."
    9   NODEVERSION=$(head -1 .nvmrc)
   10   export NODEVERSION
   11 
   12   docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
   13 
   14   BASE_IMG_NAME=$DOCKER_USERNAME/cli-build
   15   docker buildx build \
   16     --build-arg NODEVERSION="$NODEVERSION" \
   17     --build-arg ARCH="x86_64" \
   18     --platform linux/amd64 \
   19     --tag "$BASE_IMG_NAME":$NOW \
   20     --tag "$BASE_IMG_NAME":latest \
   21     --push \
   22     --file .circleci/Dockerfile .
   23 
   24   BASE_IMG_NAME=$DOCKER_USERNAME/cli-build-arm64
   25   docker buildx build \
   26     --build-arg NODEVERSION="$NODEVERSION" \
   27     --build-arg ARCH="aarch64" \
   28     --platform linux/arm64 \
   29     --tag "$BASE_IMG_NAME":$NOW \
   30     --tag "$BASE_IMG_NAME":latest \
   31     --push \
   32     --file .circleci/Dockerfile .
   33 
   34 popd