Skip to content

Commit 077f0e7

Browse files
committed
Merge branch 'release-3.0.0' into stable
2 parents 85d46f7 + ee9a861 commit 077f0e7

File tree

15 files changed

+83
-84
lines changed

15 files changed

+83
-84
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project follows Zammad versioning.
66

7+
## [3.0.0] - 2019-06-10
8+
### Changed
9+
- Upgrade Zammad version to 3.0.0
10+
11+
### Fixed
12+
- Shellcheck all scripts
13+
714
## [2.9.0] - 2019-02-20
815
### Changed
916
- Upgrade Zammad version to 2.9.0

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
NAME = osixia/zammad
2-
VERSION = 2.9.0
2+
VERSION = 3.0.0
33

44
.PHONY: build build-nocache test tag-latest push push-latest release git-tag-version
55

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
![Docker Stars](https://img.shields.io/docker/stars/osixia/zammad.svg)
55
![](https://images.microbadger.com/badges/image/osixia/zammad.svg)
66

7-
Latest release: 2.9.0 - Zammad 2.9.0 - [Changelog](CHANGELOG.md) | [Docker Hub](https://hub.docker.com/r/osixia/zammad/) 
7+
Latest release: 3.0.0 - Zammad 3.0.0 - [Changelog](CHANGELOG.md) | [Docker Hub](https://hub.docker.com/r/osixia/zammad/) 
88

99
**A docker image to run Zammad.**
1010

example/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ services:
3232
- mariadb:/var/lib/mysql
3333

3434
zammad:
35-
image: osixia/zammad:2.9.0
35+
image: osixia/zammad:3.0.0
3636
command: -l info
3737
labels:
3838
- "io.rancher.container.pull_image: always"

example/kubernetes/zammad-deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ spec:
1515
automountServiceAccountToken: false
1616
containers:
1717
- name: zammad
18-
image: osixia/zammad:2.9.0
18+
image: osixia/zammad:3.0.0
1919
imagePullPolicy: Always
2020
resources:
2121
requests:

image/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ ENV ZAMMAD_DIR /home/zammad
44
ENV ZAMMAD_USER zammad
55
ENV RAILS_ENV production
66

7-
ARG ZAMMAD_VERSION=2.9.0
8-
ARG ZAMMAD_MD5=08bd2f55770f23ee780a7dbd5c8c4cc8
7+
ARG ZAMMAD_VERSION=3.0.0
8+
ARG ZAMMAD_MD5=5170cfc115ee90e853c1180578fc30da
99

1010
ARG GOSU_VERSION=1.10
1111

image/service/backup/assets/tool/zammad-backup

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,27 @@ backupFileSuffix="-zammad.tar.gz"
66
backupDbSuffix="-zammad-db.tar.gz"
77
databaseFile="database.sql"
88

9-
source /container/run/environment.sh
9+
. /container/run/environment.sh
1010

1111
# delete backups that are over $ZAMMAD_BACKUP_TTL days
12-
find $backupPath -type f -mtime +$ZAMMAD_BACKUP_TTL -exec rm {} \;
12+
find "${backupPath}" -type f -mtime +"${ZAMMAD_BACKUP_TTL}" -exec rm {} \;
1313

1414
# date format for the dump file name
1515
dateFileFormat="+%Y%m%dT%H%M%S"
16-
backupFilePath="$backupPath/$(date "$dateFileFormat")$backupFileSuffix"
16+
backupFilePath="${backupPath}/$(date "${dateFileFormat}")${backupFileSuffix}"
1717

1818
# save config and plugins except default ones
19-
tar -czf $backupFilePath -C / ${ZAMMAD_DIR:1}
20-
chmod 600 $backupFilePath
19+
tar -czf "${backupFilePath}" -C / "${ZAMMAD_DIR:1}"
20+
chmod 600 "${backupFilePath}"
2121

2222
# backup database
2323
. /container/service/backup/assets/tool/zammad-get-db-params
24-
rm -rf $databaseFile || true
24+
rm -rf "${databaseFile}" || true
2525

26-
mysqldump -u $databaseUser -p$databasePassword --host $host $database > $databaseFile
26+
mysqldump -u "${databaseUser}" -p"${databasePassword}" --host "${host}" "${database}" > "${databaseFile}"
2727

28-
backupFilePath="$backupPath/$(date "$dateFileFormat")$backupDbSuffix"
29-
tar -czf $backupFilePath $databaseFile
30-
chmod 600 $backupFilePath
28+
backupFilePath="${backupPath}/$(date "${dateFileFormat}")${backupDbSuffix}"
29+
tar -czf "${backupFilePath}" "${databaseFile}"
30+
chmod 600 "${backupFilePath}"
3131

32-
rm -rf $databaseFile
33-
34-
exit 0
32+
rm -rf "${databaseFile}"

image/service/backup/assets/tool/zammad-get-db-params

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# get database name, user and password from configuration
44
# /!\ configuration must use simple quote :)
55
# and it's a bad idea to have ' in your username, password and database name
6-
host="$(grep 'host:' < ${ZAMMAD_DIR}/config/database.yml | sed -e 's/.*host:\(\| \)//g')"
7-
databaseUser="$(grep 'username:' < ${ZAMMAD_DIR}/config/database.yml | sed -e 's/.*username:\(\| \)//g')"
8-
databasePassword="$(grep 'password:' < ${ZAMMAD_DIR}/config/database.yml | sed -e 's/.*password:\(\| \)//g')"
9-
database="$(grep 'database:' < ${ZAMMAD_DIR}/config/database.yml | sed -e 's/.*database:\(\| \) //g')"
6+
host="$(grep 'host:' < "${ZAMMAD_DIR}/config/database.yml" | sed -e 's/.*host:\(\| \)//g')"
7+
databaseUser="$(grep 'username:' < "${ZAMMAD_DIR}/config/database.yml" | sed -e 's/.*username:\(\| \)//g')"
8+
databasePassword="$(grep 'password:' < "${ZAMMAD_DIR}/config/database.yml" | sed -e 's/.*password:\(\| \)//g')"
9+
database="$(grep 'database:' < "${ZAMMAD_DIR}/config/database.yml" | sed -e 's/.*database:\(\| \) //g')"

image/service/backup/assets/tool/zammad-restore

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,26 @@ databaseFile="database.sql"
88

99
for file in "$@"
1010
do
11-
echo "Processing file $file"
12-
13-
if $(echo "$file" | grep -q -e "$backupFileSuffix"); then
11+
echo "Processing file ${file}"
12+
13+
if echo "${file}" | grep -q -e "$backupFileSuffix"; then
1414
echo "Restore zammad files"
15-
tar -xvzf $backupPath/$file -C /
16-
echo "done :)"
17-
elif $(echo "$file" | grep -q -e "$backupDbSuffix"); then
15+
tar -xvzf "${backupPath}/${file}" -C /
16+
echo "done :)"
17+
elif echo "${file}" | grep -q -e "${backupDbSuffix}"; then
1818
echo "Restore zammad database"
1919
. /container/service/backup/assets/tool/zammad-get-db-params
20-
21-
rm -rf $databaseFile || true
22-
tar -xvzf $backupPath/$file
23-
24-
mysql -u $databaseUser -p$databasePassword --host $host $database < $databaseFile
25-
26-
rm -rf $databaseFile
27-
20+
21+
rm -rf "${databaseFile}" || true
22+
tar -xvzf "${backupPath}/${file}"
23+
24+
mysql -u "${databaseUser}" -p"${databasePassword}" --host "${host}" "${database}" < "${databaseFile}"
25+
26+
rm -rf "${databaseFile}"
27+
2828
echo "done :)"
2929
else
30-
echo "Error: Unknown file type"
30+
echo "Error: Unknown file type"
3131
fi
3232
done
3333

image/service/backup/startup.sh

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,18 @@
55
log-helper level eq trace && set -x
66

77
# install image tools
8-
ln -sf ${CONTAINER_SERVICE_DIR}/backup/assets/tool/* /sbin/
8+
ln -sf "${CONTAINER_SERVICE_DIR}"/backup/assets/tool/* /sbin/
99

1010
# add cron jobs
11-
ln -sf ${CONTAINER_SERVICE_DIR}/backup/assets/cronjobs /etc/cron.d/backup
12-
chmod 600 ${CONTAINER_SERVICE_DIR}/backup/assets/cronjobs
11+
ln -sf "${CONTAINER_SERVICE_DIR}/backup/assets/cronjobs" /etc/cron.d/backup
12+
chmod 600 "${CONTAINER_SERVICE_DIR}/backup/assets/cronjobs"
1313

1414
FIRST_START_DONE="${CONTAINER_STATE_DIR}/docker-backup-backup-first-start-done"
1515
# container first start
16-
if [ ! -e "$FIRST_START_DONE" ]; then
17-
18-
# adapt cronjobs file
19-
sed -i "s|{{ ZAMMAD_BACKUP_CRON_EXP }}|${ZAMMAD_BACKUP_CRON_EXP}|g" ${CONTAINER_SERVICE_DIR}/backup/assets/cronjobs
20-
21-
touch $FIRST_START_DONE
16+
if [ ! -e "${FIRST_START_DONE}" ]; then
17+
18+
# adapt cronjobs file
19+
sed -i "s|{{ ZAMMAD_BACKUP_CRON_EXP }}|${ZAMMAD_BACKUP_CRON_EXP}|g" "${CONTAINER_SERVICE_DIR}/backup/assets/cronjobs"
20+
21+
touch "${FIRST_START_DONE}"
2222
fi
23-
24-
exit 0

0 commit comments

Comments
 (0)