git lab runner cannot connect to api.local port 80: Connection refused
P粉771233336
P粉771233336 2024-03-26 21:11:23
0
1
363

gitlab-runner 1.29 There is a problem with the pipeline. The virtual host set cannot be seen in .gitlab.ci.yml in the before_script: apache2 configuration Docker file section.

This is a problem when I run behavioral tests. I spent 3 days trying to solve this problem but now I have no idea, can someone please help me.

#Pipeline runer

$ eval $(ssh-agent -s)
Agent pid 12
$ ssh-add <(echo "$SSH_PRIVATE_KEY")
Identity added: /dev/fd/63 (root@area51)
$ echo "export APPLICATION_ENV='test'" >> /etc/apache2/envvars
$ export APPLICATION_ENV='test'
$ rm /var/www/globkurier.pl/globkurier.pl -R
$ ln -s /builds/znatury/globkurier.pl/ /var/www/globkurier.pl/globkurier.pl
$ mkdir -p /var/log/apache2/
$ chmod -R 744 /var/log/apache2/
$ echo '127.0.0.1 api.local' >> /etc/hosts
$ echo '127.0.0.1 api.mock' >> /etc/hosts
$ apache2ctl start
$ bash prepare-database.sh all
Uploading database schema...
Uploading database fixtures...
$ bash test.sh behat routingAndAcl
.F-.F-.F--.F-.F-
--- Failed steps:
001 Scenario: An attempt to refer to an uri using a non-existent method # features/valid/routing-and-acl.feature:7
      When I send the request                                           # features/valid/routing-and-acl.feature:9
        [curl] 7: Failed to connect to api.local port 80: Connection refused [url] http://api.local/v1/user/profile (Guzzle\Http\Exception\CurlException)
002 Scenario: An attempt to refer to an uri using a non-logged user # features/valid/routing-and-acl.feature:12
      When I send the request                                       # features/valid/routing-and-acl.feature:14
        [curl] 7: Failed to connect to api.local port 80: Connection refused [url] http://api.local/v1/user/profile (Guzzle\Http\Exception\CurlException)
003 Scenario: Header list from method OPTIONS should return all available methods # features/valid/routing-and-acl.feature:17
      When I send the request                                                     # features/valid/routing-and-acl.feature:19
        [curl] 7: Failed to connect to api.local port 80: Connection refused [url] http://api.local/v1/user/profile (Guzzle\Http\Exception\CurlException)

#Dockerfile

FROM php:5.6-apache

WORKDIR /var/www/

RUN mkdir -p globkurier.pl/globkurier.pl
RUN mkdir library

WORKDIR /var/www/globkurier.pl/globkurier.pl

RUN echo "[PHP]" > /usr/local/etc/php/php.ini
RUN echo "" >> /usr/local/etc/php/php.ini
RUN echo "date.timezone = \"Europe/Warsaw\"" >> /usr/local/etc/php/php.ini
RUN echo "memory_limit = -1" >> /usr/local/etc/php/php.ini

RUN a2enmod rewrite

RUN apt-get upgrade -y

RUN apt-get update --fix-missing

RUN apt-get install -y \
    libcurl4-openssl-dev \
    zlib1g-dev \
    libmcrypt-dev \
    libxml2-dev \
    libc-client-dev \
    libkrb5-dev \
    openssh-client \
    openssl \
    git \
    netcat \
    wget \
    cron \
    nano-tiny \
    netcat \
    wget \
    cron \
    nano-tiny \
    libpng-dev

RUN docker-php-ext-configure imap --with-kerberos --with-imap-ssl
RUN docker-php-ext-install \
    mcrypt \
    bcmath \
    pdo \
    pdo_mysql \
    curl \
    mbstring \
    mysql \
    zip \
    imap \
    soap \
    curl \
    json \
    sockets \
    gd

#composer
RUN wget https://getcomposer.org/download/1.10.19/composer.phar
RUN chmod 755 composer.phar
RUN mv composer.phar /usr/local/bin/composer

RUN curl -sL https://deb.nodesource.com/setup_12.x | bash
#node
RUN apt-get install -y nodejs

#ssh
RUN echo "Host gitlab.com\n    StrictHostKeyChecking no" >> /etc/ssh/ssh_config

COPY Docker/apache2/v-hosts/000-default.conf /etc/apache2/sites-available/000-default.conf
COPY Docker/apache2/v-hosts/api.local.conf /etc/apache2/sites-available/api.local.conf
COPY Docker/apache2/v-hosts/api.local.conf /etc/apache2/sites-available/api.mock.conf

COPY Docker/apache2/apache2.conf /etc/apache2/apache2.conf
COPY Docker/apache2/ports.conf /etc/apache2/ports.conf

RUN a2ensite api.local.conf
RUN a2ensite api.mock.conf

#redis
RUN pecl install redis-2.2.8 && docker-php-ext-enable redis

#stop apache2 complains about no server name specified
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf

RUN docker-php-ext-install opcache
COPY opcache.ini /usr/local/etc/php/conf.d/opcache.ini

This is my .gitlab.ci.yml

image: registry.gitlab.com/znatury/globkurier.pl:2.3.6

stages:
  - build
  - test & preview

cache:
  paths:
    - vendor/

variables:
  MYSQL_DATABASE: globkurier_test
  MYSQL_ROOT_PASSWORD: DSnUAW6RFkp7F6h4WqbMSwXY946MBFXC

before_script:
  - eval $(ssh-agent -s)
  - ssh-add <(echo "$SSH_PRIVATE_KEY")
  - echo "export APPLICATION_ENV='test'" >> /etc/apache2/envvars
  - export APPLICATION_ENV='test'
  - rm /var/www/globkurier.pl/globkurier.pl -R
  - ln -s /builds/znatury/globkurier.pl/ /var/www/globkurier.pl/globkurier.pl
  - mkdir -p /var/log/apache2/
  - chmod -R 744 /var/log/apache2/
  - echo '127.0.0.1 api.local' >> /etc/hosts
  - echo '127.0.0.1 api.mock' >> /etc/hosts
  - apache2ctl start
  - apache2ctl status

