1

I have setup the CICD pipeline in bitbucket and I have amplify the folder in the repository to get the backend configuration. Right now I have setup the development environment and works fine. Existing bitbucket-pipeline.yml

pipelines:
  default:
      - step:
          name: 'Install NPM and Angular'
          script:
            - npm update -g
            - npm install npm@latest -g
            - npm install -g @angular/cli
      - step:
          name: 'Build project'
          script:
            -  npm install --force
            -  npm run build
            -  echo "Build Success"
  custom:
    Build:
      - step:
          name: 'Install NPM and Angular'
          script:
            - npm update -g
            - npm install npm@latest -g
            - npm install -g @angular/cli
      - step:
          name: 'Build project'
          script:
            -  cd dist
            -  npm install --force
            -  npm run build
            -  echo "Build Success" 

but I need to add production and development in the same repository.

Without amplify folder how to configure in the bitbucket pipeline when I try this I got this exception.

 + amplify configure --amplifyAppId '$AMPLIFY_APP_ID' --envName development --region 'dev'
Downloading release from https://package.cli.amplify.aws/11.0.2/amplify-pkg-linux-x64.tgz
amplify has been installed!
11.0.2
Follow these steps to set up access to your AWS account:
Sign in to your AWS administrator account:
https://console.aws.amazon.com/
Press Enter to continue

New bitbucket-pipelines.yml

pipelines:
  branches:
    production:
      - step:
          name: Deploy to production
          deployment: production
          caches:
            - node
          script:
            - npm install -g @aws-amplify/cli
            - amplify configure --amplifyAppId ${AMPLIFY_APP_ID} --envName development --region ${AWS_REGION}
            - amplify pull
            - npm run build
    Test:
      - step:
          name: Deploy to Test
          deployment: Test
          caches:
            - node
          script:
            - npm install -g @aws-amplify/cli
            - amplify configure --amplifyAppId ${AMPLIFY_APP_ID} --envName development --region ${AWS_REGION}

Do we need to add multiple amplify folders for development and production ?

  • 1
    Please do not paste images of code nor errors, paste them as text. Also, please share the meaningful part of your bitbucket-pipelines.yml to understand what have you tried so far. Is the development deployment already working on BB pipelines? – N1ngu Mar 23 '23 at 10:35
  • yes development working fine with amplify folder @N1ngu – krishnakumar Balasubramaniam Mar 23 '23 at 10:50
  • 1
    From the docs, `amplify configure` seems not adequate for usage in a CI system https://docs.amplify.aws/cli/start/install/#configuring-the-amplify-cli, only for local usage. – N1ngu Mar 23 '23 at 10:58
  • how can we setup cicd pipeline for multiple amplify – krishnakumar Balasubramaniam Mar 23 '23 at 11:03
  • Late to this but there is documentation around running Amplify in a headless mode for CI/CD - https://docs.amplify.aws/cli/usage/headless/ – zombiehugs May 12 '23 at 00:34

0 Answers0