Skip to content

Commit

Permalink
Autoscaling from upstream image (#1027)
Browse files Browse the repository at this point in the history
* Ignore node_modules everywhere in Docker builds

* Scale up new mirror to instances of old

* Leave autoscaling to upstream image

* No echo
  • Loading branch information
rwd authored Mar 23, 2021
1 parent 52f2e7c commit 9d958e1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ bower_components

# Dependency directories
node_modules/
**/node_modules/
jspm_packages/

# TypeScript v1 declaration files
Expand Down
5 changes: 3 additions & 2 deletions deploy/cloud-foundry/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM europeana/cf-blue-green-deploy:main

ENV CF_APP_TYPE=buildpack

# openssh-client used by ELK registration command
RUN apk add -q openssh-client && \
cf install-plugin app-autoscaler-plugin -f -r CF-Community
RUN apk add --no-cache -q openssh-client

COPY hooks /hooks

Expand Down
13 changes: 5 additions & 8 deletions deploy/cloud-foundry/hooks/post-push
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,15 @@

set -e

app_guid() {
cf app $1 --guid | head -1
}

new_app_name=$2
new_app_guid=$(app_guid $2)

if [ "${ELK_SERVICE_REGISTRATION_COMMAND}" != "" ]; then
echo
echo "Registering with ELK service"
new_app_guid="$(cf app ${new_app_name} --guid | head -1)"
${ELK_SERVICE_REGISTRATION_COMMAND} ${new_app_name} ${new_app_guid}
echo "OK"
fi

if [ -f "/autoscaling-policy.json" ]; then
echo
echo "Attaching autoscaling policy"
cf attach-autoscaling-policy ${new_app_name} /autoscaling-policy.json
fi

0 comments on commit 9d958e1

Please sign in to comment.