Commit 70c4189c by Pierre Allix

Merge branch '2-generalise-to-other-aggregates' into 'master'

Resolve "Generalise to other aggregates"

Closes #2

See merge request !1
parents 0d0716b3 daafd51b
Pipeline #1598 passed with stages
in 2 minutes 33 seconds
......@@ -3,60 +3,83 @@ image: docker:1.10
stages:
- build
- register
# - deploy
- deploy
# - test
variables:
PROJECT_NAME: contradiction
PROJECT_VERSION: 0.0.1
PROJECT_NAME: $CI_PROJECT_NAME
CONTAINER_IMAGE: iilab/$CI_PROJECT_NAME
DEV_STACK_NAME: microservices-master
STAGING_STACK_NAME: staging
# CONTAINER_IMAGE: docker.iilab.org:5000/openintegrity/$PROJECT_NAME
CONTAINER_IMAGE: iilab/$PROJECT_NAME
CONTAINER_TEST_TAG: $PROJECT_VERSION-test-$CI_BUILD_REF_NAME
# CONTAINER_TEST_TAG: $PROJECT_VERSION-test-$CI_BUILD_REF_NAME
before_script:
# - docker login --username cirunner --password $CI_PORTUS_PASSWORD --email admin@iilab.org docker.iilab.org:5000
- docker login --username iilab --password $HUB_PASSWORD --email tech@iilab.org
build:
build-register-dev:
stage: build
script:
- docker build --pull -t $CONTAINER_IMAGE:$CONTAINER_TEST_TAG .
- docker push $CONTAINER_IMAGE:$CONTAINER_TEST_TAG
- docker build -t $CONTAINER_IMAGE:dev .
- docker push $CONTAINER_IMAGE:dev
tags:
- docker-build
# only:
# - master
except:
- tags
build-register-release:
stage: build
script:
- docker build -t $CONTAINER_IMAGE:$CI_BUILD_TAG .
- docker push $CONTAINER_IMAGE:$CI_BUILD_TAG
tags:
- docker-build
only:
- master
- tags
# test1:
# stage: test
# tags:
# - docker-build
# script:
# - docker pull $CONTAINER_TEST_IMAGE
# - docker run $CONTAINER_TEST_IMAGE /script/to/run/tests
#
# test2:
# stage: test
# tags:
# - docker-build
# script:
# - docker pull $CONTAINER_TEST_IMAGE
# - docker run $CONTAINER_TEST_IMAGE /script/to/run/another/test
deploy-master-dev:
before_script:
- /bin/true
variables:
CONTAINER_TAG: dev
DEPLOY_STAGE: dev
STACK_NAME: $DEV_STACK_NAME
RANCHER_ACCESS_JOB: $RANCHER_ACCESS_DEV
RANCHER_SECRET_JOB: $RANCHER_SECRET_DEV
RANCHER_COMPOSE_VERSION: 0.10.0
stage: deploy
script:
- docker rm -f rancher-compose-$PROJECT_NAME || true
- docker create -e CONTAINER_TAG=$CONTAINER_TAG -e DEPLOY_STAGE=$DEPLOY_STAGE --name rancher-compose-$PROJECT_NAME iilab/rancher-compose:$RANCHER_COMPOSE_VERSION rancher-compose --project-name "$STACK_NAME" --url https://rancher.iilab.org --access-key "$RANCHER_ACCESS_JOB" --secret-key "$RANCHER_SECRET_JOB" up -d --upgrade --force-upgrade --confirm-upgrade || true
- docker cp $CI_PROJECT_DIR/docker-compose.yml rancher-compose-$PROJECT_NAME:/app/docker-compose.yml
- docker start --attach rancher-compose-$PROJECT_NAME
# only:
# - master
except:
- tags
tags:
- docker-build
register:
stage: register
deploy-release-staging:
before_script:
- /bin/true
variables:
CONTAINER_TAG: $CI_BUILD_TAG
DEPLOY_STAGE: staging
STACK_NAME: $STAGING_STACK_NAME
RANCHER_ACCESS_JOB: $RANCHER_ACCESS
RANCHER_SECRET_JOB: $RANCHER_SECRET
RANCHER_COMPOSE_VERSION: 0.10.0
stage: deploy
script:
- docker pull $CONTAINER_IMAGE:$CONTAINER_TEST_TAG
- docker tag $CONTAINER_IMAGE:$CONTAINER_TEST_TAG $CONTAINER_IMAGE:$PROJECT_VERSION
- docker push $CONTAINER_IMAGE:$PROJECT_VERSION
- docker rm -f rancher-compose-$PROJECT_NAME || true
- docker create -e CONTAINER_TAG=$CONTAINER_TAG -e DEPLOY_STAGE=$DEPLOY_STAGE --name rancher-compose-$PROJECT_NAME iilab/rancher-compose:$RANCHER_COMPOSE_VERSION rancher-compose --project-name "$STACK_NAME" --url https://rancher.iilab.org --access-key "$RANCHER_ACCESS_JOB" --secret-key "$RANCHER_SECRET_JOB" up -d --upgrade --force-upgrade || true
- docker cp $CI_PROJECT_DIR/docker-compose.yml rancher-compose-$PROJECT_NAME:/app/docker-compose.yml
- docker start --attach rancher-compose-$PROJECT_NAME
only:
- master
- tags
tags:
- docker-build
# deploy:
# stage: deploy
# script:
# - ./deploy.sh
# only:
# - master
......@@ -8,9 +8,9 @@ The following databases need to be created:
- `events-dependencies`: events of the agents. Continuously replicated to `metrics-dependencies`.
- `claims-dependencies`: events of the claim frontend. Continuously replicated to `metrics-dependencies`.
- `dependencies-contradictions`: events of the contradiction agent and of the resolution frontend. Continuously replicated to `metrics-dependencies`.
- `dependencies-information`: out-of-band information for the contradiction agent
- `contradictions-dependencies`: events of the contradiction agent and of the resolution frontend. Continuously replicated to `metrics-dependencies`.
- `metrics-dependencies`: result of the merging.
- `config-contradiction`: out-of-band information for the contradiction agent
An `*-information` database needs to be created to save the
`last_seen_doc`. The document cannot go into the `*-merge` or
......
contradiction-dependencies:
image: iilab/contradiction:$CONTAINER_TAG
labels:
io.rancher.container.pull_image: always
io.rancher.sidekicks: config-contradiction-push-config, events-dependencies-push-app, metrics-dependencies-push-app, contradictions-dependencies-push-app, dependencies-events-metrics-replicate, contradictions-events-metrics-replicate
environment:
couchdb_HOST: couchdb.microservices-master
couchdb_PORT: 5984
contradiction_AGGREGATE: dependencies-$DEPLOY_STAGE
contradiction_CONFIGDB: config-contradictions-$DEPLOY_STAGE
expose:
- 20000
config-contradiction-push-config:
image: iilab/store-config:0.0.6
labels:
io.rancher.container.pull_image: always
io.rancher.container.start_once: 'true'
command:
- npm
- run
- pushdocs
- http://couchdb:5984/config-$DEPLOY_STAGE
- docs/dependencies_last_seen.json
links:
- couchdb
events-dependencies-push-app:
image: iilab/events-dependencies:dev
labels:
io.rancher.container.pull_image: always
io.rancher.container.start_once: 'true'
command:
- npm
- run
- pushapp
- --
- -dburl=http://couchdb:5984/
- -dbname=events-dependencies-$DEPLOY_STAGE
links:
- couchdb
metrics-dependencies-push-app:
image: iilab/metrics-dependencies:dev
labels:
io.rancher.container.pull_image: always
io.rancher.container.start_once: 'true'
command:
- npm
- run
- pushapp
- --
- -dburl=http://couchdb:5984/
- -dbname=metrics-dependencies-$DEPLOY_STAGE
links:
- couchdb
contradictions-dependencies-push-app:
image: iilab/events-contradictions:dev
labels:
io.rancher.container.pull_image: always
io.rancher.container.start_once: 'true'
command:
- npm
- run
- pushapp
- --
- -dburl=http://couchdb:5984/
- -dbname=contradictions-dependencies-$DEPLOY_STAGE
links:
- couchdb
dependencies-events-metrics-replicate:
image: iilab/store-config:0.0.6
labels:
io.rancher.container.pull_image: always
io.rancher.container.start_once: 'true'
command:
- /bin/sh
- -c
- 'curl -X POST -H "Content-Type: application/json" -d@docs/replications/dependencies-events-metrics-dev.json http://couchdb:5984/_replicate'
links:
- couchdb
contradictions-events-metrics-replicate:
image: iilab/store-config:0.0.6
labels:
io.rancher.container.pull_image: always
io.rancher.container.start_once: 'true'
command:
- /bin/sh
- -c
- 'curl -X POST -H "Content-Type: application/json" -d@docs/replications/contradictions-events-metrics-dependencies-dev.json http://couchdb:5984/_replicate'
links:
- couchdb
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment