Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed the php version back to 5.6 for Nextcloud 9 and 10 #42

Merged
merged 2 commits into from
Mar 13, 2017
Merged

Changed the php version back to 5.6 for Nextcloud 9 and 10 #42

merged 2 commits into from
Mar 13, 2017

Conversation

tilosp
Copy link
Member

@tilosp tilosp commented Mar 3, 2017

Closes #40

update.sh Outdated
@@ -16,7 +16,11 @@ for latest in "${latests[@]}"; do
for variant in apache fpm; do
# Create the version+variant directory with a Dockerfile.
mkdir -p "$version/$variant"
cp Dockerfile.template "$version/$variant/Dockerfile"
if [ "$version" == "11.0" ]; then
Copy link
Member

@cyphar cyphar Mar 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not really a future-compatible change. I would recommend defining a function like this:

# version_gte A B returns whether A >= B
function version_gte() {
	[[ "$(printf '%s\n' "$@" | sort -V | head -n1)" != "$1" || "$1" == "$2" ]];
}

Which you could then use like this:

template="Dockerfile.template"
if version_gte "$version" "11.0"; then
    template="Dockerfile-php7.template"
fi
cp "$template" "$version/$variant/Dockerfile"

@pierreozoux
Copy link
Member

Thanks a lot @tilosp for this, this is amazing, I'll merge it right away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants