forked from WASdev/ci.docker.websphere-traditional
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpush_all
executable file
·57 lines (51 loc) · 2.1 KB
/
push_all
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
#
###########################################################################
# (C) Copyright IBM Corporation 2016. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# you may not use this file except in compliance with the License. #
# You may obtain a copy of the License at #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
# distributed under the License is distributed on an "AS IS" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.#
# See the License for the specific language governing permissions and #
# limitations under the License. #
###########################################################################
if [ $# != 1 ]; then
echo "Usage: push_all <[repository:port/]namespace>"
exit 1
fi
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
NAMESPACE=$1
push()
{
from_name=$1
to_name=$2
echo "*** Pushing $from_name to $to_name ***"
docker tag $from_name $to_name
docker push $to_name
docker rmi $to_name
}
push_to_namespace()
{
from_name=$1
namespace=$2
to_name="$namespace/$from_name"
push $from_name $to_name
}
while read line; do
if [[ $line == \#* ]]; then continue; fi
version=$(cut -d, -f1 <<< $line)
prefix="websphere-traditional:${version}-"
for suffix in "install" "profile"; do
name="${prefix}${suffix}"
push_to_namespace $name $NAMESPACE
done
done < $DIR/versions.csv
push "websphere-traditional:${version}-install" "$NAMESPACE/websphere-traditional:install"
push "websphere-traditional:${version}-profile" "$NAMESPACE/websphere-traditional:profile"
push "websphere-traditional:${version}-profile" "$NAMESPACE/websphere-traditional:latest"