Code Monkey home page Code Monkey logo

codestar's Introduction

codestar cli bootstrap with toolchain and source

create a src object

cd src/HelloFargate/; zip -r "../HelloFargate.zip" *; cd ../..

bootstrap a codestar template from a toolchain and source

Create an init file with cli

aws codestar create-project --generate-cli-skeleton |jq .
{
  "name": "",
  "id": "",
  "description": "",
  "clientRequestToken": "",
  "sourceCode": [
    {
      "source": {
        "s3": {
          "bucketName": "",
          "bucketKey": ""
        }
      },
      "destination": {
        "codeCommit": {
          "name": ""
        },
        "gitHub": {
          "name": "",
          "description": "",
          "type": "",
          "owner": "",
          "privateRepository": true,
          "issuesEnabled": true,
          "token": ""
        }
      }
    }
  ],
  "toolchain": {
    "source": {
      "s3": {
        "bucketName": "",
        "bucketKey": ""
      }
    },
    "roleArn": "",
    "stackParameters": {
      "KeyName": ""
    }
  },
  "tags": {
    "KeyName": ""
  }
}

Modify init template to suit your needs (note that you'll use github or codecommit for the sourcecode. You may remove other paramaters as needed eg clientRequestToken):

cat /tmp/init-template.json

{
  "name": "YoFargate",
  "id": "yofargate",
  "description": "Make Applications Great Again",
  "sourceCode": [
    {
      "source": {
        "s3": {
          "bucketName": "yourcodestarsourcebucket",
          "bucketKey": "templates/codestar/src/HelloFargate.zip"
        }
      },
      "destination": {
        "codeCommit": {
          "name": "yofargate"
        }
      }
    }
  ],
  "toolchain": {
    "source": {
      "s3": {
        "bucketName": "yourcodestarsourcebucket",
        "bucketKey": "templates/codestar/toolchain.json"
      }
    },
    "roleArn": "yourcodestarservicerolearn",
    "stackParameters": {
      "ProjectId": "yofargate"
    }
  },
  "tags": {
    "Application": "yofargate"
  }
}

Create your new codestar project

aws codestar create-project --cli-input-json file:///tmp/init-template.json

Hint: if you get this error:

An error occurred (AccessDeniedException) when calling the CreateProject operation: Cross-account pass role is not allowed.

check the init template and make sure the toolchain roleArn exists and is correct (account number?)

test or modify the toolchain of existing codestar project

modify toolchain cft template and then updating the toolchain stack with cli:

aws cloudformation deploy --stack-name codestar-toolchain-test --template-file toolchain.json --parameter-overrides ProjectId=shalomfargate --tags Application=shalomfargate [email protected] Environment=Test Source=`git remote -v |grep fetch | awk '{print $2}'` --capabilities CAPABILITY_NAMED_IAM

toolchain and source

Must be stored in s3 so make an s3 available to your accounts. upload toolchain.json (diff names if you want diff toolchains) and a source object, cf cli tutorial

toolchain

This sample toolchain creates a pipeline that builds an application. It includes a general purpose build environment that can synthesize cloudformation from cdk and evaluate the resulting cloud formation templates with cfn nag. It follows a pattern of build, test, create change set and finally deploy change set.

permission boundaries

Toolchain contains several iam resources attached to codepipeline stages. They need to be configured to have the permissions needed to build whatever is being built by codepipeline stages. Note the permission boundaries confine resources to awscodestar-$ProjectId*.

source

This is the source for the application. src directory contains a sample app using fargate deployed from cloduformation generated by cdk.

deletion

delete stacks created by toolchain pipeline delete toolchain artifact bucket delete toolchain stack

codestar's People

Stargazers

bombel avatar Andrew Cockrell avatar

Watchers

James Cloos avatar Eric Odell avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.