Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Bitbucket Aws codeartifact pipeline

mohsin ijaz
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 15, 2021

I am using the bitbucket pipeline to publish the artifacts to AWS code artifact, everything is running perfectly but 12 hours validity of the token needs me to update the password every time. Could anyone guide me on how I can automate this process?

Any help will be greatly appreciated.

1 answer

8 votes
mohsin ijaz
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 17, 2021
pipelines:
  default:
    - step:
        name: test
        image: atlassian/pipelines-awscli
        script:
           - export AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID
           - export AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY
           - export AWS_DEFAULT_REGION=$AWS_DEFAULT_REGION
           - aws codeartifact get-authorization-token --domain XXXXX --domain-owner XXXXXx --query authorizationToken --output text > pass.txt
           - value=$(<pass.txt)
           - echo $value
           - echo "export value=$value" set_env.sh

           - printenv > set_env.sh 

        artifacts:
           - set_env.sh
     
              
    - step:
        name: maven
        image: maven:3.8.1
        caches:
          - maven
        script: # Modify the commands below to build your repository.
         
          - source set_env.sh
          - echo $value
          - sed -i 's/passwd12/'"$value"'/g' ./settings.xml
          - cat settings.xml
          - mvn clean deploy -s settings.xml -P snapshot

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events