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

workdir="${GITHUB_WORKSPACE}/build"
docker_files=$(find "${workdir}/" -name "bareos-*.tar" 2>/dev/null)

# Enable experimental feature in Docker
export DOCKER_CLI_EXPERIMENTAL="enabled"

# Load Dockerfiles
echo ::group::Load Dockerfile
echo "${docker_files}"
for file in $docker_files; do
  docker load --input "$file"
done
echo ::endgroup::

# Connect Docker Hub
docker login -u 'barcus' -p "${INPUT_DOCKER_PASS}"

# Push tags and manfiests
echo ::group::Push build tags
while read line ; do
  app=$(echo $line|awk '{print $1}')
  version=$(echo $line|awk '{print $2}')
  arch=$(echo $line|awk '{print $3}')
  build_tag=${version}
  re='^[0-9]+-alpine.*$'
  if [[ $version =~ $re ]] ; then
    build_tag="${version}-${arch}"
    rm_tag="$rm_tag ${GITHUB_REPOSITORY}-${app}:${build_tag}"
  fi
  # Push build tags
  docker push "${GITHUB_REPOSITORY}-${app}:${build_tag}"
done < "${workdir}/app_build.txt"
echo ::endgroup::

echo ::group::Push additional tags
while read build_app s_tag t_tag ; do
  # Push additional tags for Ubuntu 
  if [[ $s_tag =~ ^[0-9]+-ubuntu.*$ ]]; then
    docker tag "${GITHUB_REPOSITORY}-${build_app}:${s_tag}" \
      "${GITHUB_REPOSITORY}-${build_app}:${t_tag}"
    docker push "${GITHUB_REPOSITORY}-${build_app}:${t_tag}"
  fi
  # Create and push manifest for Alpine (arm64 + amd64)
  if [[ $s_tag =~ ^[0-9]+-alpine.*$ ]]; then
    docker manifest create "${GITHUB_REPOSITORY}-${build_app}:${t_tag}" \
      "${GITHUB_REPOSITORY}-${build_app}:${s_tag}-amd64" \
      "${GITHUB_REPOSITORY}-${build_app}:${s_tag}-arm64"
    docker manifest push "${GITHUB_REPOSITORY}-${build_app}:${t_tag}"
  fi<commit_msg>fix docker push for nightly build<commit_after>#!/usr/bin/env bash

workdir="${GITHUB_WORKSPACE}/build"
docker_files=$(find "${workdir}/" -name "bareos-*.tar" 2>/dev/null)

# Enable experimental feature in Docker
export DOCKER_CLI_EXPERIMENTAL="enabled"

# Load Dockerfiles
echo ::group::Load Dockerfile
echo "${docker_files}"
for file in $docker_files; do
  docker load --input "$file"
done
echo ::endgroup::

# Connect Docker Hub
docker login -u 'barcus' -p "${INPUT_DOCKER_PASS}"

# Push tags and manfiests
echo ::group::Push build tags
while read line ; do
  app=$(echo $line|awk '{print $1}')
  version=$(echo $line|awk '{print $2}')
  arch=$(echo $line|awk '{print $3}')
  build_tag=${version}
  re='^[0-9]+-alpine.*$'
  if [[ $version =~ $re ]] ; then
    build_tag="${version}-${arch}"
    rm_tag="$rm_tag ${GITHUB_REPOSITORY}-${app}:${build_tag}"
  fi
  # Push build tags
  docker push "${GITHUB_REPOSITORY}-${app}:${build_tag}"
done < "${workdir}/app_build.txt"
echo ::endgroup::

echo ::group::Push additional tags
while read build_app s_tag t_tag ; do
  # Push additional tags for Ubuntu 
  if [[ $s_tag =~ ^[a-z0-9]+-ubuntu.*$ ]]; then
    docker tag "${GITHUB_REPOSITORY}-${build_app}:${s_tag}" \
      "${GITHUB_REPOSITORY}-${build_app}:${t_tag}"
    docker push "${GITHUB_REPOSITORY}-${build_app}:${t_tag}"
  fi
  # Create and push manifest for Alpine (arm64 + amd64)
  if [[ $s_tag =~ ^[a-z0-9]+-alpine.*$ ]]; then
    docker manifest create "${GITHUB_REPOSITORY}-${build_app}:${t_tag}" \
      "${GITHUB_REPOSITORY}-${build_app}:${s_tag}-amd64" \
      "${GITHUB_REPOSITORY}-${build_app}:${s_tag}-arm64"
    docker manifest push "${GITHUB_REPOSITORY}-${build_app}:${t_tag}"
  fi
{'fraction_non_alphanumeric': 0.19310754604872252, 'fraction_numerical': 0.0106951871657754, 'mean_word_length': 4.9070175438596495, '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': '1756', 'n_tokens_mistral': 1332, 'n_tokens_neox': 1266, 'n_words': 278}