<commit_before>#!/usr/bin/env bash

set -e

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

if [[ $# -ne 1 ]]; then
    echo "You must set a version number"
    echo "./deploy.sh <packer version>"
    exit 1
fi

version=$1
dockerfile_version=$(grep PACKER_VERSION= ${base}/Dockerfile-light | cut -d= -f2)

if [[ $version != $dockerfile_version ]]; then
    echo "Version mismatch in 'Dockerfile-light'"
    echo "found ${dockerfile_version}, expected ${version}."
    echo "Make sure the versions are correct."
    exit 1
fi

echo "Building docker images for packer ${version}..."
docker build -f "${base}/Dockerfile-full" -t hashicorp/packer:full .
docker build -f "${base}/Dockerfile-light" -t hashicorp/packer:light .
docker tag hashicorp/packer:light hashicorp/packer:${version}
docker tag hashicorp/packer:light hashicorp/packer:latest

echo "Uploading docker images for packer ${version}..."
docker push hashicorp/packer:${version}
docker push hashicorp/packer:latest
docker push hashicorp/packer:light
docker push hashicorp/packer:full
<commit_msg>deploy script needs to pull the alpine containers to make sure we're using the most recent layer; otherwise deploy script will build from whatever the latest container is on the system being deployed from.<commit_after>#!/usr/bin/env bash

set -e

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

if [[ $# -ne 1 ]]; then
    echo "You must set a version number"
    echo "./deploy.sh <packer version>"
    exit 1
fi

version=$1
dockerfile_version=$(grep PACKER_VERSION= ${base}/Dockerfile-light | cut -d= -f2)

if [[ $version != $dockerfile_version ]]; then
    echo "Version mismatch in 'Dockerfile-light'"
    echo "found ${dockerfile_version}, expected ${version}."
    echo "Make sure the versions are correct."
    exit 1
fi

echo "Updating alpine releases"
docker pull alpine
docker pull golang:alpine

echo "Building docker images for packer ${version}..."
docker build -f "${base}/Dockerfile-full" -t hashicorp/packer:full .
docker build -f "${base}/Dockerfile-light" -t hashicorp/packer:light .
docker tag hashicorp/packer:light hashicorp/packer:${version}
docker tag hashicorp/packer:light hashicorp/packer:latest

echo "Uploading docker images for packer ${version}..."
docker push hashicorp/packer:${version}
docker push hashicorp/packer:latest
docker push hashicorp/packer:light
docker push hashicorp/packer:full

{'fraction_non_alphanumeric': 0.12833333333333333, 'fraction_numerical': 0.005, 'mean_word_length': 4.55787037037037, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2307974', 'n_tokens_mistral': 814, 'n_tokens_neox': 755, 'n_words': 251}