Skip to content

Commit 6db3315

Browse files
committed
Fix CI.
1 parent 7993668 commit 6db3315

File tree

5 files changed

+50
-19
lines changed

5 files changed

+50
-19
lines changed

azure-pipelines.yml

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,12 @@ jobs:
99
continueOnError: false
1010
pool:
1111
vmImage: 'Ubuntu 16.04'
12-
container:
13-
image: lganzzzo/ubuntu-cmake-postgresql:latest
1412
workspace:
1513
clean: all
1614
steps:
1715
- script: |
18-
sudo /bin/bash ./install-oatpp-modules.sh
19-
displayName: 'install oatpp modules'
20-
workingDirectory: utility
16+
docker-compose -f ci.compose.yaml build
17+
displayName: 'Compose build'
2118
- script: |
22-
mkdir build
23-
- script: |
24-
cmake ..
25-
sudo make
26-
displayName: 'CMake'
27-
workingDirectory: build
28-
- script: |
29-
make test ARGS="-V"
30-
displayName: 'Test'
31-
workingDirectory: build
19+
docker-compose -f ci.compose.yaml run test
20+
displayName: 'Compose run'

ci.compose.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
version: '3'
2+
3+
services:
4+
db:
5+
image: postgres
6+
restart: always
7+
environment:
8+
POSTGRES_PASSWORD: db-pass
9+
ports:
10+
- 5432:5432
11+
12+
test:
13+
build:
14+
context: .
15+
dockerfile: ci.dockerfile
16+
ports:
17+
- "8000:8000"
18+
depends_on:
19+
- db
20+
environment:
21+
CONFIG_PROFILE: local-docker

ci.dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM lganzzzo/alpine-cmake:latest
2+
3+
RUN apk add postgresql-dev
4+
5+
ADD . /service
6+
7+
WORKDIR /service/utility
8+
9+
RUN ./install-oatpp-modules.sh
10+
11+
WORKDIR /service/build
12+
13+
RUN cmake ..
14+
RUN make
15+
16+
EXPOSE 8000 8000
17+
18+
ENTRYPOINT ["./example-postgresql-test"]

docker-compose.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@ services:
66
restart: always
77
environment:
88
POSTGRES_PASSWORD: db-pass
9-
example-postgresql:
9+
ports:
10+
- 5432:5432
11+
12+
service:
1013
build: .
1114
ports:
1215
- "8000:8000"
13-
links:
14-
- "db"
16+
depends_on:
17+
- db
1518
environment:
1619
CONFIG_PROFILE: local-docker

src/ServiceComponent.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class ServiceComponent {
2929
*/
3030
OATPP_CREATE_COMPONENT(std::shared_ptr<oatpp::network::ServerConnectionProvider>, serverConnectionProvider)([] {
3131
OATPP_COMPONENT(oatpp::Object<ConfigDto>, config); // Get config component
32-
return oatpp::network::tcp::server::ConnectionProvider::createShared({"localhost", config->port, oatpp::network::Address::IP_4});
32+
return oatpp::network::tcp::server::ConnectionProvider::createShared({"0.0.0.0", config->port, oatpp::network::Address::IP_4});
3333
}());
3434

3535
/**

0 commit comments

Comments
 (0)