Skip to content

Commit

Permalink
Merge pull request #224 from SEL-Columbia/staging
Browse files Browse the repository at this point in the history
0.2.5
  • Loading branch information
vr2262 committed Dec 22, 2015
2 parents 6f81f45 + 74ae38f commit f03313f
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 20 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ addons:

before_install:
- pip install coveralls flake8 coverage beautifulsoup4 py-dateutil pytz selenium
- gem install coveralls-lcov

before_script:
- python3 -m flake8 .
Expand All @@ -29,8 +30,8 @@ script:
- xvfb-run --server-args="-screen 0, 1280x1280x16" tests/python/coverage_run.sh

after_success:
- coveralls
- npm coveralls
- coveralls-lcov -v -n coverage/lcov.info > coverage.json
- coveralls --merge=coverage.json

notifications:
email:
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ nginx:
- /etc/letsencrypt:/etc/letsencrypt
- /tmp:/tmp
webapp:
image: "selcolumbia/dokomoforms:0.2.4"
image: "selcolumbia/dokomoforms:0.2.5"
command: bash -c "./docker-wait-for-postgres.sh db && head -c 24 /dev/urandom > cookie_secret && python webapp.py"
links:
- "db:db"
Expand Down
28 changes: 15 additions & 13 deletions installer.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env sh
# Dokomo Forms installer for version 0.2.4
# Dokomo Forms installer for version 0.2.5
set -e

# Do you have docker installed?
Expand Down Expand Up @@ -38,6 +38,7 @@ else
printf " directory \n"
printf "========================================\n"
$CURL -o docker-compose -L https://github.com/docker/compose/releases/download/1.5.2/run.sh
sleep 1
chmod +x docker-compose
./docker-compose -v
fi
Expand Down Expand Up @@ -104,8 +105,8 @@ $SUDO openssl dhparam -out /etc/letsencrypt/live/$LETSENCRYPT_DIR/dhparam.pem 20
printf "========================================\n"
printf " Downloading configuration files \n"
printf "========================================\n"
$CURL -O https://raw.githubusercontent.com/SEL-Columbia/dokomoforms/v0.2.4/docker-compose.yml
$CURL -O https://raw.githubusercontent.com/SEL-Columbia/dokomoforms/v0.2.4/nginx.conf
$CURL -O https://raw.githubusercontent.com/SEL-Columbia/dokomoforms/v0.2.5/docker-compose.yml
$CURL -O https://raw.githubusercontent.com/SEL-Columbia/dokomoforms/v0.2.5/nginx.conf

# Edit the configuration files
printf "========================================\n"
Expand Down Expand Up @@ -141,16 +142,6 @@ printf "Administrator user name:\n>>> "
read ADMIN_NAME
printf "admin_name = '${ADMIN_NAME:-$DEFAULT_NAME}'\n" >> local_config.py

# Let's Encrypt auto-renew (for now this is a cron job).
printf "========================================\n"
printf " Adding monthly cron job to renew SSL \n"
printf " certificate. \n"
printf "========================================\n"
CRON_CMD="mkdir -p /tmp/letsencrypt-auto && docker run -it --rm --name letsencrypt -v /etc/letsencrypt:/etc/letsencrypt:Z -v /var/lib/letsencrypt:/var/lib/letsencrypt:Z -v /tmp/letsencrypt-auto:/tmp/letsencrypt-auto:Z -v /var/log/letsencrypt:/var/log/letsencrypt:Z quay.io/letsencrypt/letsencrypt --renew certonly -a webroot -w /tmp/letsencrypt-auto $DOMAIN_ARGS && docker restart ${USER}_nginx_1"
CRON_JOB="0 0 1 * * $CRON_CMD"
cat <(fgrep -i -v "$CRON_CMD" <(crontab -l)) <(echo "$CRON_JOB") | crontab -
crontab -l

# Bring up Dokomo Forms
printf "========================================\n"
printf " Starting Dokomo Forms. \n"
Expand All @@ -163,3 +154,14 @@ if [ -f /etc/redhat-release ] ; then
chcon -Rt svirt_sandbox_file_t .
fi
$DOCKER_COMPOSE up -d
NGINX_CONTAINER_NAME=$($DOCKER_COMPOSE ps | grep nginx | cut -d' ' -f1)

# Let's Encrypt auto-renew (for now this is a cron job).
printf "========================================\n"
printf " Adding monthly cron job to renew SSL \n"
printf " certificate. \n"
printf "========================================\n"
CRON_CMD="mkdir -p /tmp/letsencrypt-auto && docker run -it --rm --name letsencrypt -v /etc/letsencrypt:/etc/letsencrypt:Z -v /var/lib/letsencrypt:/var/lib/letsencrypt:Z -v /tmp/letsencrypt-auto:/tmp/letsencrypt-auto:Z -v /var/log/letsencrypt:/var/log/letsencrypt:Z quay.io/letsencrypt/letsencrypt --renew certonly -a webroot -w /tmp/letsencrypt-auto $DOMAIN_ARGS && docker restart $NGINX_CONTAINER_NAME"
CRON_JOB="0 0 1 * * $CRON_CMD"
crontab -l | fgrep -i -v "$CRON_CMD" | { cat; echo "$CRON_JOB"; } | crontab -
crontab -l
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"babelify": "^7.2.0",
"browserify": "^12.0.1",
"browserify-shim": "^3.8.7",
"coveralls": "^2.11.2",
"del": "^2.0.2",
"eslint-plugin-react": "^3.3.0",
"event-stream": "^3.3.1",
Expand Down Expand Up @@ -127,8 +126,7 @@
}
},
"scripts": {
"test": "jest",
"coveralls": "coveralls"
"test": "jest"
},
"repository": {
"type": "git",
Expand Down
8 changes: 7 additions & 1 deletion tests/python/test_selenium.py
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,12 @@ def test_edit_user(self):
self.sleep()
self.click(edit_btn)
self.sleep()
self.wait_for_element('user-name')
try:
self.wait_for_element('user-name')
except TimeoutException:
self.click(edit_btn)
self.sleep()
self.wait_for_element('user-name')
(
self.drv
.find_element_by_id('user-name')
Expand Down Expand Up @@ -1437,6 +1442,7 @@ def test_change_language(self):

self.get('/enumerate/{}'.format(survey_id))

self.sleep()
self.wait_for_element('menu', By.CLASS_NAME)
self.click(self.drv.find_element_by_class_name('menu'))
lang = Select(self.drv.find_element_by_class_name('language_select'))
Expand Down

0 comments on commit f03313f

Please sign in to comment.