Сбой gcloud (OSError): [Errno 2] Нет такого файла или каталога: '/opt/atlassian/pipelines/agent/build/.env' - PullRequest
0 голосов
/ 08 января 2020

Я недавно переключил свое приложение Laravel из среды GAE flex в среду Standard, мои сборки работали довольно хорошо, однако теперь, когда я запускаю скрипт автоматического развертывания из Bitbucket, я получаю ошибку

'Сбой gcloud (OSError): [Errno 2] Нет такого файла или каталога:' /opt/atlassian/pipelines/agent/build/.env''

Как бы то ни было, моя сборка выполняется через DEVapp.yaml файл и не требует файла .env, и не делал этого в прошлом. Я не совсем уверен, что могло послужить причиной этой ошибки, хотя включены все предполагаемые связанные файлы;

DEVapp.yaml

runtime: php72  # language of the app
# This sample incurs costs to run on the App Engine flexible environment.
# The settings below are to reduce costs during testing and are not appropriate
# for production use. For more information, see:
# https://cloud.google.com/appengine/docs/flexible/nodejs/configuring-your-app-with-app-yaml
runtime_config:
  document_root: public
env_variables:
  #Put production environment variables here.
  APP_ENV: production   # or production
  APP_DEBUG : true # or false
  APP_KEY: xxxxxxxxx
  APP_STORAGE: /tmp
  VIEW_COMPILED_PATH: /tmp
#go to generate app key paragraf in this tutorial
  SESSION_DRIVER : cookie
  APP_TIMEZONE: UTC
# follow the part of the tutorial on setting up your SQL database
  DB_CONNECTION: mysql
  DB_HOST: localhost
  DB_DATABASE: xxxxxxxxx
  DB_USERNAME: xxxxxxxxx
  DB_PASSWORD: xxxxxxxxx
  DB_SOCKET: xxxxxxxxx
  MAIL_DRIVER: xxxxxxxxx
  MAILJET_APIKEY: xxxxxxxxx
  MAILJET_APISECRET: xxxxxxxxx
  MAIL_FROM_ADDRESS: xxxxxxxxx
  MAIL_FROM_NAME: xxxxxxxxx
beta_settings:
    # for Cloud SQL, set this value to the Cloud SQL connection name,
    # e.g. "project:region:cloudsql-instance"
    cloud_sql_instances: xxxxxxxxx

Сборка конвейера

# Check our guides at https://confluence.atlassian.com/x/e8YWN for more examples.
# Only use spaces to indent your .yml configuration.
# You can specify a custom docker image from Docker Hub as your build environment.
# run composer check-platform-reqs for a list of required extensions.
image: php:7.2-fpm
pipelines:
  default:
    - step:
        name: Test
        caches:
          - composer
        artifacts:
          - storage/**
          - vendor/**
          - public/**
          - .env
        script:
          #Update Image
          - apt-get update

          #Install Zip
          - apt-get install -qy zlib1g-dev zip unzip
          - docker-php-ext-install zip

          #Install Git
          - apt-get install -qy git
          - apt-get install -qy curl

          #Install MySqlPDO
          - docker-php-ext-install pdo_mysql

          #Install Crypt
          - apt-get install -qy libmcrypt-dev
          - yes | pecl install mcrypt-1.0.1

          #Install Composer Platform Reqs
          - docker-php-ext-install bcmath

          #Required GD extensions
          #- apt-get install -qy php7.2-gd
          #- docker-php-ext-install gd
          #- sudo apt-get install php7.2-intl
          #- sudo apt-get install php7.2-xsl
          # Installing first the libraries necessary to configure and install gd
          - apt-get update && apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev
          # Now we can configure and install the extension
          - docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
          - docker-php-ext-install -j$(nproc) gd

          #Copy Environment File
          - ln -f -s .env.pipelines .env

          #Install Composer
          - curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
          - composer install

          #Migrate Database
          #- php artisan key:generate
          - php artisan migrate

          #Run Test Suite
          - ./vendor/bin/phpunit --verbose
        services:
          #Add MySql Database
          - mysql
# Additional Manual Step for Deployer if Needed.
# Otherwise move "artisan deploy..." to testing step so deployment is automatic.

#STAGING DEPLOYMENT SCRIPT
    - step:
        name: Deploy to Staging
        deployment: staging
        trigger: manual
        script:
          #Update Image
          - apt-get update
           #Install Zip
          - apt-get install -qy zlib1g-dev zip unzip
          - docker-php-ext-install zip

          #Install Git
          - apt-get install -qy git
          - apt-get install -qy curl

          #Install MySql
          #- apt-get install -qy mysql-client
          - docker-php-ext-install pdo_mysql

          #Install Crypt
          - apt-get install -qy libmcrypt-dev
          - yes | pecl install mcrypt-1.0.1

          #Install Composer Platform Reqs
          - docker-php-ext-install bcmath

          #Required GD extensions
          #- apt-get install -qy php7.2-gd
          #- docker-php-ext-install gd
          #- sudo apt-get install php7.2-intl
          #- sudo apt-get install php7.2-xsl
          # Installing first the libraries necessary to configure and install gd
          - apt-get update && apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev
          # Now we can configure and install the extension
          - docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
          - docker-php-ext-install -j$(nproc) gd

          #Copy Environment File
          - ln -f -s .env.pipelines .env

          #Install Composer
          - curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
          - composer install

          # Install Google Cloud SDK
          - export CLOUDSDK_CORE_DISABLE_PROMPTS=1
          # Google Cloud SDK is pinned for build reliability. Bump if the SDK complains about deprecation.
          - SDK_VERSION=127.0.0
          - SDK_FILENAME=google-cloud-sdk-${SDK_VERSION}-linux-x86_64.tar.gz
          - curl -O -J https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/${SDK_FILENAME}
          - tar -zxvf ${SDK_FILENAME} --directory ${HOME}
          - export PATH=${PATH}:${HOME}/google-cloud-sdk/bin

          - pipe: atlassian/google-app-engine-deploy:0.5.1
            variables:
                  KEY_FILE: $KEY_FILE_DEV
                  PROJECT: $PROJECT_DEV
                  DEPLOYABLES: 'DEVapp.yaml'  ```

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...