| career | drupal | java | mac | mysql | perl | scala | uml | unix  

Akka/Scala example source code file (

This example Akka source code file ( is included in my "Source Code Warehouse" project. The intent of this project is to help you more easily find Akka and Scala source code examples by using tags.

All credit for the original source code belongs to; I'm just trying to make examples easier to find. (For my Scala work, see my Scala examples and tutorials.)

Akka tags/keywords

a, bash_source, check, eom, p, password, print, that, the, user

The Akka example source code

#!/usr/bin/env bash
# Publishes released sample zip files to Typesafe Activator.
# The zip files must have been uploaded to 
# before using this script.
# That is done by the release script.

# get the source location for this script; handles symlinks
function get_script_path {
  local source="${BASH_SOURCE[0]}"
  while [ -h "${source}" ] ; do
    source="$(readlink "${source}")";
  echo ${source}

# path, name, and dir for this script
declare -r script_path=$(get_script_path)
declare -r script_name=$(basename "${script_path}")
declare -r script_dir="$(cd -P "$(dirname "${script_path}")" && pwd)"

# echo a log message
function echolog {
  echo "[${script_name}] $@"

# echo an error message
function echoerr {
  echo "[${script_name}] $@" 1>&2

# fail the script with an error message
function fail {
  echoerr "$@"
  exit 1

# extract uuid property from json and show url of the status page
function logStatusUrl {
  local prop="uuid"
  local temp=`echo $json | sed 's/\\\\\//\//g' | sed 's/[{}]//g' | awk -v k="text" '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]}' | sed 's/\"\:\"/\|/g' | sed 's/[\,]/ /g' | sed 's/\"//g' | grep -w $prop`
  echolog "Check status of $name at:${temp##*|}"

# print usage info
function usage {
  cat <<EOM
Usage: ${script_name} [options] VERSION
  -h | --help               Print this usage message
  -u | --user USER user name
  -p | --password PASSWORD user password

# process options and set flags
while true; do
  case "$1" in
    -h | --help ) usage; exit 1 ;;
    -u | --user ) user=$2; shift 2 ;;
    -p | --password ) pwd=$2; shift 2 ;;
    * ) break ;;

if [ $# != "1" ]; then
  fail "A release version must be specified"

if [ -z "$user" ]; then
  fail "user must be specified"

if [ -z "$pwd" ]; then
  fail "password must be specified"

declare -r version=$1

# check for a curl command
type -P curl &> /dev/null || fail "curl command not found"

names=`find akka-samples -name "" -depth 2 | awk -F"/" '{printf "%s\n",$2}'`

for name in $names; do
  echolog "Publishing $name"
  json=$(curl --data-urlencode "url=$name-$" --user "$user:$pwd" --progress-bar

Other Akka source code examples

Here is a short list of links related to this Akka source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller


new blog posts


Copyright 1998-2021 Alvin Alexander,
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.