AWS CodePipeline custom stage to read config file and call external service endpoint

0

Hi All,

I'm using AWS CodePipeline with CodeBuild & CodeCommit . I want to add custom stage and there I need to read configuration file & send that data to external service endpoint. Is there any option to achieve this using CodePipeline?

Please guide me through this.

질문됨 2년 전378회 조회
1개 답변
0

You can use another CodeBuild stage with a standard Linux image provided by AWS (ex: aws/codebuild/standard:6.0 which is an Ubuntu 22.04) and do any commands you need. For example:

version: 0.2
env:
  shell: bash

phases:
  pre_build:
    commands:
      - aws s3 cp s3://<myconfigbucket>/<myconfigfile> # get a config file
      - $(<command to parse config file or any other action needed>)

  build:
    commands:
      - curl -X POST -d 'key1=value1' -d 'key2=value2' https://example.com/fake.php

This is just an example, you can put any bash command you need to match your use case.

profile picture
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