| 1 |
#!/bin/zsh |
| 2 |
# -*- coding: utf-8; tab-width: 2; indent-tabs-mode: nil; sh-basic-offset: 2; sh-indentation: 2; -*- vim:fenc=utf-8:et:sw=2:ts=2:sts=2 |
| 3 |
# |
| 4 |
# Copyright (C) 2016 Enrico M. Crisostomo |
| 5 |
# |
| 6 |
# This program is free software; you can redistribute it and/or modify |
| 7 |
# it under the terms of the GNU General Public License as published by |
| 8 |
# the Free Software Foundation; either version 3, or (at your option) |
| 9 |
# any later version. |
| 10 |
# |
| 11 |
# This program is distributed in the hope that it will be useful, |
| 12 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 |
# GNU General Public License for more details. |
| 15 |
# |
| 16 |
# You should have received a copy of the GNU General Public License |
| 17 |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 18 |
# |
| 19 |
setopt local_options |
| 20 |
setopt local_traps |
| 21 |
unsetopt glob_subst |
| 22 |
|
| 23 |
SCRIPT_HOME=${0:h} |
| 24 |
|
| 25 |
for i in ${SCRIPT_HOME}/*/ |
| 26 |
do |
| 27 |
TAG=${i:t} |
| 28 |
[[ ${TAG} =~ ^[a-zA-Z0-9._-]+(/[a-zA-Z0-9._-]+)*$ ]] || |
| 29 |
{ |
| 30 |
>&2 print -- Invalid tag ${TAG}. Skipping. |
| 31 |
continue |
| 32 |
} |
| 33 |
docker build -t fswatch:${TAG} ${i} |
| 34 |
done |