Commit 5bc689b8 authored by Daniel Espinosa Ortiz's avatar Daniel Espinosa Ortiz

ci: adding configuration for postgres service

parent 5385bd12
...@@ -11,6 +11,9 @@ stages: ...@@ -11,6 +11,9 @@ stages:
- build - build
variables: variables:
POSTGRES_DB: test
POSTGRES_USER: test
POSTGRES_PASSWORD: "test1"
DEPENDENCIES: gcc gettext gtk-doc-tools make autoconf DEPENDENCIES: gcc gettext gtk-doc-tools make autoconf
meson ninja-build meson ninja-build
libgtk-3-dev libxml2-dev gnome-common libgtk-3-dev libxml2-dev gnome-common
...@@ -115,4 +118,4 @@ pages: ...@@ -115,4 +118,4 @@ pages:
- mv doc/C/libgdaui/html public/C/libgdaui-6.0 - mv doc/C/libgdaui/html public/C/libgdaui-6.0
artifacts: artifacts:
paths: paths:
- public - public
\ No newline at end of file
...@@ -244,6 +244,10 @@ if get_option('enable-debug') ...@@ -244,6 +244,10 @@ if get_option('enable-debug')
c_args += '-DGDA_DEBUG' c_args += '-DGDA_DEBUG'
endif endif
if get_option('enable-ci-environment')
c_args += '-DCI_ENVIRONMENT'
endif
add_global_arguments(c_args, language : 'c') add_global_arguments(c_args, language : 'c')
# Files references by sqlite embedded and provider # Files references by sqlite embedded and provider
......
...@@ -14,4 +14,5 @@ option('system-sqlite', type : 'boolean', value : true, description : 'Use SQLit ...@@ -14,4 +14,5 @@ option('system-sqlite', type : 'boolean', value : true, description : 'Use SQLit
option('with-examples', type : 'boolean', value : false, description : 'Compile examples [default=false') option('with-examples', type : 'boolean', value : false, description : 'Compile examples [default=false')
option('system-sqlcipher', type : 'boolean', value : true, description : 'Use SQLCipher installed on the system [default=false') option('system-sqlcipher', type : 'boolean', value : true, description : 'Use SQLCipher installed on the system [default=false')
option('enable-tools', type : 'boolean', value : false, description : 'Enable build GUI Tools') option('enable-tools', type : 'boolean', value : false, description : 'Enable build GUI Tools')
option('enable-ci-environment', type : 'boolean', value : false, description : 'Enable Continous Integration Environment test')
...@@ -236,8 +236,14 @@ test_ddl_creator_start (CheckDdlObject *self, ...@@ -236,8 +236,14 @@ test_ddl_creator_start (CheckDdlObject *self,
g_assert_nonnull (self->xmlfile); g_assert_nonnull (self->xmlfile);
#ifdef CI_ENVIRONMENT
const gchar *cnc_string = "DB_NAME=test;HOST=postgres;USERNAME=test;PASSWORD=test1";
#else
const gchar *cnc_string = "DB_NAME=test;HOST=localhost;USERNAME=test;PASSWORD=test1";
#endif
self->cnc = gda_connection_new_from_string("Postgresql", self->cnc = gda_connection_new_from_string("Postgresql",
"DB_NAME=test;HOST=localhost;USERNAME=test;PASSWORD=test1", cnc_string,
NULL, NULL,
GDA_CONNECTION_OPTIONS_NONE, GDA_CONNECTION_OPTIONS_NONE,
NULL); NULL);
......
...@@ -26,12 +26,15 @@ main(int argc, char ** argv) ...@@ -26,12 +26,15 @@ main(int argc, char ** argv)
{ {
GdaConnection *cnc; GdaConnection *cnc;
GdaMetaStore *store; GdaMetaStore *store;
gchar *cnc_string;
GError *error = NULL; GError *error = NULL;
#ifdef CI_ENVIRONMENT
const gchar *cnc_string = "DB_NAME=test;HOST=postgres;USERNAME=test;PASSWORD=test1";
#else
const gchar *cnc_string = "DB_NAME=test;HOST=localhost;USERNAME=test;PASSWORD=test1";
#endif
gda_init (); gda_init ();
cnc_string = "DB_NAME=test;HOST=localhost;USERNAME=test;PASSWORD=test1";
/* connection try */ /* connection try */
cnc = gda_connection_open_from_string ("PostgreSQL", cnc_string, NULL, GDA_CONNECTION_OPTIONS_NONE, &error); cnc = gda_connection_open_from_string ("PostgreSQL", cnc_string, NULL, GDA_CONNECTION_OPTIONS_NONE, &error);
if (cnc == NULL) { if (cnc == NULL) {
......
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 to comment