Skip to content

Commit

Permalink
Merge pull request #185 from stelligent/issue-184
Browse files Browse the repository at this point in the history
Bug fixes
  • Loading branch information
cplee committed Oct 9, 2017
2 parents be08a38 + a9c2875 commit 32e39bc
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 73 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.1
1.0.2
2 changes: 1 addition & 1 deletion examples/basic/mu.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---

environments:
- name: dev
- name: acceptance
cluster:
maxSize: 2
- name: production
Expand Down
3 changes: 2 additions & 1 deletion provider/aws/roleset.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ func (rolesetMgr *iamRolesetManager) UpsertEnvironmentRoleset(environmentName st
}
}
if environment == nil {
return fmt.Errorf("unable to find environment named '%s' in configuration", environmentName)
log.Warningf("unable to find environment named '%s' in configuration...skipping IAM roles", environmentName)
return nil
}

stackName := common.CreateStackName(rolesetMgr.context.Config.Namespace, common.StackTypeIam, "environment", environmentName)
Expand Down
2 changes: 1 addition & 1 deletion provider/aws/roleset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ func TestIamRolesetManager_UpsertEnvironmentRoleset(t *testing.T) {
}

err := i.UpsertEnvironmentRoleset("env1")
assert.NotNil(err)
assert.Nil(err)
stackManagerMock.AssertExpectations(t)
stackManagerMock.AssertNumberOfCalls(t, "UpsertStack", 0)

Expand Down
110 changes: 55 additions & 55 deletions templates/assets.go

Large diffs are not rendered by default.

19 changes: 8 additions & 11 deletions templates/assets/pipeline-iam.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Resources:
Effect: Allow
Resource:
- !Sub 'arn:aws:codebuild:${AWS::Region}:${AWS::AccountId}:project/${Namespace}-pipeline-${ServiceName}-*'
- !If
- Fn::If:
- IsCodeCommit
- Action:
- codecommit:GetBranch
Expand Down Expand Up @@ -129,15 +129,15 @@ Resources:
- Action:
- iam:PassRole
Resource:
- !If
- Fn::If:
- IsBuildEnabled
- !GetAtt CodeBuildCIRole.Arn
- !Ref AWS::NoValue
- !If
- Fn::If:
- IsAcptEnabled
- !GetAtt CodeBuildCDAcptRole.Arn
- !Ref AWS::NoValue
- !If
- Fn::If:
- IsProdEnabled
- !GetAtt CodeBuildCDProdRole.Arn
- !Ref AWS::NoValue
Expand All @@ -148,15 +148,15 @@ Resources:
Properties:
PolicyName: codepipeline-access
Roles:
- !If
- Fn::If:
- IsBuildEnabled
- !Ref CodeBuildCIRole
- !Ref AWS::NoValue
- !If
- Fn::If:
- IsAcptEnabled
- !Ref CodeBuildCDAcptRole
- !Ref AWS::NoValue
- !If
- Fn::If:
- IsProdEnabled
- !Ref CodeBuildCDProdRole
- !Ref AWS::NoValue
Expand Down Expand Up @@ -268,10 +268,7 @@ Resources:
- s3:GetObjectVersion
- s3:PutObject
Resource:
- !Sub
- arn:aws:s3:::${BucketName}/*
- BucketName:
Fn::ImportValue: !Sub ${Namespace}-bucket-codedeploy
- !Sub arn:aws:s3:::mu-codedeploy-${AWS::Region}-${AWS::AccountId}/*
Effect: Allow


Expand Down
6 changes: 3 additions & 3 deletions templates/assets/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ Resources:
- RepositoryName: !Ref SourceRepo
BranchName: !Ref SourceBranch
RunOrder: 1
- !If
- Fn::If:
- IsBuildEnabled
- Name: Build
Actions:
Expand Down Expand Up @@ -365,7 +365,7 @@ Resources:
ProjectName: !Ref CodeBuildImage
RunOrder: 2
- !Ref AWS::NoValue
- !If
- Fn::If:
- IsAcptEnabled
- Name: Acceptance
Actions:
Expand Down Expand Up @@ -396,7 +396,7 @@ Resources:
ProjectName: !Ref TestAcceptance
RunOrder: 2
- !Ref AWS::NoValue
- !If
- Fn::If:
- IsProdEnabled
- Name: Production
Actions:
Expand Down

0 comments on commit 32e39bc

Please sign in to comment.