Skip to content

Commit

Permalink
Copy Docker setup from #686 (thanks @ProH4Ck)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rasmus Mikkelsen committed Dec 9, 2019
1 parent ef92b54 commit aaa1d6b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 28 deletions.
4 changes: 3 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
init:
- git config --global core.autocrlf input
- ps: git config --global core.autocrlf input
- ps: '[Environment]::SetEnvironmentVariable("LCOW_SUPPORTED", "1", "Machine")'
- ps: Restart-Service docker

version: 0.77.{build}

Expand Down
26 changes: 17 additions & 9 deletions docker-compose.ci.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
version: '3'
version: '2.4'

services:
rabbitmq:
image: idubnori/rabbitmq-windows:3.6.9
image: rabbitmq:3-management-alpine
container_name: rabbitmq-ef
ports:
- "5672:5672"
- "15672:15672"

elasticsearch:
image: sixeyed/elasticsearch:5.6.0-nanoserver-sac2016
image: docker.elastic.co/elasticsearch/elasticsearch:6.8.3
container_name: elasticsearch-ef
environment:
- discovery.type=single-node
- ES_JAVA_OPTS=-Xms1g -Xmx1g
ports:
- "9200:9200"
- "9300:9300"
mem_limit: 4g

eventstore:
image: idubnori/eventstore:4.1.1-hotfix1-windowsservercore
image: eventstore/eventstore
container_name: eventstore-ef

networks:
default:
external:
name: nat
ports:
- "1113:1113"
- "2113:2113"
26 changes: 8 additions & 18 deletions up_integration-test-env.ps1
Original file line number Diff line number Diff line change
@@ -1,33 +1,23 @@
# functions
Function Get-Container-Ip($containername)
{
docker inspect -f "{{ .NetworkSettings.Networks.nat.IPAddress }}" $containername
}
# end functions

# Up containers
docker-compose -f docker-compose.ci.yml pull --parallel
docker-compose -f docker-compose.ci.yml up -d
docker-compose --compatibility -f docker-compose.ci.yml pull
docker-compose --compatibility -f docker-compose.ci.yml up -d

# Install curl
cinst curl -y --no-progress
sal curl (Join-Path $env:ChocolateyInstall "bin\curl.exe") -O AllScope

# Set connection url to environment variable
# RabbitMQ
$rabbitmq_ip = Get-Container-Ip rabbitmq-ef
$env:RABBITMQ_URL = "amqp://guest:guest@${rabbitmq_ip}:5672"
$env:RABBITMQ_URL = "amqp://guest:guest@localhost:5672"
# Elasticsearch
$elasticsearch_ip = Get-Container-Ip elasticsearch-ef
$env:ELASTICSEARCH_URL = "http://${elasticsearch_ip}:9200"
$env:ELASTICSEARCH_URL = "http://localhost:9200"
# Event Store
$eventstore_ip = Get-Container-Ip eventstore-ef
$env:EVENTSTORE_URL = "tcp://admin:changeit@${eventstore_ip}:1113"
$env:EVENTSTORE_URL = "tcp://admin:changeit@localhost:1113"

# Helth check
# Event Store
curl --connect-timeout 60 --retry 5 -sL "http://${eventstore_ip}:2113"
curl --connect-timeout 60 --retry 5 -sL "http://localhost:2113"
# Elasticsearch
curl --connect-timeout 60 --retry 5 -sL "http://${elasticsearch_ip}:9200"
curl --connect-timeout 60 --retry 5 -sL "http://localhost:9200"
# RabbitMQ
curl --connect-timeout 60 --retry 5 -sL "http://${rabbitmq_ip}:15672"
curl --connect-timeout 60 --retry 5 -sL "http://localhost:15672"

0 comments on commit aaa1d6b

Please sign in to comment.