Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How can I copy a file to a specific directory after deployment? Edited

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.

1 answer

1 accepted

0 votes
Answer accepted

For meantime, I deployed all files in httpdocs directory. I edited my appspec.yml file.

version0.0

oslinux 

files: - source/

destination/var/www/vhosts/<domain>/httpdocs/

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket Pipelines

What We Learned When We Researched Open Source Vulnerabilities in 7 Popular Coding Languages

...hey are a part of us, shaping how we interact with the world around us. The same holds true for programming languages when we think about how different kinds of vulnerabilities raise their heads in t...

1,328 views 0 3
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you