-
Notifications
You must be signed in to change notification settings - Fork 18
/
publish-docker-image.sh
executable file
·54 lines (49 loc) · 1.98 KB
/
publish-docker-image.sh
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
#!/bin/bash -e
quality_gem_version=$(gem search quality | grep ^'quality ' | cut -d'(' -f2 | cut -d')' -f1)
quality_gem_major_version=$(echo "${quality_gem_version:?}" | cut -d '.' -f1)
quality_gem_minor_version=$(echo "${quality_gem_version:?}" | cut -d '.' -f1-2)
docker build \
-t "apiology/quality:${quality_gem_version:?}" \
-t "apiology/quality:${quality_gem_minor_version:?}" \
-t "apiology/quality:${quality_gem_major_version:?}" \
-t apiology/quality:latest \
--build-arg quality_gem_version="${quality_gem_version:?}" \
--target latest \
--progress plain \
--pull \
.
docker build \
-t "apiology/quality:python-${quality_gem_version:?}" \
-t "apiology/quality:python-${quality_gem_minor_version:?}" \
-t "apiology/quality:python-${quality_gem_major_version:?}" \
-t apiology/quality:python-latest \
--build-arg quality_gem_version="${quality_gem_version:?}" \
--target python \
--progress plain \
--pull \
.
docker build \
-t "apiology/quality:shellcheck-${quality_gem_version:?}" \
-t "apiology/quality:shellcheck-${quality_gem_minor_version:?}" \
-t "apiology/quality:shellcheck-${quality_gem_major_version:?}" \
-t apiology/quality:shellcheck-latest \
--build-arg quality_gem_version="${quality_gem_version:?}" \
--target shellcheck \
--progress plain \
--pull \
.
for tag in ${quality_gem_version:?} \
${quality_gem_minor_version:?} \
${quality_gem_major_version:?} \
latest \
python-${quality_gem_version:?} \
python-${quality_gem_minor_version:?} \
python-${quality_gem_major_version:?} \
python-latest \
shellcheck-${quality_gem_version:?} \
shellcheck-${quality_gem_minor_version:?} \
shellcheck-${quality_gem_major_version:?} \
shellcheck-latest
do
docker push "apiology/quality:${tag:?}"
done