build:
  stage: build
  artifacts:
    expire_in: 1h
    paths:
      - vendor
  script:
    - composer install --no-progress
  tags:
    - area51-1

valid-1:
  stage: test & preview
  services:
    - mysql:5.7
  script:
    - bash prepare-database.sh all
    - bash test.sh behat routingAndAcl
    - bash test.sh behat documentation
    - bash test.sh behat addressBook
    - bash test.sh behat address
    - bash test.sh behat countries
    - bash test.sh behat states
    - bash test.sh behat points
    - bash test.sh behat productSearch
    - bash test.sh behat productPricing
    - bash test.sh behat zoho
  tags:
    - area51-1

valid-2:
  stage: test & preview
  services:
    - mysql:5.7
    - schickling/mailcatcher
  script:
    - bash prepare-database.sh all
    - bash test.sh behat customRequiredFields
    - bash test.sh behat discountCode
    - bash test.sh behat bestPriceOrder
    - bash test.sh behat bankAccountNumbers
    - bash test.sh behat paymentsList
    - bash test.sh behat onlinePayments
    - bash test.sh behat orderPartialValidation
    - bash test.sh behat orderAddons
    - bash test.sh behat orderFuelSurcharge
    - bash test.sh behat orderPayments
    - bash test.sh behat orderPrice
    - bash test.sh behat orderPriceGroup
    - bash test.sh behat orderPurposeAndDeclaredValue
    - bash test.sh behat orderReferenceNumber
    - bash test.sh behat orderWaybill
    - bash test.sh behat orderTax
    - bash test.sh behat orderTracking
    - bash test.sh behat orderUserNotFullyRegistered
    - bash test.sh behat orderWithSalesMargin
    - bash test.sh behat tradeDocument
    - bash test.sh behat invoice
    - bash test.sh behat invoicePayByPrepaid
  tags:
    - area51-1

valid-3:
  stage: test & preview
  services:
    - mysql:5.7
    - schickling/mailcatcher
  script:
    - bash prepare-database.sh all
    - bash test.sh behat userAuth
    - bash test.sh behat userEdit
    - bash test.sh behat userRegistration
    - bash test.sh behat userPaymentList
    - bash test.sh behat userInvoices
    - bash test.sh behat userOrderCancel
    - bash test.sh behat partnerProgram
    - bash test.sh behat pickupListProtocols
    - bash test.sh behat ordersList
    - bash test.sh behat ordersStatistic
    - bash test.sh behat ordersCashOnDelivery
    - bash test.sh behat customsDocument
    - bash test.sh behat productTemplate
    - bash test.sh behat orderDraft
  tags:
    - area51-1

valid-4:
  stage: test & preview
  services:
    - mysql:5.7
  script:
    - bash prepare-database.sh all
    - bash test.sh behat adminCarrierConfigs
    - bash test.sh behat adminCountryZone
    - bash test.sh behat adminFuelSurcharges
    - bash test.sh behat adminOnlineProviders
    - bash test.sh behat adminOrderCancel
    - bash test.sh behat adminPdfFile
    - bash test.sh behat adminProductAddon
    - bash test.sh behat adminProductAddonSort
    - bash test.sh behat adminProductLabel
    - bash test.sh behat adminProductParameters
    - bash test.sh behat adminProductPrices
    - bash test.sh behat adminProductPriceHash
    - bash test.sh behat adminReportUserSettlements
    - bash test.sh behat adminUserDelete
    - bash test.sh behat adminUserPutAccountManager
    - bash test.sh behat adminUserRegistrationLink
    - bash test.sh behat adminUserInvoices
    - bash test.sh behat adminCustomDocument
  tags:
    - area51-1

valid-5:
  stage: test & preview
  services:
    - mysql:5.7
  script:
    - apt-get update
    - apt-get upgrade -y
    - bash prepare-database.sh all
    - bash test.sh behat integrationPlatform
    - bash test.sh behat tradePlatform
  tags:
    - area51-1

deprecated-problematic:
  stage: test & preview
  services:
    - mysql:5.7
    - schickling/mailcatcher
  script:
    - bash prepare-database.sh all
    - bash test.sh behat problematicScenarios
  tags:
    - area51-1

deprecated-other:
  stage: test & preview
  services:
    - mysql:5.7
    - schickling/mailcatcher
  script:
    - bash prepare-database.sh all
    - bash test.sh behat allegro
    - bash test.sh behat order
    - bash test.sh behat other
    - bash test.sh behat product
    - bash test.sh behat registration
  tags:
    - area51-1

deprecated-user:
  stage: test & preview
  services:
    - mysql:5.7
    - schickling/mailcatcher
  script:
    - bash prepare-database.sh all
    - bash test.sh behat user
  tags:
    - area51-1
$PREVIEW_CONTAINER_WEB bash -c 'find -delete'"
$PREVIEW_HOST:$PREVIEW_DIR
$PREVIEW_SLUG $PREVIEW_DIR $DB_CONFIGURATION"
spec:
  stage: test & preview
  services:
    - mysql:5.7
  script:
    - bash prepare-database.sh all
    - bash test.sh spec
  tags:
    - area51-1

P粉771233336
P粉771233336

reply all(1)
P粉199248808

I spoke with Zoho IT and they said it no longer works and we need to use another code.

They provided me with this link: https://www.zoho.com/crm/developer/docs/csharp-sdk/v2/record-samples.html?src=create_records

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template