Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sentry, react-router and refactoring #1140

Merged
merged 9 commits into from
Jul 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ before_script:
- docker --version
- docker-compose --version
- export AUTHOR_NAME="$(git log -1 ${TRAVIS_COMMIT} --pretty="%aN")"
- export SENTRY_RELEASE_VERSION=${IMAGE}-${TRAVIS_COMMIT}

jobs:
include:
Expand All @@ -26,10 +27,10 @@ jobs:
- TAG=staging
script:
- docker login -u $DOCKER_USER -p $DOCKER_PASS
- source scripts.sh && time run_e2e_setup ./docker/docker-compose.lateste2e.yml ${TAG}
- source scripts.sh && time run_e2e_setup ./docker/docker-compose.lateste2e.yml ${TAG} ${SENTRY_RELEASE_VERSION}
- docker ps
- cat nginx/log
- TAG=${TAG} docker-compose -f docker-compose.yml -f ./docker/docker-compose.lateste2e.yml logs -f &
- TAG=${TAG} SENTRY_RELEASE_VERSION=${SENTRY_RELEASE_VERSION} docker-compose -f docker-compose.yml -f ./docker/docker-compose.lateste2e.yml logs -f &
- until $(curl --output /dev/null --silent --fail http://localhost:1337/); do printf '.'; sleep 5; done
- time npm run test_services
- time CYPRESS_baseUrl=http://localhost:1337/ npm run cypress:record
Expand All @@ -38,7 +39,7 @@ jobs:
deploy:
provider: script
skip_cleanup: true
script: "TAG=${TAG} docker-compose -f docker-compose.yml -f ./docker/docker-compose.lateste2e.yml push && curl -X POST -H 'Content-type: application/json' --data \"{\\\"text\\\":\\\"Staging auto deployment started!\\\"}\" ${SLACKBOT_URL}"
script: "TAG=${TAG} SENTRY_RELEASE_VERSION=${SENTRY_RELEASE_VERSION} docker-compose -f docker-compose.yml -f ./docker/docker-compose.lateste2e.yml push && curl -X POST -H 'Content-type: application/json' --data \"{\\\"text\\\":\\\"Staging auto deployment started!\\\"}\" ${SLACKBOT_URL}"
on:
branch: master
- stage: build & test & push & deploy latest
Expand All @@ -47,10 +48,10 @@ jobs:
- TAG=latest
script:
- docker login -u $DOCKER_USER -p $DOCKER_PASS
- source scripts.sh && time run_e2e_setup ./docker/docker-compose.lateste2e.yml ${TAG}
- source scripts.sh && time run_e2e_setup ./docker/docker-compose.lateste2e.yml ${TAG} ${SENTRY_RELEASE_VERSION}
- docker ps
- cat nginx/log
- TAG=${TAG} docker-compose -f docker-compose.yml -f ./docker/docker-compose.lateste2e.yml logs -f &
- TAG=${TAG} SENTRY_RELEASE_VERSION=${SENTRY_RELEASE_VERSION} docker-compose -f docker-compose.yml -f ./docker/docker-compose.lateste2e.yml logs -f &
- until $(curl --output /dev/null --silent --fail http://localhost:1337/); do printf '.'; sleep 5; done
- time npm run test_services
- time CYPRESS_baseUrl=http://localhost:1337/ npm run cypress:record
Expand All @@ -59,7 +60,7 @@ jobs:
deploy:
provider: script
skip_cleanup: true
script: "TAG=${TAG} docker-compose -f docker-compose.yml -f ./docker/docker-compose.lateste2e.yml push && curl -X POST -H 'Content-type: application/json' --data \"{\\\"text\\\":\\\"${TRAVIS_TAG} release started auto deployment!\\\"}\" ${SLACKBOT_URL}"
script: "TAG=${TAG} SENTRY_RELEASE_VERSION=${SENTRY_RELEASE_VERSION} docker-compose -f docker-compose.yml -f ./docker/docker-compose.lateste2e.yml push && curl -X POST -H 'Content-type: application/json' --data \"{\\\"text\\\":\\\"${TRAVIS_TAG} release started auto deployment!\\\"}\" ${SLACKBOT_URL}"
on:
tags: true
stages:
Expand Down
5 changes: 5 additions & 0 deletions docker/docker-compose.lateste2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ services:
build:
args:
BASE_PATH: /
SENTRY_RELEASE_VERSION: ${SENTRY_RELEASE_VERSION}
SENTRY_URL: ${SENTRY_URL}
SENTRY_AUTH_TOKEN: ${SENTRY_AUTH_TOKEN}
SENTRY_ORG: sentry
SENTRY_PROJECT: oodifront
ports:
- "5000:5000"

Expand Down
7 changes: 4 additions & 3 deletions scripts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ echo_path () {

get_oodikone_server_backup() {
scp -r -o ProxyCommand="ssh -W %h:%p melkki.cs.helsinki.fi" oodikone.cs.helsinki.fi:/home/tkt_oodi/backups/* "$BACKUP_DIR/"
scp -r -o ProxyCommand="ssh -W %h:%p melkki.cs.helsinki.fi" svm-77.cs.helsinki.fi:/home/tkt_oodi/backups/* "$BACKUP_DIR/"
}

get_anon_oodikone() {
Expand Down Expand Up @@ -164,10 +165,10 @@ run_e2e_setup () {
echo "Getting anon backups from the private repository. "
get_anon_oodikone
echo "Building images"
TAG=$2 docker-compose -f docker-compose.yml -f $1 build
TAG=$2 SENTRY_RELEASE_VERSION=$3 docker-compose -f docker-compose.yml -f $1 build
echo "Setup oodikone db from dump."
TAG=$2 docker-compose -f docker-compose.yml -f $1 up -d db user_db db_kone
TAG=$2 SENTRY_RELEASE_VERSION=$3 docker-compose -f docker-compose.yml -f $1 up -d db user_db db_kone
db_anon_setup_full
echo "Starting services."
TAG=$2 docker-compose -f docker-compose.yml -f $1 up -d
TAG=$2 SENTRY_RELEASE_VERSION=$3 docker-compose -f docker-compose.yml -f $1 up -d
}
7 changes: 7 additions & 0 deletions services/oodikone2-frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ RUN npm ci
COPY package.json /usr/src/cache/package.json
COPY package-lock.json /usr/src/cache/package-lock.json

ARG SENTRY_RELEASE_VERSION
ENV SENTRY_RELEASE_VERSION=${SENTRY_RELEASE_VERSION}
ARG SENTRY_URL
ARG SENTRY_AUTH_TOKEN
ARG SENTRY_ORG
ARG SENTRY_PROJECT

ARG NODE_ENV=production
ENV NODE_ENV=${NODE_ENV}
RUN if [ "${NODE_ENV}" != "production" ]; then cp -r /usr/src/app/node_modules /usr/src/cache/node_modules; fi
Expand Down
Loading