I have an appspec.yml file which defines where to deploy the build. (Bitbucket > AWS S3 > AWS Codedeploy > aws EC2 instance)
version: 0.0os:
linux files: - source: /
destination: /var/www/vhosts/<domain>
I want the .php file to be deployed in /var/www/vhosts/<domain>/httpdocs directory?
Can I achieve that using appspec.yml or in bitbucket-pipeline.yml? Thank you in advance!
my .yml:
image: atlassian/default-image:latest
pipelines:
default:
- step:
name: Install dependencies
image: composer
caches:
- composer
script:
- apt-get update && apt-get install -y unzip
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- composer install --ignore-platform-reqs
- step:
name: Deploy to Staging
deployment: Staging
# trigger: manual # Uncomment to make this a manual step
script:
- apt-get update
- apt-get install -y zip
- apt-get install -y git
- git clone https://username@bitbucket.org/repository/projectgit
- zip -r application1.zip .
- pipe: atlassian/aws-code-deploy:0.5.3
variables:
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
APPLICATION_NAME: $APPLICATION_NAME
S3_BUCKET: $S3_BUCKET
COMMAND: 'upload'
ZIP_FILE: 'application1.zip'
VERSION_LABEL: 'my-app-1.0.0'
- pipe: atlassian/aws-code-deploy:0.5.3
variables:
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
APPLICATION_NAME: $APPLICATION_NAME
DEPLOYMENT_GROUP: $DEPLOYMENT_GROUP
S3_BUCKET: $S3_BUCKET
COMMAND: 'deploy'
WAIT: 'true'
VERSION_LABEL: 'my-app-1.0.0'
IGNORE_APPLICATION_STOP_FAILURES: 'true'
FILE_EXISTS_BEHAVIOR: 'OVERWRITE'
- step:
name: Manual Step Deploy to PROD
image: php:7.2-cli
deployment: Production
trigger: manual
script:
- echo "This step runs once you click the 'Run' button"
PS: not sure why the yml is not indented. I tried copying from notepad++. sublime text but same output.
For meantime, I deployed all files in httpdocs directory. I edited my appspec.yml file.
version: 0.0
os: linux
files: - source: /
destination: /var/www/vhosts/<domain>/httpdocs/
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.