Push a folder from Bitbucket repo to public server using Pipelines

后端 未结 3 837
长发绾君心
长发绾君心 2021-02-09 13:57

I have pipelines enabled in my Bitbucket repository and I need to run Angular 2 build and deploy the dist folder (which gets created after the build command is executed) in my s

3条回答
  •  失恋的感觉
    2021-02-09 14:39

    1. Write this in bitbucket-pipelines.yml

    image: node:8.7.0
    pipelines:
      default:
        - step:
            name: Installation
            caches:
              - node
            script:
              - npm install
        - step:
            name: Building
            script:
              - npm install -g @angular/cli #need to install angular-cli to make build
              - npm run build --aot
        - step:
            name: Deployment
            script:
              - apt-get update
              - apt-get install ncftp
              - ncftpput -v -u "$FTP_USERNAME" -p "$FTP_PASSWORD" -R $FTP_HOST $FTP_SITE_ROOT dist/*
              - echo Finished uploading /dist files to $FTP_HOST$FTP_SITE_ROOT
    

    2. Configure your bitbucket environment variables

提交回复
热议问题