diff --git a/basis/bin/shared_bash_function.sh b/basis/bin/shared_bash_function.sh index 02283f00..62d6bb26 100755 --- a/basis/bin/shared_bash_function.sh +++ b/basis/bin/shared_bash_function.sh @@ -51,7 +51,11 @@ build_function() { fn update context oracle.compartment-id ${TF_VAR_compartment_ocid} fn update context api-url https://functions.${TF_VAR_region}.oraclecloud.com fn update context registry ${TF_VAR_ocir}/${TF_VAR_namespace} + # Set pipefail to get the error despite pip to tee + set -o pipefail fn build -v | tee $TARGET_DIR/fn_build.log + exit_on_error + if grep --quiet "built successfully" $TARGET_DIR/fn_build.log; then fn bump # Store the image name and DB_URL in files @@ -61,6 +65,9 @@ build_function() { # Push the image to docker docker login ${TF_VAR_ocir} -u ${TF_VAR_namespace}/${TF_VAR_username} -p "${TF_VAR_auth_token}" docker push $TF_VAR_fn_image + else + echo "build_function - built successfully not found" + exit 1 fi # First create the Function using terraform diff --git a/option/src/app/fn/fn_common/build_app.sh b/option/src/app/fn/fn_common/build_app.sh index 61cd20e3..0b7891d4 100755 --- a/option/src/app/fn/fn_common/build_app.sh +++ b/option/src/app/fn/fn_common/build_app.sh @@ -14,4 +14,4 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # Deploy with terraform # Then Work-around: terraforms is not able to create a APIGW with dynamic multiple backends build_function $DB_URL - +exit_on_error diff --git a/option/src/app/fn/fn_go/Dockerfile b/option/src/app/fn/fn_go/Dockerfile index 0225197d..23cfa199 100644 --- a/option/src/app/fn/fn_go/Dockerfile +++ b/option/src/app/fn/fn_go/Dockerfile @@ -5,7 +5,7 @@ RUN groupadd --gid 1000 fn && adduser --uid 1000 --gid fn fn RUN yum -y install oracle-release-el7 oracle-golang-release-el7 && \ yum -y install oracle-instantclient-release-el7 && \ yum-config-manager --disable ol7_developer_EPEL && \ - yum -y install oracle-instantclient-basic oracle-instantclient-sqlplus gcc golang && \ + yum -y install oracle-instantclient-basic oracle-instantclient-sqlplus gcc golang git && \ rm -rf /var/cache/yum # Install the program diff --git a/option/src/app/fn/fn_go_psql/func.go b/option/src/app/fn/fn_go_psql/func.go index 56846751..cbf787c7 100644 --- a/option/src/app/fn/fn_go_psql/func.go +++ b/option/src/app/fn/fn_go_psql/func.go @@ -7,7 +7,7 @@ import ( "io" fdk "github.com/fnproject/fdk-go" "database/sql" - _ "github.com/go-sql-driver/mysql" + _ "github.com/lib/pq" "os" ) @@ -25,8 +25,6 @@ func myHandler(ctx context.Context, in io.Reader, out io.Writer) { psqlInfo := fmt.Sprintf("host=%s port=5432 user=%s password=%s dbname=postgres sslmode=require", os.Getenv("DB_URL"), os.Getenv("DB_USER"), os.Getenv("DB_PASSWORD")) db, err := sql.Open("postgres", psqlInfo) - - db, err := sql.Open("mysql", os.Getenv("DB_USER")+":"+os.Getenv("DB_PASSWORD")+"@tcp("+os.Getenv("DB_URL")+")/db1") if err != nil { fmt.Println(err) return @@ -51,4 +49,3 @@ func myHandler(ctx context.Context, in io.Reader, out io.Writer) { } json.NewEncoder(out).Encode(&d) } - diff --git a/option/src/app/fn/fn_java/build_app.sh b/option/src/app/fn/fn_java/build_app.sh index abd91c72..7154823e 100755 --- a/option/src/app/fn/fn_java/build_app.sh +++ b/option/src/app/fn/fn_java/build_app.sh @@ -4,3 +4,4 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) . $BIN_DIR/build_common.sh build_function $JDBC_URL +exit_on_error \ No newline at end of file diff --git a/option/src/app/fn/fn_python/requirements.j2.txt b/option/src/app/fn/fn_python/requirements.j2.txt index 8d09582e..5b063dc8 100644 --- a/option/src/app/fn/fn_python/requirements.j2.txt +++ b/option/src/app/fn/fn_python/requirements.j2.txt @@ -5,5 +5,5 @@ oracledb # 8.0.29 removed the support for Python 3.6 used mysql-connector-python==8.0.28 {%- elif db_family == "psql" %} -psycopg2 +psycopg2-binary {%- endif %} \ No newline at end of file diff --git a/option/src/app/php/src/install.j2.sh b/option/src/app/php/src/install.j2.sh index 9ab5dc08..5b472744 100755 --- a/option/src/app/php/src/install.j2.sh +++ b/option/src/app/php/src/install.j2.sh @@ -19,7 +19,6 @@ sudo ./wa_php_oci.sh sudo yum install -y php-pgsql {%- endif %} - if grep -q '##DB_URL##' php.ini.append; then sed -i "s!##DB_URL##!$DB_URL!" php.ini.append sudo sh -c "cat php.ini.append >> /etc/php.ini" diff --git a/option/test_suite_group_all.sh b/option/test_suite_group_all.sh index 5de19fc9..64c228f2 100755 --- a/option/test_suite_group_all.sh +++ b/option/test_suite_group_all.sh @@ -95,6 +95,8 @@ loop_lang () { if [ "$OPTION_DEPLOY" != "function" ]; then OPTION_LANG=php loop_db + fi + if [ "$OPTION_DEPLOY" == "compute" ]; then OPTION_LANG=apex OPTION_DB=atp loop_shape