Add boardelection configurations

This commit is contained in:
Olivier Vernin 2017-04-27 15:20:06 +02:00
parent cf3e65e610
commit 10092bac9d
4 changed files with 19 additions and 4 deletions

View File

@ -18,11 +18,12 @@ COPY config.properties.example /etc/accountapp/config.properties.example
COPY circuitBreaker.txt /etc/accountapp/circuitBreaker.txt
COPY entrypoint.sh /entrypoint.sh
COPY build/libs/accountapp*.war /var/lib/jetty/webapps/ROOT.war
RUN \
chmod 0755 /entrypoint.sh &&\
chown -R jetty:root /etc/accountapp
COPY build/libs/accountapp*.war /var/lib/jetty/webapps/ROOT.war
chown -R jetty:root /etc/accountapp &&\
chown -R jetty:root /var/lib/jetty
USER jetty

View File

@ -19,4 +19,9 @@ url=APP_URL
# creation
circuitBreakerFile=CIRCUIT_BREAKER_FILE
electionCandidates=ELECTION_CANDIDATES
electionClose=ELECTION_CLOSE
electionOpen= ELECTION_OPEN
electionLogfile=ELECTION_LOGFILE
# vim: ft=conf

View File

@ -1,6 +1,6 @@
version: '3'
services:
accountapp:
app:
build: .
image: accountapp:latest
env_file: .env

View File

@ -18,6 +18,11 @@ init_config_properties() {
: "${LDAP_NEW_USER_BASE_DN:? Require ldap new user base DN}"
: "${CIRCUIT_BREAKER_FILE:? Require circuitBreaker file}"
# Elections configurations
: "${ELECTION_CANDIDATES:? Required coma separated list of candidates}"
: "${ELECTION_CLOSE:? Required date election will close. yyyy/MM/dd}"
: "${ELECTION_OPEN:? date election will open. yyyy/MM/dd }"
: "${ELECTION_LOGFILE:? path to store collected votes. assume this path is well persisted/backup }"
cp /etc/accountapp/config.properties.example /etc/accountapp/config.properties
@ -31,6 +36,10 @@ init_config_properties() {
sed -i "s#LDAP_MANAGER_DN#$LDAP_MANAGER_DN#" /etc/accountapp/config.properties
sed -i "s#LDAP_NEW_USER_BASE_DN#$LDAP_NEW_USER_BASE_DN#" /etc/accountapp/config.properties
sed -i "s#CIRCUIT_BREAKER_FILE#$CIRCUIT_BREAKER_FILE#" /etc/accountapp/config.properties
sed -i "s#ELECTION_CANDIDATES#$ELECTION_CANDIDATES#" /etc/accountapp/config.properties
sed -i "s#ELECTION_OPEN#$ELECTION_OPEN#" /etc/accountapp/config.properties
sed -i "s#ELECTION_CLOSE#$ELECTION_CLOSE#" /etc/accountapp/config.properties
sed -i "s#ELECTION_LOGFILE#$ELECTION_LOGFILE#" /etc/accountapp/config.properties
}
if [ ! -f /etc/accountapp/config.properties ]; then