<commit_before>#!/bin/bash
set -e

scripts="$(dirname "$0")"

docker login -u nanocurrency -p "$DOCKER_PASSWORD"

# We push this just so it can be a cache next time
"$scripts"/custom-timeout.sh 30 docker push nanocurrency/nano-ci

tags=()
if [ -n "$TRAVIS_TAG" ]; then
    tags+=("$TRAVIS_TAG" latest)
elif [ -n "$TRAVIS_BRANCH" ]; then
    tags+=("$TRAVIS_BRANCH")
fi

for network in live beta; do
    if [ "${network}" = 'live' ]; then
        network_tag_suffix=''
    else
        network_tag_suffix="-${network}"
    fi

    docker_image_name="nanocurrency/nano${network_tag_suffix}"

    ci/build-docker-image.sh docker/node/Dockerfile "$docker_image_name" --build-arg NETWORK="${network}"
    for tag in "${tags[@]}"; do
        # Sanitize docker tag
        # https://docs.docker.com/engine/reference/commandline/tag/
        tag="$(printf '%s' "$tag" | tr -c '[a-z][A-Z][0-9]_.-' -)"
        if [ "$tag" != "latest" ]; then
            docker tag "$docker_image_name" "${docker_image_name}:$tag"
        fi
        "$scripts"/custom-timeout.sh 30 docker push "${docker_image_name}:$tag"<commit_msg>Only push nano-ci docker image on master<commit_after>#!/bin/bash
set -e

scripts="$(dirname "$0")"

docker login -u nanocurrency -p "$DOCKER_PASSWORD"

# We push this just so it can be a cache next time
if [ "$TRAVIS_BRANCH" = "master" ]; then
    "$scripts"/custom-timeout.sh 30 docker push nanocurrency/nano-ci
fi

tags=()
if [ -n "$TRAVIS_TAG" ]; then
    tags+=("$TRAVIS_TAG" latest)
elif [ -n "$TRAVIS_BRANCH" ]; then
    tags+=("$TRAVIS_BRANCH")
fi

for network in live beta; do
    if [ "${network}" = 'live' ]; then
        network_tag_suffix=''
    else
        network_tag_suffix="-${network}"
    fi

    docker_image_name="nanocurrency/nano${network_tag_suffix}"

    "$scripts"/custom-timeout.sh 30 docker build --build-arg NETWORK="$network" -f docker/node/Dockerfile -t "$docker_image_name" .
    for tag in "${tags[@]}"; do
        # Sanitize docker tag
        # https://docs.docker.com/engine/reference/commandline/tag/
        tag="$(printf '%s' "$tag" | tr -c '[a-z][A-Z][0-9]_.-' -)"
        if [ "$tag" != "latest" ]; then
            docker tag "$docker_image_name" "${docker_image_name}:$tag"
        fi
        "$scripts"/custom-timeout.sh 30 docker push "${docker_image_name}:$tag"
{'fraction_non_alphanumeric': 0.17062634989200864, 'fraction_numerical': 0.006911447084233261, 'mean_word_length': 3.210909090909091, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '1831993', 'n_tokens_mistral': 857, 'n_tokens_neox': 799, 'n_words': 195}