Skip to content

Commit

Permalink
fix deployment for “unstable”
Browse files Browse the repository at this point in the history
  • Loading branch information
peh committed Mar 27, 2017
1 parent 9ee1d0b commit 65d347e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
15 changes: 6 additions & 9 deletions docker-compose.unstable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ version: '2'
services:
app:
container_name: errbuddy-app
hostname: ${HOSTNAME}
env_file: .env
mem_limit: 3g
image: gradle:3.4-jdk8-alpine
mem_limit: 4g
hostname: ${HOSTNAME}
image: openjdk:8-jdk
ports:
- 9000:9000
depends_on:
Expand All @@ -18,10 +18,7 @@ services:
- redis
- elasticsearch
volumes:
- .:/opt/app
- ./start-latest-stable.sh:/opt/start-latest-stable.sh
- ./default-config.groovy:/opt/errbuddy/errbuddy.groovy
- .data/.gradle:/root/.gradle:rw
- .data/build:/opt/app/build:rw
- .data/nodejs:/opt/app/.nodejs:rw
- .data/node_moudels:/opt/app/node_modules:rw
command: /bin/bash -c "cd /opt/app/ && gradle bootRun -Dgrails.env=prod -Derrbuddy.mysql.password=${MYSQL_PASSWORD} -Derrbuddy.serverUrl=${SERVER_URL}"
#TODO: find out how to have a seperate volume for scaled servers
command: /bin/bash -c "bash /opt/start-latest.sh"
2 changes: 1 addition & 1 deletion grails-app/services/errbuddy/EntryCleanupService.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class EntryCleanupService {

void handleEntryCleanupForApplication(App app) {
int max = 500
def entries = Entry.createCriteria().list([max: max]) {
def entries = Entry.createCriteria().list([max: max, order: 'asc', sort: 'id']) {
entryGroup {
eq('app', app)
}
Expand Down
10 changes: 10 additions & 0 deletions start-latest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

TARGET=/opt/errbuddy.war
LATEST_RELEASE=$(curl -L -s -H 'Accept: application/json' https://github.com/peh/errbuddy/releases/latest)
LATEST_VERSION=$(echo $LATEST_RELEASE | sed -e 's/.*"tag_name":"\([^"]*\)".*/\1/')
ARTIFACT_URL="https://github.com/peh/errbuddy/releases/download/$LATEST_VERSION/errbuddy.war"

rm -f $TARGET
wget -O $TARGET $ARTIFACT_URL
java -Dgrails.env=prod -Derrbuddy.mysql.password=$MYSQL_PASSWORD -Derrbuddy.serverUrl=$SERVER_URL -jar $TARGET

0 comments on commit 65d347e

Please sign in to comment.