Standardise environment variables

This commit is contained in:
Adnan Abdulhussein
2016-09-09 15:33:59 -07:00
parent d271234137
commit be0d499fe1
4 changed files with 9 additions and 9 deletions

View File

@@ -93,11 +93,11 @@ myapp:
## Creating the Memcached admin user
Authentication on the Memcached server is disabled by default. To enable authentication, specify a username and password for the Memcached admin user using the `MEMCACHED_USER` and `MEMCACHED_PASSWORD` environment variables.
Authentication on the Memcached server is disabled by default. To enable authentication, specify a username and password for the Memcached admin user using the `MEMCACHED_USERNAME` and `MEMCACHED_PASSWORD` environment variables.
```bash
docker run --name memcached \
-e MEMCACHED_USER=my_user \
-e MEMCACHED_USERNAME=my_user \
-e MEMCACHED_PASSWORD=my_password \
bitnami/memcached:latest
```
@@ -108,11 +108,11 @@ or using Docker Compose:
memcached:
image: bitnami/memcached:latest
environment:
- MEMCACHED_USER=my_user
- MEMCACHED_USERNAME=my_user
- MEMCACHED_PASSWORD=my_password
```
> The default value of the `MEMCACHED_USER` is `root`.
> The default value of the `MEMCACHED_USERNAME` is `root`.
# Logging

View File

@@ -14,7 +14,7 @@ function initialize {
}
# Set default values
export MEMCACHED_USER=${MEMCACHED_USER:-root}
export MEMCACHED_USERNAME=${MEMCACHED_USERNAME:-root}
export MEMCACHED_PASSWORD=${MEMCACHED_PASSWORD:-}
if [[ "$1" == "nami" && "$2" == "start" ]] || [[ "$1" == "/init.sh" ]]; then

View File

@@ -1,4 +1,4 @@
{
"username": "{{$global.env.MEMCACHED_USER}}",
"username": "{{$global.env.MEMCACHED_USERNAME}}",
"password": "{{$global.env.MEMCACHED_PASSWORD}}"
}

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bats
MEMCACHED_USER=test_user
MEMCACHED_USERNAME=test_user
MEMCACHED_PASSWORD=test_password123
RUBY_CONTAINER_NAME=bitnami-ruby-test
@@ -60,12 +60,12 @@ create_ruby_container() {
@test "Can create custom user with password" {
container_create default -d \
-e MEMCACHED_USER=$MEMCACHED_USER \
-e MEMCACHED_USERNAME=$MEMCACHED_USERNAME \
-e MEMCACHED_PASSWORD=$MEMCACHED_PASSWORD
create_ruby_container
run docker exec $RUBY_CONTAINER_NAME \
ruby -e "require 'dalli'; Dalli::Client.new('$APP_NAME:11211', {username: '$MEMCACHED_USER', password: '$MEMCACHED_PASSWORD'}).set('test', 'bitnami')"
ruby -e "require 'dalli'; Dalli::Client.new('$APP_NAME:11211', {username: '$MEMCACHED_USERNAME', password: '$MEMCACHED_PASSWORD'}).set('test', 'bitnami')"
[[ "$output" =~ "Authenticated" ]]
}