Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
gdbtek committed Jan 27, 2016
1 parent 309613a commit 56c4c33
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
13 changes: 5 additions & 8 deletions cookbooks/nginx/recipes/install-from-binary.bash
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,15 @@ function install()
# Update Apt Source List

local -r releaseFilePath='/etc/lsb-release'
local -r aptSourceListFilePath='/etc/apt/sources.list'

checkExistFile "${releaseFilePath}"

source "${releaseFilePath}"

echo >> "${aptSourceListFilePath}"
echo "deb http://nginx.org/packages/mainline/ubuntu ${DISTRIB_CODENAME} nginx" >> "${aptSourceListFilePath}"
echo "deb-src http://nginx.org/packages/mainline/ubuntu ${DISTRIB_CODENAME} nginx" >> "${aptSourceListFilePath}"
local -r configData=('__DISTRIBUTION_CODE_NAME__' "${DISTRIB_CODENAME}")

createFileFromTemplate "${APP_FOLDER_PATH}/../templates/nginx.list.apt" '/etc/apt/sources.list.d/nginx.list' "${configData[@]}"
curl -s -L 'http://nginx.org/keys/nginx_signing.key' --retry 12 --retry-delay 5 | apt-key add -

apt-get update -m

# Install
Expand All @@ -34,10 +31,10 @@ function install()

function main()
{
local -r appFolderPath="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
APP_FOLDER_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

source "${appFolderPath}/../../../libraries/util.bash"
source "${appFolderPath}/../attributes/default.bash"
source "${APP_FOLDER_PATH}/../../../libraries/util.bash"
source "${APP_FOLDER_PATH}/../attributes/default.bash"

checkRequireSystem
checkRequireRootUser
Expand Down
2 changes: 1 addition & 1 deletion cookbooks/nginx/recipes/install-from-source.bash
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function install()

local -r serverConfigData=('__PORT__' "${NGINX_PORT}")

createFileFromTemplate "${APP_FOLDER_PATH}/../templates/nginx.conf.conf" "${NGINX_INSTALL_FOLDER}/conf/nginx.conf" "${serverConfigData[@]}"
createFileFromTemplate "${APP_FOLDER_PATH}/../templates/nginx.conf.conf" "${NGINX_INSTALL_FOLDER}/conf/nginx.conf" "${serverConfigData[@]}"

# Config Log

Expand Down
2 changes: 2 additions & 0 deletions cookbooks/nginx/templates/nginx.list.apt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
deb http://nginx.org/packages/mainline/ubuntu __DISTRIBUTION_CODE_NAME__ nginx
deb-src http://nginx.org/packages/mainline/ubuntu __DISTRIBUTION_CODE_NAME__ nginx

0 comments on commit 56c4c33

Please sign in to comment.