-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate.sh
More file actions
executable file
·31 lines (25 loc) · 841 Bytes
/
Copy pathupdate.sh
File metadata and controls
executable file
·31 lines (25 loc) · 841 Bytes
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
#!/bin/bash
set -ex
source ./data.sh
versions=( "$@" )
if [ ${#versions[@]} -eq 0 ]; then
versions=( */ )
fi
versions=( "${versions[@]%/}" )
envs=""
for version in "${versions[@]}"; do
mkdir -p "$version"
cp --force Dockerfile.template "$version/Dockerfile"
cp --force php.ini "$version/php.ini"
cp --force entrypoint "$version/entrypoint"
sed -ri \
-e 's!%%STUDIP_VERSION%%!'"$version"'!' \
-e 's!%%STUDIP_PHP_VERSION%%!'"${php_versions[$version]:-5}"'!' \
-e 's!%%STUDIP_DOWNLOAD_URL%%!'"${download_urls[$version]}"'!' \
-e 's!%%STUDIP_ARCHIVE_HASH_SHA1%%!'"${sha1_hashes[$version]:-''}"'!' \
"$version/Dockerfile"
envs+="\n - VERSION=$version TAG=$version"
done
envs+="\n - VERSION=$version TAG=latest"
cp --force travis.yml.template ./.travis.yml
sed -ri -e 's!%%ENVS%%!'"$envs"'!' ./.travis.yml