forked from joshbetz/docker-wordpress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update.sh
executable file
·25 lines (20 loc) · 914 Bytes
/
update.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
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
###
# WordPress Dockerfile
###
WORDPRESS_VERSION="$(curl -fsSL 'https://api.wordpress.org/core/version-check/1.7/' | jq -r '.offers[0].current')"
WORDPRESS_SHA1="$(curl -fsSL "https://wordpress.org/wordpress-$WORDPRESS_VERSION.tar.gz.sha1")"
sed \
-e "s/%%WORDPRESS_VERSION%%/${WORDPRESS_VERSION}/g" \
-e "s/%%WORDPRESS_SHA1%%/${WORDPRESS_SHA1}/g" \
$DIR/Dockerfile-fpm.template > $DIR/fpm/Dockerfile
###
# WP-CLI Dockerfile
###
WPCLI_VERSION="$(curl https://api.github.com/repos/wp-cli/wp-cli/releases/latest | jq -r '.tag_name' | sed -e 's/^v//g' )"
WPCLI_SHA512="$(curl -fsSL "https://github.com/wp-cli/wp-cli/releases/download/v${WPCLI_VERSION}/wp-cli-${WPCLI_VERSION}.phar.sha512")"
sed \
-e "s/%%WPCLI_VERSION%%/${WPCLI_VERSION}/g" \
-e "s/%%WPCLI_SHA512%%/${WPCLI_SHA512}/g" \
$DIR/Dockerfile-cli.template > $DIR/cli/Dockerfile