Skip to content

Commit

Permalink
Merge pull request #6 from brettswift/feature/namespace_alter
Browse files Browse the repository at this point in the history
Make step namespaces match the groupings in the AWS console for simpl…
  • Loading branch information
brettswift committed Aug 30, 2018
2 parents 967da46 + 9398657 commit 7f133e9
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion cumulus/chain/chaincontext.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def template(self):
def metadata(self):
"""
Steps can write data here to be used later in the chain.
Example: Code development initial step might create an s3 bucket
Example: Code dev_tools initial step might create an s3 bucket
Subsequent steps might want to reference this.
It could be a string, or even a troposphere Ref object.
:return:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
META_PIPELINE_BUCKET_REF = 'development-bucket-Ref'
META_PIPELINE_BUCKET_REF = 'dev_tools-bucket-Ref'

# Use this to get a Ref object to gain access to the pipeline bucket
META_PIPELINE_BUCKET_POLICY_REF = 'pipeline-bucket-access-policy-Ref'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import cumulus.types.codebuild.buildaction
import cumulus.util.tropo
from cumulus.chain import step
from cumulus.steps.development import META_PIPELINE_BUCKET_POLICY_REF
from cumulus.steps.dev_tools import META_PIPELINE_BUCKET_POLICY_REF


class ApprovalAction(step.Step):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

from cumulus.chain import step

from cumulus.steps.development import META_PIPELINE_BUCKET_POLICY_REF, \
from cumulus.steps.dev_tools import META_PIPELINE_BUCKET_POLICY_REF, \
META_PIPELINE_BUCKET_REF


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import awacs.iam

from cumulus.chain import step
import cumulus.steps.development
import cumulus.steps.dev_tools

from troposphere import codepipeline, Ref, iam
from troposphere.s3 import Bucket, VersioningConfiguration
Expand Down Expand Up @@ -102,8 +102,8 @@ def handle(self, chain_context):

chain_context.template.add_resource(pipeline_bucket_access_policy)
# pipeline_bucket could be a string or Join object.. unit test this.
chain_context.metadata[cumulus.steps.development.META_PIPELINE_BUCKET_REF] = Ref(pipeline_bucket)
chain_context.metadata[cumulus.steps.development.META_PIPELINE_BUCKET_POLICY_REF] = Ref(pipeline_bucket_access_policy)
chain_context.metadata[cumulus.steps.dev_tools.META_PIPELINE_BUCKET_REF] = Ref(pipeline_bucket)
chain_context.metadata[cumulus.steps.dev_tools.META_PIPELINE_BUCKET_POLICY_REF] = Ref(pipeline_bucket_access_policy)

pipeline_policy = iam.Policy(
PolicyName="%sPolicy" % self.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import cumulus.policies
import cumulus.policies.codebuild
from cumulus.chain import step
from cumulus.steps.development import META_PIPELINE_BUCKET_POLICY_REF
from cumulus.steps.dev_tools import META_PIPELINE_BUCKET_POLICY_REF
from cumulus.types.codebuild.buildaction import SourceS3Action
from cumulus.util.tropo import TemplateQuery

Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions tests/stacker_test/blueprints/pipeline_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
import troposphere.codebuild

from cumulus.chain import chain, chaincontext
from cumulus.steps.development import pipeline, code_build_action, pipeline_stage, pipeline_source_action
from cumulus.steps.development.approval_action import ApprovalAction
from cumulus.steps.dev_tools import pipeline, code_build_action, pipeline_stage, pipeline_source_action
from cumulus.steps.dev_tools.approval_action import ApprovalAction


class PipelineSimple(Blueprint):
"""
An example development that doesn't do anything interesting.
An example dev_tools that doesn't do anything interesting.
"""

VARIABLES = {
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/steps/test_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
from troposphere import codepipeline, codebuild

from cumulus.chain import chaincontext
from cumulus.steps.development import pipeline, code_build_action
from cumulus.steps.development.vpc_config import VpcConfig
from cumulus.steps.dev_tools import pipeline, code_build_action
from cumulus.steps.dev_tools.vpc_config import VpcConfig
from cumulus.util.tropo import TemplateQuery


Expand Down Expand Up @@ -42,7 +42,7 @@ def tearDown(self):
# sut.handle(self.context)
# self.assertIsInstance(sut, step.Step)
# self.assertTrue(
# expr=(cumulus.steps.development.META_LAST_STAGE_OUTPUT in self.context.metadata),
# expr=(cumulus.steps.dev_tools.META_LAST_STAGE_OUTPUT in self.context.metadata),
# msg="Expected Pipeline would set output artifact"
# )

Expand Down Expand Up @@ -70,7 +70,7 @@ def test_pipeline_has_two_stages(self):
#
# found_pipeline = TemplateQuery.get_resource_by_type(t, codepipeline.Pipeline)[0]
# stages = found_pipeline.properties['Stages']
# self.assertTrue(len(stages) == 2, msg="Expected Code Build to add a stage to the development")
# self.assertTrue(len(stages) == 2, msg="Expected Code Build to add a stage to the dev_tools")

def test_code_build_should_not_add_vpc_config(self):

Expand Down

0 comments on commit 7f133e9

Please sign in to comment.