![rsync를 사용하여 bitbucket 파이프라인을 실행할 때 서버에 특정 파일을 유지합니다.](https://linux55.com/image/224537/rsync%EB%A5%BC%20%EC%82%AC%EC%9A%A9%ED%95%98%EC%97%AC%20bitbucket%20%ED%8C%8C%EC%9D%B4%ED%94%84%EB%9D%BC%EC%9D%B8%EC%9D%84%20%EC%8B%A4%ED%96%89%ED%95%A0%20%EB%95%8C%20%EC%84%9C%EB%B2%84%EC%97%90%20%ED%8A%B9%EC%A0%95%20%ED%8C%8C%EC%9D%BC%EC%9D%84%20%EC%9C%A0%EC%A7%80%ED%95%A9%EB%8B%88%EB%8B%A4..png)
WordPress 사이트를 호스팅하는 서버에 대한 rsync용 비트버킷 파이프라인 설정이 있습니다. 서버의 파일에는 처음에 wp-config.php 및 wp-config-sample.php가 포함된 WordPress 웹 사이트 뼈대가 있지만 다른 모든 wp 파일은 전송됩니다.
파이프라인을 실행할 때 파이프라인이 실행된 후 wp-config 및 wp-config-sample이 서버에 남아 있는지 어떻게 확인합니까(gitignore에 wp-config.php가 있으므로 전송되지 않습니다)
파이프라인 코드는 다음과 같습니다.
# pipelines deployment configuration
# -----
# Staging deployment happens with every push of the development branch.
#
# To run the Production deployment, access the repository > latest commit page,
# click on "Run Pipeline" and select "Custom: Production" from the dropdown.
# -----
# DO NOT change any of the variables below. To set them go to: PROJECT > Settings > Pipelines > Repository Variables
# Make sure the development branch is correctly named below - "develop" is being used below
image: node:10.15.3
pipelines:
branches:
develop: #name of the development branch
- step:
script:
- pipe: atlassian/rsync-deploy:0.3.1
variables:
USER: $STAGING_USER
SERVER: ''
REMOTE_PATH: $STAGING_PATH
LOCAL_PATH: './'
EXTRA_ARGS: '-p --exclude-from=exclude-pipelines.txt'
- ssh $STAGING_USER@ "find $STAGING_FOLDER. -type d -print0 | xargs -0 chmod 0755"
- ssh $STAGING_USER@ "find $STAGING_FOLDER. -type f -print0 | xargs -0 chmod 0644"
main: #name of the development branch
- step:
script:
- pipe: atlassian/rsync-deploy:0.3.1
variables:
USER: $PRODUCTION_USER
SERVER: ''
REMOTE_PATH: $PRODUCTION_PATH
LOCAL_PATH: './'
EXTRA_ARGS: '-p --exclude-from=exclude-pipelines.txt'
- ssh $PRODUCTION_USER@ "find public_html/. -type d -print0 | xargs -0 chmod 0755"
- ssh $PRODUCTION_USER@ "find public_html/. -type f -print0 | xargs -0 chmod 0644"
custom:
Production:
- step:
script:
- pipe: atlassian/rsync-deploy:0.3.1
variables:
USER: $PRODUCTION_USER
SERVER: ''
REMOTE_PATH: $PRODUCTION_PATH
LOCAL_PATH: './'
EXTRA_ARGS: '-p --exclude-from=exclude-pipelines.txt'
- ssh $PRODUCTION_USER@ "find public_html/. -type d -print0 | xargs -0 chmod 0755"
- ssh $PRODUCTION_USER@ "find public_html/. -type f -print0 | xargs -0 chmod 0644"