1) Using SCP to Transport Artifacts
Bài này chúng ta thực hiện pull về xong copy or scp vào file and folder vào server.
Bên dưới là code
pipelines: branches: lesson-2: - step: name: Somewhat fake build process script: - rsync -av --progress . dist --exclude dist artifacts: - dist/** - step: name: Deploy dist folder to server via SCP script: - pipe: atlassian/scp-deploy:0.3.3 variables: USER: $USER SERVER: $SERVER REMOTE_PATH: '/var/www/skillshare-scp-test' LOCAL_PATH: 'dist/*'
nhắc lại 1 chút về artifacts
nó sẽ giúp bạn move data giữa các step trong trong bitbucket.

Bạn cần tạo các variables









2) Using SSH to Run Commands on the Server
Chúng ta có thể ssh vào server khác.
pipelines: branches: lesson-3: - step: name: Somewhat fake build process script: - rsync -av --progress . dist --exclude dist artifacts: - dist/** - step: name: Deploy dist folder to server via SCP script: - pipe: atlassian/scp-deploy:0.3.3 variables: USER: $USER SERVER: $SERVER REMOTE_PATH: '/var/www/skillshare-scp-test' LOCAL_PATH: 'dist/*' - step: name: Statically serve via server-handler and expose it to internet via ngrok script: - ssh $USER@$SERVER 'cd /var/www/skillshare-scp-test && /bin/bash deploy.sh'