0

I would like to pass details from my build pipeline down to my powershell script. Is this possible?

This is a snippet of what I am trying to do (incomplete so don't worry about how I handle the response)

import boto3, time,sys, os
client = boto3.client('ssm', region_name='my-region')
def deployment(instanceId):
    repoName = os.environ.get('RepoName', '')
    branchName = os.environ.get('BranchName', '')
    commitId = os.environ.get('CommitId', '')
    buildConfigName = os.environ.get('BuildConfigName', '') 
    buildFileName = os.environ.get('BuildFileName', 'run_commands.txt')  

    f = open(buildFileName, "r")
    data = f.readlines()
    response = client.send_command(
        Targets=[{"Key":"InstanceIds","Values":[instanceId]}],
        DocumentName='AWS-RunPowerShellScript',
        DocumentVersion='1',
        TimeoutSeconds=600,
        Comment='string',
        Parameters={
            'commands': data,
            'args': [repoName, branchName, commitId, buildConfigName] ????? Is there some way to do this
        },
        MaxConcurrency='50',
        MaxErrors='0',
    )

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.