Advertisement
Guest User

Untitled

a guest
Jun 12th, 2017
1,257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 47.98 KB | None | 0 0
  1. https://aws.amazon.com/amazon-linux-ami/2017.03-release-notes/
  2. [ec2-user@ip-10-0-1-250 ~]$
  3. [ec2-user@ip-10-0-1-250 ~]$
  4. [ec2-user@ip-10-0-1-250 ~]$
  5. [ec2-user@ip-10-0-1-250 ~]$
  6. [ec2-user@ip-10-0-1-250 ~]$
  7. [ec2-user@ip-10-0-1-250 ~]$
  8. [ec2-user@ip-10-0-1-250 ~]$ ls
  9. AWSsummit
  10. [ec2-user@ip-10-0-1-250 ~]$ cd  AWSsummit/
  11. [ec2-user@ip-10-0-1-250 AWSsummit]$ ls
  12. AWSsummit  lab-2-pipeline
  13. [ec2-user@ip-10-0-1-250 AWSsummit]$ mv lab-2-pipeline/ ../
  14. [ec2-user@ip-10-0-1-250 AWSsummit]$ ls
  15. AWSsummit
  16. [ec2-user@ip-10-0-1-250 AWSsummit]$ cd ..
  17. [ec2-user@ip-10-0-1-250 ~]$ ls
  18. AWSsummit  lab-2-pipeline
  19. [ec2-user@ip-10-0-1-250 ~]$ cd /home/ec2-user/lab-2-pipeline/src/jenkins
  20. [ec2-user@ip-10-0-1-250 jenkins]$ ls
  21. Dockerfile  groovy-scripts
  22. [ec2-user@ip-10-0-1-250 jenkins]$ cat Dockerfile
  23. FROM awsbootcamp/jenkins
  24.  
  25. # Setup the Jenkins Plugins and copy groovy scripts
  26. COPY groovy-scripts/*.groovy /usr/share/jenkins/ref/init.groovy.d/
  27. RUN /usr/local/bin/install-plugins.sh aws-codepipeline:0.27 matrix-auth:1.4 junit:1.18 matrix-project:1.7.1
  28. [ec2-user@ip-10-0-1-250 jenkins]$ aws ecr create-repository --repository-name jenkins
  29. {
  30.     "repository": {
  31.         "registryId": "909652153136",
  32.         "repositoryName": "jenkins",
  33.         "repositoryArn": "arn:aws:ecr:us-east-1:909652153136:repository/jenkins",
  34.         "createdAt": 1497317738.0,
  35.         "repositoryUri": "909652153136.dkr.ecr.us-east-1.amazonaws.com/jenkins"
  36.     }
  37. }
  38. [ec2-user@ip-10-0-1-250 jenkins]$ export JENKINS_REPO_URI=$(aws ecr describe-repositories \
  39. > --repository-names jenkins \
  40. > --query 'repositories[].repositoryUri' --output text)
  41. [ec2-user@ip-10-0-1-250 jenkins]$ env | grep JENKINS
  42. JENKINS_REPO_URI=909652153136.dkr.ecr.us-east-1.amazonaws.com/jenkins
  43. [ec2-user@ip-10-0-1-250 jenkins]$ docker build -t ${JENKINS_REPO_URI}:lab-2-pipeline /home/ec2-user/lab-2-pipeline/src/jenkins
  44. Sending build context to Docker daemon 4.096 kB
  45. Step 1/3 : FROM awsbootcamp/jenkins
  46.  ---> 6d9bb3cd79b5
  47. Step 2/3 : COPY groovy-scripts/*.groovy /usr/share/jenkins/ref/init.groovy.d/
  48.  ---> 142013ea7b06
  49. Removing intermediate container 3674247389ed
  50. Step 3/3 : RUN /usr/local/bin/install-plugins.sh aws-codepipeline:0.27 matrix-auth:1.4 junit:1.18 matrix-project:1.7.1
  51.  ---> Running in 72ededce695c
  52. Creating initial locks...
  53.  
  54. Analyzing war...
  55.  
  56. Downloading plugins...
  57. Downloading plugin: aws-codepipeline from https://updates.jenkins.io/download/plugins/aws-codepipeline/0.27/aws-codepipeline.hpi
  58. Downloading plugin: matrix-auth from https://updates.jenkins.io/download/plugins/matrix-auth/1.4/matrix-auth.hpi
  59. Downloading plugin: junit from https://updates.jenkins.io/download/plugins/junit/1.18/junit.hpi
  60. Downloading plugin: matrix-project from https://updates.jenkins.io/download/plugins/matrix-project/1.7.1/matrix-project.hpi
  61.  > junit depends on structs:1.2
  62. Downloading plugin: structs from https://updates.jenkins.io/download/plugins/structs/latest/structs.hpi
  63.  > matrix-auth depends on icon-shim:2.0.3,cloudbees-folder:5.2.2;resolution:=optional
  64.  > matrix-project depends on junit:1.2,script-security:1.13
  65. Skipping optional dependency cloudbees-folder
  66. Downloading plugin: icon-shim from https://updates.jenkins.io/download/plugins/icon-shim/latest/icon-shim.hpi
  67. Downloading plugin: script-security from https://updates.jenkins.io/download/plugins/script-security/latest/script-security.hpi
  68.  
  69. WAR bundled plugins:
  70.  
  71.  
  72. Installed plugins:
  73. aws-codepipeline:0.27
  74. icon-shim:2.0.3
  75. junit:1.18
  76. matrix-auth:1.4
  77. matrix-project:1.7.1
  78. script-security:1.28
  79. structs:1.7
  80.  
  81. Cleaning up locks
  82.  ---> 71ca5f6b8566
  83. Removing intermediate container 72ededce695c
  84. Successfully built 71ca5f6b8566
  85. [ec2-user@ip-10-0-1-250 jenkins]$ docker images
  86. REPOSITORY                                             TAG                 IMAGE ID            CREATED             SIZE
  87. 909652153136.dkr.ecr.us-east-1.amazonaws.com/jenkins   lab-2-pipeline      71ca5f6b8566        10 seconds ago      1.02 GB
  88. <none>                                                 <none>              4592c52b4146        21 minutes ago      750 MB
  89. golang                                                 1.6                 63330314bb46        4 months ago        749 MB
  90. awsbootcamp/mustachemebase                             latest              d66168c8f79d        9 months ago        881 MB
  91. awsbootcamp/jenkins                                    latest              6d9bb3cd79b5        9 months ago        970 MB
  92. [ec2-user@ip-10-0-1-250 jenkins]$ docker push ${JENKINS_REPO_URI}:lab-2-pipeline
  93. The push refers to a repository [909652153136.dkr.ecr.us-east-1.amazonaws.com/jenkins]
  94. 85611960fcc0: Pushed
  95. 0a70bccbd2ee: Pushed
  96. 973224b25ff1: Pushed
  97. 426a6c7b9d40: Pushed
  98. f603b71cf56c: Pushed
  99. 70a307058c4f: Pushed
  100. 5c47f9f790c8: Pushed
  101. 29f98222ec61: Pushed
  102. fd754b5fc160: Pushed
  103. 592d78eb59fc: Pushed
  104. 140240618703: Pushed
  105. 0ba4f8b515e7: Pushed
  106. c02a0aff7977: Pushed
  107. e75f9dd268ba: Pushed
  108. 7f94c34f2e76: Pushed
  109. f9297671100e: Pushed
  110. 692485f0cd71: Pushed
  111. e7f30faf37db: Pushed
  112. 6eeff1cea9fa: Pushed
  113. adaee1fb0269: Pushed
  114. 751f5d9ad6db: Pushed
  115. 17587239b3df: Pushed
  116. 9e63c5bce458: Pushed
  117. lab-2-pipeline: digest: sha256:656485728654f80b80dea6fda28c6b636e3932f86dd5a35b67268198f67f54f4 size: 5131
  118. [ec2-user@ip-10-0-1-250 jenkins]$
  119. [ec2-user@ip-10-0-1-250 jenkins]$
  120. [ec2-user@ip-10-0-1-250 jenkins]$
  121. [ec2-user@ip-10-0-1-250 jenkins]$ cat /home/ec2-user/lab-2-pipeline/scripts/jenkins-ecs-service.yaml
  122. Description: "Running Container-Enabled Microservices on AWS Bootcamp: Lab 2 - Jenkins ECS Service CloudFormation Template"
  123. Resources:
  124.   JenkinsService:
  125.     Type: "AWS::ECS::Service"
  126.     Properties:
  127.       Cluster: !ImportValue JenkinsCluster
  128.       DesiredCount: "1"
  129.       Role: !ImportValue ECSServiceRoleArn
  130.       TaskDefinition: !ImportValue JenkinsTaskDefinition
  131.       DeploymentConfiguration:
  132.         MaximumPercent: 100
  133.         MinimumHealthyPercent: 0
  134.       LoadBalancers:
  135.         -
  136.           ContainerName: "jenkins"
  137.           ContainerPort: "8080"
  138.           TargetGroupArn: !ImportValue JenkinsALBTargetGroup
  139. [ec2-user@ip-10-0-1-250 jenkins]$ aws cloudformation create-stack --stack-name JenkinsService \
  140. > --template-body file:///home/ec2-user/lab-2-pipeline/scripts/jenkins-ecs-service.yaml
  141. {
  142.     "StackId": "arn:aws:cloudformation:us-east-1:909652153136:stack/JenkinsService/8541d0b0-4fd9-11e7-9378-500c28637435"
  143. }
  144. [ec2-user@ip-10-0-1-250 jenkins]$ less /home/ec2-user/lab-2-pipeline/scripts/microservice-pipeline.yaml
  145. [ec2-user@ip-10-0-1-250 jenkins]$ cat less /home/ec2-user/lab-2-pipeline/scripts/microservice-pipeline.yaml
  146. cat: less: No such file or directory
  147. Description: "Running Container-Enabled Microservices on AWS Bootcamp: Lab 2 - Microservice Pipeline CloudFormation Template"
  148.  
  149. Parameters:
  150.   MicroserviceName:
  151.     Type: "String"
  152.     Description: "The CamelCase name of the microservice"
  153.     MinLength: 2
  154.     MaxLength: 32
  155.     ConstraintDescription: "must be between 2 and 32 characters."
  156.  
  157.   RepoName:
  158.     Type: "String"
  159.     Description: "The lower case name of the microservice"
  160.     MinLength: 2
  161.     MaxLength: 32
  162.     ConstraintDescription: "must be between 2 and 32 characters."
  163.  
  164.   PortNumber:
  165.     Type: Number
  166.     Description: "The port number on the Application Load Balancer for the microservice"
  167.     MinValue: 8000
  168.     MaxValue: 9000
  169.     ConstraintDescription: "must be a number between 8000 and 9000."
  170.  
  171.   JenkinsPassword:
  172.     Type: "String"
  173.     NoEcho: "true"
  174.     AllowedPattern: "[a-zA-Z0-9]*"
  175.     Default: ""
  176.  
  177.   S3BucketName:
  178.     Type: "String"
  179.     Description: "Name of the S3 bucket where the source code is stored."
  180.     Default: ""
  181.  
  182.   S3PathPrefix:
  183.     Type: "String"
  184.     Description: "S3 Path where source and scripts are found for the lab."
  185.     Default: ""
  186.  
  187.   LabName:
  188.     Type: "String"
  189.     Description: "The name of the lab"
  190.     ConstraintDescription: "must be a valid lab name."
  191.     Default: "lab-2-pipeline"
  192.     AllowedValues:
  193.       - lab-1-microservices
  194.       - lab-2-pipeline
  195.       - lab-3-scale
  196.       - lab-4-security
  197.  
  198.   ExtendedFlag:
  199.     Type: "String"
  200.     Description: "Set to true if you want to build and extended pipeline"
  201.     AllowedValues:
  202.       - "true"
  203.       - "false"
  204.     Default: "false"
  205.     ConstraintDescription: "must be a boolean value"
  206.  
  207.   UseGlobalVars:
  208.     Type: "String"
  209.     Description: "Set to true if you want to use global variables"
  210.     AllowedValues:
  211.       - "true"
  212.       - "false"
  213.     Default: "true"
  214.     ConstraintDescription: "must be a boolean value"
  215.  
  216. Conditions:
  217.   ExtendedPipeline: !Equals [!Ref ExtendedFlag, "true"]
  218.   SimplePipeline: !Equals [!Ref ExtendedFlag, "false"]
  219.   GlobalVars: !Equals [!Ref UseGlobalVars, "true"]
  220.  
  221. Resources:
  222.  
  223.   ALBListener:
  224.     Type: "AWS::ElasticLoadBalancingV2::Listener"
  225.     Properties:
  226.       LoadBalancerArn: !ImportValue ApplicationLoadBalancer
  227.       Port: !Ref PortNumber
  228.       Protocol: "HTTP"
  229.       DefaultActions:
  230.         -
  231.           Type: "forward"
  232.           TargetGroupArn: !Ref ALBTargetGroup
  233.  
  234.   ALBTargetGroup:
  235.     Type: "AWS::ElasticLoadBalancingV2::TargetGroup"
  236.     Properties:
  237.       HealthyThresholdCount: 3
  238.       UnhealthyThresholdCount: 3
  239.       Port: !Ref PortNumber
  240.       Protocol: "HTTP"
  241.       VpcId: !ImportValue VPC
  242.       Tags:
  243.         -
  244.           Key: "Name"
  245.           Value : !Sub ${MicroserviceName}ALBTargetGroup
  246.  
  247.   CodeCommitResource:
  248.     Type: "AWS::CodeCommit::Repository"
  249.     Properties:
  250.       RepositoryDescription: !Sub ${MicroserviceName} microservice repository for Container-Enabled Microservices on AWS Bootcamp
  251.       RepositoryName: !Ref MicroserviceName
  252.  
  253.   SimpleCodePipeline:
  254.     Type: "AWS::CodePipeline::Pipeline"
  255.     DependsOn: CodeCommitResource
  256.     Condition: SimplePipeline
  257.     Properties:
  258.       RoleArn: !ImportValue CodePipelineServiceRoleArn
  259.       Name: !Sub ${MicroserviceName}Pipeline
  260.       Stages:
  261.         -
  262.           Name: "Source"
  263.           Actions:
  264.             -
  265.               Name: "SourceAction"
  266.               ActionTypeId:
  267.                 Category: "Source"
  268.                 Owner: "AWS"
  269.                 Version: "1"
  270.                 Provider: "CodeCommit"
  271.               OutputArtifacts:
  272.                 - Name: "SourceOutput"
  273.               Configuration:
  274.                 RepositoryName: !Ref MicroserviceName
  275.                 BranchName: master
  276.               RunOrder: 1
  277.         -
  278.           Name: "Build"
  279.           Actions:
  280.             -
  281.               Name: "BuildAction"
  282.               ActionTypeId:
  283.                 Category: "Build"
  284.                 Owner: "Custom"
  285.                 Version: "1"
  286.                 Provider: !ImportValue JenkinsProvider
  287.               InputArtifacts:
  288.                 - Name: "SourceOutput"
  289.               OutputArtifacts:
  290.                 - Name: "BuildOutput"
  291.               Configuration:
  292.                 ProjectName: !Sub ${MicroserviceName}B
  293.               RunOrder: 1
  294.         -
  295.           Name: "Deploy"
  296.           Actions:
  297.             -
  298.               Name: "DeployAction"
  299.               ActionTypeId:
  300.                 Category: "Invoke"
  301.                 Owner: "AWS"
  302.                 Version: "1"
  303.                 Provider: "Lambda"
  304.               InputArtifacts:
  305.                 - Name: "BuildOutput"
  306.               Configuration:
  307.                 FunctionName: !ImportValue CreateUpdateCfnStackFunctionName
  308.                 UserParameters: !Sub |
  309.                   {
  310.                     "stack": "${MicroserviceName}Stack",
  311.                     "template_file": "microservice.yaml",
  312.                     "input_artifact": "BuildOutput",
  313.                     "params_file": "cfn_stack_params.json"
  314.                   }
  315.               RunOrder: 1
  316.       ArtifactStore:
  317.         Type: "S3"
  318.         Location: !ImportValue CodePipelineBucket
  319.  
  320.   ExtendedCodePipeline:
  321.     Type: "AWS::CodePipeline::Pipeline"
  322.     DependsOn: CodeCommitResource
  323.     Condition: ExtendedPipeline
  324.     Properties:
  325.       RoleArn: !ImportValue CodePipelineServiceRoleArn
  326.       Name: !Sub ${MicroserviceName}PipelineExt
  327.       Stages:
  328.         -
  329.           Name: "Source"
  330.           Actions:
  331.             -
  332.               Name: "SourceAction"
  333.               ActionTypeId:
  334.                 Category: "Source"
  335.                 Owner: "AWS"
  336.                 Version: "1"
  337.                 Provider: "CodeCommit"
  338.               OutputArtifacts:
  339.                 - Name: "SourceOutput"
  340.               Configuration:
  341.                 RepositoryName: !Ref MicroserviceName
  342.                 BranchName: master
  343.               RunOrder: 1
  344.         -
  345.           Name: "Build"
  346.           Actions:
  347.             -
  348.               Name: "BuildAction"
  349.               ActionTypeId:
  350.                 Category: "Build"
  351.                 Owner: "Custom"
  352.                 Version: "1"
  353.                 Provider: !ImportValue JenkinsProvider
  354.               InputArtifacts:
  355.                 - Name: "SourceOutput"
  356.               OutputArtifacts:
  357.                 - Name: "BuildOutput"
  358.               Configuration:
  359.                 ProjectName: !Sub ${MicroserviceName}B
  360.               RunOrder: 1
  361.         -
  362.           Name: "Deploy"
  363.           Actions:
  364.             -
  365.               Name: "DeployAction"
  366.               ActionTypeId:
  367.                 Category: "Invoke"
  368.                 Owner: "AWS"
  369.                 Version: "1"
  370.                 Provider: "Lambda"
  371.               InputArtifacts:
  372.                 - Name: "BuildOutput"
  373.               OutputArtifacts:
  374.                 - Name: "DeployOutput"
  375.               Configuration:
  376.                 FunctionName: !ImportValue CreateUpdateCfnStackFunctionName
  377.                 UserParameters: !Sub |
  378.                   {
  379.                     "stack": "${MicroserviceName}Stack",
  380.                     "template_file": "microservice.yaml",
  381.                     "input_artifact": "BuildOutput",
  382.                     "output_artifact": "DeployOutput",
  383.                     "params_file": "cfn_stack_params.json",
  384.                     "output_file": "postman-collection.json"
  385.                   }
  386.               RunOrder: 1
  387.         -
  388.           Name: "Test"
  389.           Actions:
  390.             -
  391.               Name: "TestAction"
  392.               ActionTypeId:
  393.                 Category: "Test"
  394.                 Owner: "Custom"
  395.                 Version: "1"
  396.                 Provider: !ImportValue JenkinsProvider
  397.               InputArtifacts:
  398.                 - Name: "DeployOutput"
  399.               Configuration:
  400.                 ProjectName: !Sub ${MicroserviceName}T
  401.               RunOrder: 1
  402.       ArtifactStore:
  403.         Type: "S3"
  404.         Location: !ImportValue CodePipelineBucket
  405.  
  406.   JenkinsBuildJobResource:
  407.     Type: "Custom::JenkinsBuildJobResource"
  408.     Properties:
  409.       ServiceToken: !ImportValue ManageJenkinsJobFunctionArn
  410.       JenkinsHostname: !Sub
  411.         - ${DnsName}/jenkins
  412.         - DnsName: !ImportValue ALBDnsName
  413.       JenkinsUsername: "admin"
  414.       JenkinsPassword: !If [ GlobalVars, !ImportValue JenkinsPassword, !Ref JenkinsPassword]
  415.       JenkinsJobTemplate: {"Fn::If": [ GlobalVars, {"Fn::Sub": ["https://${S3BucketName}.s3.amazonaws.com/${S3PathPrefix}${LabName}/scripts/jenkins-build-job-config.xml", { S3BucketName: { "Fn::ImportValue": S3BucketName}, S3PathPrefix: { "Fn::ImportValue": S3PathPrefix }, LabName: { "Fn::ImportValue": LabName }}]}, {"Fn::Sub": "https://${S3BucketName}.s3.amazonaws.com/${S3PathPrefix}${LabName}/scripts/jenkins-build-job-config.xml"}]}
  416.       JenkinsJobName: !Sub ${MicroserviceName}B
  417.       ConfigParameters:
  418.         -
  419.           ParameterKey: "{{REPO_NAME}}"
  420.           ParameterValue: !Ref RepoName
  421.         -
  422.           ParameterKey: "{{ACTION_TYPE_PROVIDER}}"
  423.           ParameterValue: !ImportValue JenkinsProvider
  424.         -
  425.           ParameterKey: "{{PROJECT_NAME}}"
  426.           ParameterValue: !Sub ${MicroserviceName}B
  427.         -
  428.           ParameterKey: "{{AWS_REGION}}"
  429.           ParameterValue: !Ref "AWS::Region"
  430.         -
  431.           ParameterKey: "{{AWS_ACCOUNT_ID}}"
  432.           ParameterValue: !Ref "AWS::AccountId"
  433.         -
  434.           ParameterKey: "{{CFN_STACK_PARAMS}}"
  435.           ParameterValue: !Sub "[{ \"ParameterKey\": \"TargetGroupArn\", \"ParameterValue\": \"${ALBTargetGroup}\" }, { \"ParameterKey\": \"ImageTag\", \"ParameterValue\": \"{{IMAGE_TAG}}\" }]"
  436.  
  437.   JenkinsTestJobResource:
  438.     Type: "Custom::JenkinsTestJobResource"
  439.     Condition: ExtendedPipeline
  440.     Properties:
  441.       ServiceToken: !ImportValue ManageJenkinsJobFunctionArn
  442.       JenkinsHostname: !Sub
  443.         - ${DnsName}/jenkins
  444.         - DnsName: !ImportValue ALBDnsName
  445.       JenkinsUsername: "admin"
  446.       JenkinsPassword: !If [ GlobalVars, !ImportValue JenkinsPassword, !Ref JenkinsPassword]
  447.       JenkinsJobTemplate: {"Fn::If": [ GlobalVars, {"Fn::Sub": ["https://${S3BucketName}.s3.amazonaws.com/${S3PathPrefix}${LabName}/scripts/jenkins-test-job-config.xml", { S3BucketName: { "Fn::ImportValue": S3BucketName}, S3PathPrefix: { "Fn::ImportValue": S3PathPrefix }, LabName: { "Fn::ImportValue": LabName }}]}, {"Fn::Sub": "https://${S3BucketName}.s3.amazonaws.com/${S3PathPrefix}${LabName}/scripts/jenkins-test-job-config.xml"}]}
  448.       JenkinsJobName: !Sub ${MicroserviceName}T
  449.       ConfigParameters:
  450.         -
  451.           ParameterKey: "{{ACTION_TYPE_PROVIDER}}"
  452.           ParameterValue: !ImportValue JenkinsProvider
  453.         -
  454.           ParameterKey: "{{PROJECT_NAME}}"
  455.           ParameterValue: !Sub ${MicroserviceName}T
  456.         -
  457.           ParameterKey: "{{AWS_REGION}}"
  458.           ParameterValue: !Ref "AWS::Region"
  459.         -
  460.           ParameterKey: "{{POSTMAN_COLLECTION_FILE}}"
  461.           ParameterValue: "postman-collection.json"
  462.         -
  463.           ParameterKey: "{{TEST_URL}}"
  464.           ParameterValue: !Sub
  465.             - http://${DnsName}:${PortNumber}
  466.             - DnsName: !ImportValue ALBDnsName
  467. [ec2-user@ip-10-0-1-250 jenkins]$ cd /home/ec2-user/lab-2-pipeline
  468. [ec2-user@ip-10-0-1-250 lab-2-pipeline]$
  469. [ec2-user@ip-10-0-1-250 lab-2-pipeline]$ aws cloudformation create-stack \
  470. > --stack-name MustacheMeWebServerPipeline \
  471. > --parameters \
  472. > ParameterKey=MicroserviceName,ParameterValue=MustacheMeWebServer \
  473. > ParameterKey=RepoName,ParameterValue=mustachemewebserver \
  474. > ParameterKey=PortNumber,ParameterValue=8000 \
  475. > --template-body file://scripts/microservice-pipeline.yaml
  476. {
  477.     "StackId": "arn:aws:cloudformation:us-east-1:909652153136:stack/MustacheMeWebServerPipeline/26d249f0-4fda-11e7-8d6f-503aca26168d"
  478. }
  479. [ec2-user@ip-10-0-1-250 lab-2-pipeline]$ aws cloudformation wait stack-create-complete \
  480. > --stack-name MustacheMeWebServerPipeline
  481. [ec2-user@ip-10-0-1-250 lab-2-pipeline]$ export AWS_REGION=$(aws configure get region)
  482. [ec2-user@ip-10-0-1-250 lab-2-pipeline]$
  483. [ec2-user@ip-10-0-1-250 lab-2-pipeline]$ git clone \
  484. > https://git-codecommit.${AWS_REGION}.amazonaws.com/v1/repos/MustacheMeWebServer \
  485. > /home/ec2-user/repos/MustacheMeWebServer
  486. Cloning into '/home/ec2-user/repos/MustacheMeWebServer'...
  487. warning: You appear to have cloned an empty repository.
  488. Checking connectivity... done.
  489. [ec2-user@ip-10-0-1-250 lab-2-pipeline]$ mv /home/ec2-user/lab-2-pipeline/src/MustacheMe/MustacheMeWebServer/* \
  490. > /home/ec2-user/repos/MustacheMeWebServer/
  491. [ec2-user@ip-10-0-1-250 lab-2-pipeline]$
  492. [ec2-user@ip-10-0-1-250 lab-2-pipeline]$ cd  /home/ec2-user/repos/MustacheMeWebServer
  493. [ec2-user@ip-10-0-1-250 MustacheMeWebServer]$
  494. [ec2-user@ip-10-0-1-250 MustacheMeWebServer]$ git add -A
  495. [ec2-user@ip-10-0-1-250 MustacheMeWebServer]$
  496. [ec2-user@ip-10-0-1-250 MustacheMeWebServer]$ git commit -m "Initial commit"
  497. [master (root-commit) 0475482] Initial commit
  498.  45 files changed, 2722 insertions(+)
  499.  create mode 100644 Dockerfile
  500.  create mode 100644 api-static/nginx/nginx.conf
  501.  create mode 100644 api-static/nginx/nginx.conf.template
  502.  create mode 100644 api-static/static/css/bootstrap-theme.min.css
  503.  create mode 100644 api-static/static/css/bootstrap-theme.min.css.map
  504.  create mode 100644 api-static/static/css/bootstrap.min.css
  505.  create mode 100644 api-static/static/css/bootstrap.min.css.map
  506.  create mode 100644 api-static/static/css/custom.css
  507.  create mode 100644 api-static/static/css/edition-font.css
  508.  create mode 100644 api-static/static/css/font-awesome.min.css
  509.  create mode 100644 api-static/static/css/social-share-kit.css
  510.  create mode 100644 api-static/static/fonts/FontAwesome.otf
  511.  create mode 100644 api-static/static/fonts/fontawesome-webfont.eot
  512.  create mode 100644 api-static/static/fonts/fontawesome-webfont.svg
  513.  create mode 100644 api-static/static/fonts/fontawesome-webfont.ttf
  514.  create mode 100644 api-static/static/fonts/fontawesome-webfont.woff
  515.  create mode 100644 api-static/static/fonts/fontawesome-webfont.woff2
  516.  create mode 100644 api-static/static/fonts/glyphicons-halflings-regular.eot
  517.  create mode 100644 api-static/static/fonts/glyphicons-halflings-regular.svg
  518.  create mode 100644 api-static/static/fonts/glyphicons-halflings-regular.ttf
  519.  create mode 100644 api-static/static/fonts/glyphicons-halflings-regular.woff
  520.  create mode 100644 api-static/static/fonts/glyphicons-halflings-regular.woff2
  521.  create mode 100644 api-static/static/fonts/icomoon.eot
  522.  create mode 100644 api-static/static/fonts/icomoon.svg
  523.  create mode 100644 api-static/static/fonts/icomoon.ttf
  524.  create mode 100644 api-static/static/fonts/icomoon.woff
  525.  create mode 100644 api-static/static/fonts/social-share-kit.eot
  526.  create mode 100644 api-static/static/fonts/social-share-kit.svg
  527.  create mode 100644 api-static/static/fonts/social-share-kit.ttf
  528.  create mode 100644 api-static/static/fonts/social-share-kit.woff
  529.  create mode 100644 api-static/static/img/drop.png
  530.  create mode 100644 api-static/static/img/favicon.ico
  531.  create mode 100644 api-static/static/img/loader.gif
  532.  create mode 100644 api-static/static/img/sms-logo.png
  533.  create mode 100644 api-static/static/img/touch.png
  534.  create mode 100644 api-static/static/index.html
  535.  create mode 100644 api-static/static/js/bootstrap.min.js
  536.  create mode 100644 api-static/static/js/frontend.js
  537.  create mode 100644 api-static/static/js/infos.js
  538.  create mode 100644 api-static/static/js/jquery.min.js
  539.  create mode 100644 api-static/static/js/social-share-kit.min.js
  540.  create mode 100644 microservice.template
  541.  create mode 100644 microservice.yaml
  542.  create mode 100644 postman-collection.json
  543.  create mode 100644 readme.txt
  544. [ec2-user@ip-10-0-1-250 MustacheMeWebServer]$
  545. [ec2-user@ip-10-0-1-250 MustacheMeWebServer]$ git push -u origin master
  546. Counting objects: 54, done.
  547. Compressing objects: 100% (54/54), done.
  548. Writing objects: 100% (54/54), 766.89 KiB | 0 bytes/s, done.
  549. Total 54 (delta 2), reused 0 (delta 0)
  550. To https://git-codecommit.us-east-1.amazonaws.com/v1/repos/MustacheMeWebServer
  551.  * [new branch]      master -> master
  552. Branch master set up to track remote branch master from origin.
  553. [ec2-user@ip-10-0-1-250 MustacheMeWebServer]$ cat /home/ec2-user/lab-2-pipeline/scripts/deploy-microservice.sh
  554. #!/bin/bash -ex
  555.  
  556. LAB_NAME="lab-2-pipeline"
  557. AWS_REGION=$(aws configure get region)
  558.  
  559. if [ -z "$1" ]; then
  560.   echo "No microservice name provided"
  561.   exit 1
  562. else
  563.   MICROSERVICE_NAME="$1"
  564.   REPO_NAME=$(echo "${MICROSERVICE_NAME}" | awk '{print tolower($0)}')
  565. fi
  566.  
  567. if [ -z "$2" ]; then
  568.   echo "No port number provided"
  569.   exit 1
  570. elif ! [[ "$2" =~ ^[0-9]+$ ]]; then
  571.   echo "Port number invalid"
  572.   exit 1
  573. else
  574.   MICROSERVICE_PORT="$2"
  575. fi
  576.  
  577. echo "MICROSERVICE_NAME=${MICROSERVICE_NAME}"
  578. echo "REPO_NAME=${REPO_NAME}"
  579. echo "MICROSERVICE_PORT=${MICROSERVICE_PORT}"
  580. echo "LAB_NAME=${LAB_NAME}"
  581. echo "REGION=${AWS_REGION}"
  582.  
  583. cd /home/ec2-user/${LAB_NAME}
  584. echo "Creating the Microservice pipeline"
  585. aws cloudformation create-stack --stack-name "${MICROSERVICE_NAME}Pipeline" --parameters ParameterKey=MicroserviceName,ParameterValue=${MICROSERVICE_NAME} ParameterKey=RepoName,ParameterValue=${REPO_NAME} ParameterKey=PortNumber,ParameterValue=${MICROSERVICE_PORT} --template-body file://scripts/microservice-pipeline.yaml
  586. echo "Waiting for CFN stack to be created....."
  587. aws cloudformation wait stack-create-complete --stack-name "${MICROSERVICE_NAME}Pipeline"
  588. echo "Stack created!!"
  589.  
  590. echo "Cloning git repo"
  591. git clone https://git-codecommit.${AWS_REGION}.amazonaws.com/v1/repos/${MICROSERVICE_NAME} /home/ec2-user/repos/${MICROSERVICE_NAME}
  592. mv /home/ec2-user/${LAB_NAME}/src/MustacheMe/${MICROSERVICE_NAME}/* /home/ec2-user/repos/${MICROSERVICE_NAME}/
  593. cd  /home/ec2-user/repos/${MICROSERVICE_NAME}
  594. git add -A
  595. git commit -m "Initial commit"
  596. git push -u origin master
  597. [ec2-user@ip-10-0-1-250 MustacheMeWebServer]$ deploy-microservice.sh <MICROSESRVICE_NAME> <PORT>
  598. -bash: syntax error near unexpected token `<'
  599. [ec2-user@ip-10-0-1-250 MustacheMeWebServer]$ Run the following commands to build the pipeline for the other
  600. -bash: Run: command not found
  601. [ec2-user@ip-10-0-1-250 MustacheMeWebServer]$ remaining two microservices:
  602. -bash: remaining: command not found
  603. [ec2-user@ip-10-0-1-250 MustacheMeWebServer]$
  604. [ec2-user@ip-10-0-1-250 MustacheMeWebServer]$  Copy Code Block
  605. -bash: Copy: command not found
  606. [ec2-user@ip-10-0-1-250 MustacheMeWebServer]$ cd /home/ec2-user/lab-2-pipeline/scripts/
  607. [ec2-user@ip-10-0-1-250 scripts]$ ./deploy-microservice.sh MustacheMeProcessor 8082
  608. + LAB_NAME=lab-2-pipeline
  609. ++ aws configure get region
  610. + AWS_REGION=us-east-1
  611. + '[' -z MustacheMeProcessor ']'
  612. + MICROSERVICE_NAME=MustacheMeProcessor
  613. ++ awk '{print tolower($0)}'
  614. ++ echo MustacheMeProcessor
  615. + REPO_NAME=mustachemeprocessor
  616. + '[' -z 8082 ']'
  617. + [[ 8082 =~ ^[0-9]+$ ]]
  618. + MICROSERVICE_PORT=8082
  619. + echo MICROSERVICE_NAME=MustacheMeProcessor
  620. MICROSERVICE_NAME=MustacheMeProcessor
  621. + echo REPO_NAME=mustachemeprocessor
  622. REPO_NAME=mustachemeprocessor
  623. + echo MICROSERVICE_PORT=8082
  624. MICROSERVICE_PORT=8082
  625. + echo LAB_NAME=lab-2-pipeline
  626. LAB_NAME=lab-2-pipeline
  627. + echo REGION=us-east-1
  628. REGION=us-east-1
  629. + cd /home/ec2-user/lab-2-pipeline
  630. + echo 'Creating the Microservice pipeline'
  631. Creating the Microservice pipeline
  632. + aws cloudformation create-stack --stack-name MustacheMeProcessorPipeline --parameters ParameterKey=MicroserviceName,ParameterValue=MustacheMeProcessor ParameterKey=RepoName,ParameterValue=mustachemeprocessor ParameterKey=PortNumber,ParameterValue=8082 --template-body file://scripts/microservice-pipeline.yaml
  633. {
  634.    "StackId": "arn:aws:cloudformation:us-east-1:909652153136:stack/MustacheMeProcessorPipeline/5b0c3bd0-4fdb-11e7-968f-50d5ca6326ba"
  635. }
  636. + echo 'Waiting for CFN stack to be created.....'
  637. Waiting for CFN stack to be created.....
  638. + aws cloudformation wait stack-create-complete --stack-name MustacheMeProcessorPipeline
  639. + echo 'Stack created!!'
  640. Stack created!!
  641. + echo 'Cloning git repo'
  642. Cloning git repo
  643. + git clone https://git-codecommit.us-east-1.amazonaws.com/v1/repos/MustacheMeProcessor /home/ec2-user/repos/MustacheMeProcessor
  644. Cloning into '/home/ec2-user/repos/MustacheMeProcessor'...
  645. warning: You appear to have cloned an empty repository.
  646. Checking connectivity... done.
  647. + mv /home/ec2-user/lab-2-pipeline/src/MustacheMe/MustacheMeProcessor/api-static /home/ec2-user/lab-2-pipeline/src/MustacheMe/MustacheMeProcessor/Dockerfile /home/ec2-user/lab-2-pipeline/src/MustacheMe/MustacheMeProcessor/Dockerfile.v2 /home/ec2-user/lab-2-pipeline/src/MustacheMe/MustacheMeProcessor/microservice.template /home/ec2-user/lab-2-pipeline/src/MustacheMe/MustacheMeProcessor/microservice.yaml /home/ec2-user/lab-2-pipeline/src/MustacheMe/MustacheMeProcessor/postman-collection.json /home/ec2-user/lab-2-pipeline/src/MustacheMe/MustacheMeProcessor/readme.txt /home/ec2-user/lab-2-pipeline/src/MustacheMe/MustacheMeProcessor/supervisord.conf /home/ec2-user/lab-2-pipeline/src/MustacheMe/MustacheMeProcessor/supervisord.conf.v2 /home/ec2-user/repos/MustacheMeProcessor/
  648. + cd /home/ec2-user/repos/MustacheMeProcessor
  649. + git add -A
  650. + git commit -m 'Initial commit'
  651. [master (root-commit) 15f8b64] Initial commit
  652. 44 files changed, 82416 insertions(+)
  653. create mode 100644 Dockerfile
  654. create mode 100644 Dockerfile.v2
  655. create mode 100644 api-static/cv2/__init__.py
  656. create mode 100644 api-static/cv2/__init__.so
  657. create mode 100644 api-static/cv2/libopencv_calib3d.so.3.1
  658. create mode 100644 api-static/cv2/libopencv_core.so.3.1
  659. create mode 100644 api-static/cv2/libopencv_features2d.so.3.1
  660. create mode 100644 api-static/cv2/libopencv_flann.so.3.1
  661. create mode 100644 api-static/cv2/libopencv_highgui.so.3.1
  662. create mode 100644 api-static/cv2/libopencv_imgcodecs.so.3.1
  663. create mode 100644 api-static/cv2/libopencv_imgproc.so.3.1
  664. create mode 100644 api-static/cv2/libopencv_ml.so.3.1
  665. create mode 100644 api-static/cv2/libopencv_objdetect.so.3.1
  666. create mode 100644 api-static/cv2/libopencv_photo.so.3.1
  667. create mode 100644 api-static/cv2/libopencv_shape.so.3.1
  668. create mode 100644 api-static/cv2/libopencv_stitching.so.3.1
  669. create mode 100644 api-static/cv2/libopencv_superres.so.3.1
  670. create mode 100644 api-static/cv2/libopencv_video.so.3.1
  671. create mode 100644 api-static/cv2/libopencv_videoio.so.3.1
  672. create mode 100644 api-static/cv2/libopencv_videostab.so.3.1
  673. create mode 100644 api-static/haarcascades/frontalface_default.xml
  674. create mode 100644 api-static/haarcascades/mcs_nose.xml
  675. create mode 100644 api-static/nginx/nginx.conf
  676. create mode 100644 api-static/nginx/uwsgi
  677. create mode 100644 api-static/nginx/uwsgi.ini
  678. create mode 100644 api-static/process_img/assets/logo.jpg
  679. create mode 100644 api-static/process_img/assets/mustaches/1.png
  680. create mode 100644 api-static/process_img/assets/mustaches/10.png
  681. create mode 100644 api-static/process_img/assets/mustaches/11.png
  682. create mode 100644 api-static/process_img/assets/mustaches/2.png
  683. create mode 100644 api-static/process_img/assets/mustaches/3.png
  684. create mode 100644 api-static/process_img/assets/mustaches/4.png
  685. create mode 100644 api-static/process_img/assets/mustaches/5.png
  686. create mode 100644 api-static/process_img/assets/mustaches/6.png
  687. create mode 100644 api-static/process_img/assets/mustaches/7.png
  688. create mode 100644 api-static/process_img/assets/mustaches/8.png
  689. create mode 100644 api-static/process_img/assets/mustaches/9.png
  690. create mode 100644 api-static/serv.py
  691. create mode 100644 microservice.template
  692. create mode 100644 microservice.yaml
  693. create mode 100644 postman-collection.json
  694. create mode 100644 readme.txt
  695. create mode 100644 supervisord.conf
  696. create mode 100644 supervisord.conf.v2
  697. + git push -u origin master
  698. Counting objects: 53, done.
  699. Compressing objects: 100% (51/51), done.
  700. Writing objects: 100% (53/53), 17.22 MiB | 1.35 MiB/s, done.
  701. Total 53 (delta 2), reused 0 (delta 0)
  702. remote: processing To https://git-codecommit.us-east-1.amazonaws.com/v1/repos/MustacheMeProcessor
  703. * [new branch]      master -> master
  704. Branch master set up to track remote branch master from origin.
  705. [ec2-user@ip-10-0-1-250 scripts]$
  706. [ec2-user@ip-10-0-1-250 scripts]$ ./deploy-microservice.sh MustacheMeInfo 8092
  707. + LAB_NAME=lab-2-pipeline
  708. ++ aws configure get region
  709. + AWS_REGION=us-east-1
  710. + '[' -z MustacheMeInfo ']'
  711. + MICROSERVICE_NAME=MustacheMeInfo
  712. ++ awk '{print tolower($0)}'
  713. ++ echo MustacheMeInfo
  714. + REPO_NAME=mustachemeinfo
  715. + '[' -z 8092 ']'
  716. + [[ 8092 =~ ^[0-9]+$ ]]
  717. + MICROSERVICE_PORT=8092
  718. + echo MICROSERVICE_NAME=MustacheMeInfo
  719. MICROSERVICE_NAME=MustacheMeInfo
  720. + echo REPO_NAME=mustachemeinfo
  721. REPO_NAME=mustachemeinfo
  722. + echo MICROSERVICE_PORT=8092
  723. MICROSERVICE_PORT=8092
  724. + echo LAB_NAME=lab-2-pipeline
  725. LAB_NAME=lab-2-pipeline
  726. + echo REGION=us-east-1
  727. REGION=us-east-1
  728. + cd /home/ec2-user/lab-2-pipeline
  729. + echo 'Creating the Microservice pipeline'
  730. Creating the Microservice pipeline
  731. + aws cloudformation create-stack --stack-name MustacheMeInfoPipeline --parameters ParameterKey=MicroserviceName,ParameterValue=MustacheMeInfo ParameterKey=RepoName,ParameterValue=mustachemeinfo ParameterKey=PortNumber,ParameterValue=8092 --template-body file://scripts/microservice-pipeline.yaml
  732. {
  733.    "StackId": "arn:aws:cloudformation:us-east-1:909652153136:stack/MustacheMeInfoPipeline/975b3aa0-4fdb-11e7-a2b7-500c2854b699"
  734. }
  735. + echo 'Waiting for CFN stack to be created.....'
  736. Waiting for CFN stack to be created.....
  737. + aws cloudformation wait stack-create-complete --stack-name MustacheMeInfoPipeline
  738. + echo 'Stack created!!'
  739. Stack created!!
  740. + echo 'Cloning git repo'
  741. Cloning git repo
  742. + git clone https://git-codecommit.us-east-1.amazonaws.com/v1/repos/MustacheMeInfo /home/ec2-user/repos/MustacheMeInfo
  743. Cloning into '/home/ec2-user/repos/MustacheMeInfo'...
  744. warning: You appear to have cloned an empty repository.
  745. Checking connectivity... done.
  746. + mv /home/ec2-user/lab-2-pipeline/src/MustacheMe/MustacheMeInfo/api-static /home/ec2-user/lab-2-pipeline/src/MustacheMe/MustacheMeInfo/Dockerfile /home/ec2-user/lab-2-pipeline/src/MustacheMe/MustacheMeInfo/microservice.template /home/ec2-user/lab-2-pipeline/src/MustacheMe/MustacheMeInfo/microservice.yaml /home/ec2-user/lab-2-pipeline/src/MustacheMe/MustacheMeInfo/postman-collection.json /home/ec2-user/lab-2-pipeline/src/MustacheMe/MustacheMeInfo/readme.txt /home/ec2-user/lab-2-pipeline/src/MustacheMe/MustacheMeInfo/supervisord.conf /home/ec2-user/repos/MustacheMeInfo/
  747. + cd /home/ec2-user/repos/MustacheMeInfo
  748. + git add -A
  749. + git commit -m 'Initial commit'
  750. [master (root-commit) b1245a3] Initial commit
  751. 30 files changed, 82380 insertions(+)
  752. create mode 100644 Dockerfile
  753. create mode 100644 api-static/cv2/__init__.py
  754. create mode 100644 api-static/cv2/__init__.so
  755. create mode 100644 api-static/cv2/libopencv_calib3d.so.3.1
  756. create mode 100644 api-static/cv2/libopencv_core.so.3.1
  757. create mode 100644 api-static/cv2/libopencv_features2d.so.3.1
  758. create mode 100644 api-static/cv2/libopencv_flann.so.3.1
  759. create mode 100644 api-static/cv2/libopencv_highgui.so.3.1
  760. create mode 100644 api-static/cv2/libopencv_imgcodecs.so.3.1
  761. create mode 100644 api-static/cv2/libopencv_imgproc.so.3.1
  762. create mode 100644 api-static/cv2/libopencv_ml.so.3.1
  763. create mode 100644 api-static/cv2/libopencv_objdetect.so.3.1
  764. create mode 100644 api-static/cv2/libopencv_photo.so.3.1
  765. create mode 100644 api-static/cv2/libopencv_shape.so.3.1
  766. create mode 100644 api-static/cv2/libopencv_stitching.so.3.1
  767. create mode 100644 api-static/cv2/libopencv_superres.so.3.1
  768. create mode 100644 api-static/cv2/libopencv_video.so.3.1
  769. create mode 100644 api-static/cv2/libopencv_videoio.so.3.1
  770. create mode 100644 api-static/cv2/libopencv_videostab.so.3.1
  771. create mode 100644 api-static/haarcascades/frontalface_default.xml
  772. create mode 100644 api-static/haarcascades/mcs_nose.xml
  773. create mode 100644 api-static/nginx/nginx.conf
  774. create mode 100644 api-static/nginx/uwsgi
  775. create mode 100644 api-static/nginx/uwsgi.ini
  776. create mode 100644 api-static/serv.py
  777. create mode 100644 microservice.template
  778. create mode 100644 microservice.yaml
  779. create mode 100644 postman-collection.json
  780. create mode 100644 readme.txt
  781. create mode 100644 supervisord.conf
  782. + git push -u origin master
  783. Counting objects: 36, done.
  784. Compressing objects: 100% (35/35), done.
  785. Writing objects: 100% (36/36), 17.08 MiB | 1.23 MiB/s, done.
  786. Total 36 (delta 0), reused 0 (delta 0)
  787. remote: processing To https://git-codecommit.us-east-1.amazonaws.com/v1/repos/MustacheMeInfo
  788. * [new branch]      master -> master
  789. Branch master set up to track remote branch master from origin.
  790. [ec2-user@ip-10-0-1-250 scripts]$
  791. [ec2-user@ip-10-0-1-250 scripts]$
  792. [ec2-user@ip-10-0-1-250 scripts]$
  793. [ec2-user@ip-10-0-1-250 scripts]$
  794. [ec2-user@ip-10-0-1-250 scripts]$
  795. [ec2-user@ip-10-0-1-250 scripts]$
  796. [ec2-user@ip-10-0-1-250 scripts]$
  797. [ec2-user@ip-10-0-1-250 scripts]$
  798. [ec2-user@ip-10-0-1-250 scripts]$ cd ..
  799. [ec2-user@ip-10-0-1-250 lab-2-pipeline]$
  800. [ec2-user@ip-10-0-1-250 lab-2-pipeline]$
  801. [ec2-user@ip-10-0-1-250 lab-2-pipeline]$
  802. [ec2-user@ip-10-0-1-250 lab-2-pipeline]$ ll
  803. total 32
  804. -rw-rw-r-- 1 ec2-user ec2-user 5693 Feb 28 21:52 base-cloudformation.template
  805. drwxrwxr-x 2 ec2-user ec2-user 4096 Apr 18 00:04 instructions
  806. -rw-rw-r-- 1 ec2-user ec2-user 4991 Oct 16  2016 lab2_student.policy
  807. drwxrwxr-x 2 ec2-user ec2-user 4096 Apr 18 00:04 required_services
  808. drwxrwxr-x 4 ec2-user ec2-user 4096 Apr 18 00:04 scripts
  809. drwxrwxr-x 4 ec2-user ec2-user 4096 Apr 18 00:04 src
  810. [ec2-user@ip-10-0-1-250 lab-2-pipeline]$ cat /home/ec2-user/repos/MustacheMeWebServer/postman-collection.json
  811. {
  812.     "id": "7739bb54-b5af-9e9a-946a-8cf37a65caa9",
  813.     "name": "MustacheMe",
  814.     "description": "Collection for the MustacheMeWebServer microservice",
  815.     "order": [
  816.         "08bdeab6-7d1f-9e80-fac1-cf0a559af259"
  817.     ],
  818.     "folders": [],
  819.     "timestamp": 1475853871805,
  820.     "owner": 0,
  821.     "public": false,
  822.     "published": false,
  823.     "requests": [
  824.         {
  825.             "id": "08bdeab6-7d1f-9e80-fac1-cf0a559af259",
  826.             "headers": "",
  827.             "url": "{{TEST_URL}}",
  828.             "pathVariables": {},
  829.             "preRequestScript": null,
  830.             "method": "GET",
  831.             "collectionId": "7739bb54-b5af-9e9a-946a-8cf37a65caa9",
  832.             "data": null,
  833.             "dataMode": "params",
  834.             "name": "MustacheMeWebServer",
  835.             "description": "Test of the MustacheMeWebServer microservice",
  836.             "descriptionFormat": "html",
  837.             "time": 1475853987555,
  838.             "version": 2,
  839.             "responses": [],
  840.             "tests": "tests[\"Status code is 200\"] = responseCode.code === 200;\n\ntests[\"Body matches string\"] = responseBody.has(\"Simple Mustache Service\");",
  841.             "currentHelper": "normal",
  842.             "helperAttributes": {}
  843.         }
  844.     ]
  845. }
  846. [ec2-user@ip-10-0-1-250 lab-2-pipeline]$
  847. [ec2-user@ip-10-0-1-250 lab-2-pipeline]$
  848. [ec2-user@ip-10-0-1-250 lab-2-pipeline]$
  849. [ec2-user@ip-10-0-1-250 lab-2-pipeline]$
  850. [ec2-user@ip-10-0-1-250 lab-2-pipeline]$
  851. [ec2-user@ip-10-0-1-250 lab-2-pipeline]$
  852. [ec2-user@ip-10-0-1-250 lab-2-pipeline]$
  853. [ec2-user@ip-10-0-1-250 lab-2-pipeline]$
  854. [ec2-user@ip-10-0-1-250 lab-2-pipeline]$
  855. [ec2-user@ip-10-0-1-250 lab-2-pipeline]$
  856. [ec2-user@ip-10-0-1-250 lab-2-pipeline]$ cd ..
  857. [ec2-user@ip-10-0-1-250 ~]$
  858. [ec2-user@ip-10-0-1-250 ~]$
  859. [ec2-user@ip-10-0-1-250 ~]$
  860. [ec2-user@ip-10-0-1-250 ~]$
  861. [ec2-user@ip-10-0-1-250 ~]$ ls
  862. AWSsummit  lab-2-pipeline  repos
  863. [ec2-user@ip-10-0-1-250 ~]$ git commit -m "first commit"
  864. On branch master
  865.  
  866. Initial commit
  867.  
  868. Untracked files:
  869.     .aws/
  870.     .bash_history
  871.     .bash_logout
  872.     .bash_profile
  873.     .bashrc
  874.     .docker/
  875.     .ecr/
  876.     .gitconfig
  877.     .ssh/
  878.     AWSsummit/
  879.     lab-2-pipeline/
  880.     repos/
  881.  
  882. nothing added to commit but untracked files present
  883. [ec2-user@ip-10-0-1-250 ~]$ git add lab-2-pipeline
  884. [ec2-user@ip-10-0-1-250 ~]$ git commit -m ""
  885. Aborting commit due to empty commit message.
  886. [ec2-user@ip-10-0-1-250 ~]$ git commit -m "hh"
  887. [master (root-commit) dba3428] hh
  888. 41 files changed, 4447 insertions(+)
  889. create mode 100644 lab-2-pipeline/.gitignore
  890. create mode 100644 lab-2-pipeline/base-cloudformation.template
  891. create mode 100644 lab-2-pipeline/instructions/02-lab-2-pipeline.md
  892. create mode 100644 lab-2-pipeline/lab2_student.policy
  893. create mode 100644 lab-2-pipeline/required_services/required_services.txt
  894. create mode 100755 lab-2-pipeline/scripts/build_push_image.sh
  895. create mode 100644 lab-2-pipeline/scripts/cli-instance.yaml
  896. create mode 100644 lab-2-pipeline/scripts/delivery-pipeline-main.yaml
  897. create mode 100755 lab-2-pipeline/scripts/deploy-microservice.sh
  898. create mode 100644 lab-2-pipeline/scripts/ecs-cluster.yaml
  899. create mode 100644 lab-2-pipeline/scripts/images/Picture1.png
  900. create mode 100644 lab-2-pipeline/scripts/images/Picture10.png
  901. create mode 100644 lab-2-pipeline/scripts/images/Picture11.png
  902. create mode 100644 lab-2-pipeline/scripts/images/Picture2.png
  903. create mode 100644 lab-2-pipeline/scripts/images/Picture3.png
  904. create mode 100644 lab-2-pipeline/scripts/images/Picture4.png
  905. create mode 100644 lab-2-pipeline/scripts/images/Picture5.png
  906. create mode 100644 lab-2-pipeline/scripts/images/Picture6.png
  907. create mode 100644 lab-2-pipeline/scripts/images/Picture7.png
  908. create mode 100644 lab-2-pipeline/scripts/images/Picture8.png
  909. create mode 100644 lab-2-pipeline/scripts/images/Picture9.png
  910. create mode 100644 lab-2-pipeline/scripts/jenkins-build-job-config.xml
  911. create mode 100644 lab-2-pipeline/scripts/jenkins-ecs-service.yaml
  912. create mode 100644 lab-2-pipeline/scripts/jenkins-full-stack.yaml
  913. create mode 100644 lab-2-pipeline/scripts/jenkins-test-job-config.xml
  914. create mode 100644 lab-2-pipeline/scripts/ko_LG/02-lab-2-pipeline.md
  915. create mode 100644 lab-2-pipeline/scripts/lab2-simulation-sree.template
  916. create mode 100644 lab-2-pipeline/scripts/lab2-simulation.yaml
  917. create mode 100644 lab-2-pipeline/scripts/lambda-functions.yaml
  918. create mode 100644 lab-2-pipeline/scripts/microservice-pipeline.yaml
  919. create mode 100644 lab-2-pipeline/scripts/network.yaml
  920. create mode 100644 lab-2-pipeline/scripts/ssm-commands.yaml
  921. create mode 100755 lab-2-pipeline/scripts/update-microservice-pipeline.sh
  922. create mode 100644 lab-2-pipeline/src/MustacheMe/MustacheMeBase/Dockerfile
  923. create mode 100644 lab-2-pipeline/src/MustacheMe/MustacheMeBase/readme.txt
  924. create mode 100644 lab-2-pipeline/src/MustacheMe/docker-compose.yml
  925. create mode 100644 lab-2-pipeline/src/MustacheMe/ecs-cli/docker-compose.yml
  926. create mode 100644 lab-2-pipeline/src/MustacheMe/faces.zip
  927. create mode 100644 lab-2-pipeline/src/MustacheMe/readme.txt
  928. create mode 100644 lab-2-pipeline/src/jenkins/Dockerfile
  929. create mode 100644 lab-2-pipeline/src/jenkins/groovy-scripts/admin.groovy
  930. [ec2-user@ip-10-0-1-250 ~]$ git remote add origin https://github.com/dshamanthreddy/testsam.git
  931. fatal: remote origin already exists.
  932. [ec2-user@ip-10-0-1-250 ~]$ git push
  933. warning: push.default is unset; its implicit value has changed in
  934. Git 2.0 from 'matching' to 'simple'. To squelch this message
  935. and maintain the traditional behavior, use:
  936.  
  937.  git config --global push.default matching
  938.  
  939. To squelch this message and adopt the new behavior now, use:
  940.  
  941.  git config --global push.default simple
  942.  
  943. When push.default is set to 'matching', git will push local branches
  944. to the remote branches that already exist with the same name.
  945.  
  946. Since Git 2.0, Git defaults to the more conservative 'simple'
  947. behavior, which only pushes the current branch to the corresponding
  948. remote branch that 'git pull' uses to update the current branch.
  949.  
  950. See 'git help config' and search for 'push.default' for further information.
  951. (the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
  952. 'current' instead of 'simple' if you sometimes use older versions of Git)
  953.  
  954. fatal: The current branch master has no upstream branch.
  955. To push the current branch and set the remote as upstream, use
  956.  
  957.    git push --set-upstream origin master
  958.  
  959. [ec2-user@ip-10-0-1-250 ~]$ git push -u origin master
  960. Username for 'https://github.com/dshamanthreddy/AWSsummit.git': devagarishamanth@gmail.com
  961. Password for 'https://devagarishamanth@gmail.com@github.com/dshamanthreddy/AWSsummit.git':
  962. To https://github.com/dshamanthreddy/AWSsummit.git
  963. ! [rejected]        master -> master (fetch first)
  964. error: failed to push some refs to 'https://github.com/dshamanthreddy/AWSsummit.git'
  965. hint: Updates were rejected because the remote contains work that you do
  966. hint: not have locally. This is usually caused by another repository pushing
  967. hint: to the same ref. You may want to first integrate the remote changes
  968. hint: (e.g., 'git pull ...') before pushing again.
  969. hint: See the 'Note about fast-forwards' in 'git push --help' for details.
  970. [ec2-user@ip-10-0-1-250 ~]$ git remote add origin https://github.com/dshamanthreddy/testsam.git
  971. fatal: remote origin already exists.
  972. [ec2-user@ip-10-0-1-250 ~]$ ls
  973. AWSsummit  lab-2-pipeline  repos
  974. [ec2-user@ip-10-0-1-250 ~]$ rm -rf AWSsummit/
  975. [ec2-user@ip-10-0-1-250 ~]$ git add lab-2-pipeline
  976. [ec2-user@ip-10-0-1-250 ~]$ git commit -m "iii"
  977. On branch master
  978. Untracked files:
  979.     .aws/
  980.     .bash_history
  981.     .bash_logout
  982.     .bash_profile
  983.     .bashrc
  984.     .docker/
  985.     .ecr/
  986.     .gitconfig
  987.     .ssh/
  988.     repos/
  989.  
  990. nothing added to commit but untracked files present
  991. [ec2-user@ip-10-0-1-250 ~]$ set -o vi
  992. [ec2-user@ip-10-0-1-250 ~]$ git add lab-2-pipeline
  993. [ec2-user@ip-10-0-1-250 ~]$ git commit -m "test"
  994. On branch master
  995. Untracked files:
  996.     .aws/
  997.     .bash_history
  998.     .bash_logout
  999.     .bash_profile
  1000.     .bashrc
  1001.     .docker/
  1002.     .ecr/
  1003.     .gitconfig
  1004.     .ssh/
  1005.     repos/
  1006.  
  1007. nothing added to commit but untracked files present
  1008. [ec2-user@ip-10-0-1-250 ~]$ git push
  1009. warning: push.default is unset; its implicit value has changed in
  1010. Git 2.0 from 'matching' to 'simple'. To squelch this message
  1011. and maintain the traditional behavior, use:
  1012.  
  1013.  git config --global push.default matching
  1014.  
  1015. To squelch this message and adopt the new behavior now, use:
  1016.  
  1017.  git config --global push.default simple
  1018.  
  1019. When push.default is set to 'matching', git will push local branches
  1020. to the remote branches that already exist with the same name.
  1021.  
  1022. Since Git 2.0, Git defaults to the more conservative 'simple'
  1023. behavior, which only pushes the current branch to the corresponding
  1024. remote branch that 'git pull' uses to update the current branch.
  1025.  
  1026. See 'git help config' and search for 'push.default' for further information.
  1027. (the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
  1028. 'current' instead of 'simple' if you sometimes use older versions of Git)
  1029.  
  1030. fatal: The current branch master has no upstream branch.
  1031. To push the current branch and set the remote as upstream, use
  1032.  
  1033.    git push --set-upstream origin master
  1034.  
  1035. [ec2-user@ip-10-0-1-250 ~]$ git push --set-upstream origin master
  1036. Username for 'https://github.com/dshamanthreddy/AWSsummit.git': devagarishamanth@gmail.com
  1037. Password for 'https://devagarishamanth@gmail.com@github.com/dshamanthreddy/AWSsummit.git':
  1038. To https://github.com/dshamanthreddy/AWSsummit.git
  1039. ! [rejected]        master -> master (fetch first)
  1040. error: failed to push some refs to 'https://github.com/dshamanthreddy/AWSsummit.git'
  1041. hint: Updates were rejected because the remote contains work that you do
  1042. hint: not have locally. This is usually caused by another repository pushing
  1043. hint: to the same ref. You may want to first integrate the remote changes
  1044. hint: (e.g., 'git pull ...') before pushing again.
  1045. hint: See the 'Note about fast-forwards' in 'git push --help' for details.
  1046. [ec2-user@ip-10-0-1-250 ~]$ git fetch
  1047. warning: no common commits
  1048. remote: Counting objects: 170, done.
  1049. remote: Compressing objects: 100% (140/140), done.
  1050. remote: Total 170 (delta 19), reused 170 (delta 19), pack-reused 0
  1051. Receiving objects: 100% (170/170), 19.05 MiB | 22.28 MiB/s, done.
  1052. Resolving deltas: 100% (19/19), done.
  1053. From https://github.com/dshamanthreddy/AWSsummit
  1054. * [new branch]      master     -> origin/master
  1055. [ec2-user@ip-10-0-1-250 ~]$ git push
  1056. warning: push.default is unset; its implicit value has changed in
  1057. Git 2.0 from 'matching' to 'simple'. To squelch this message
  1058. and maintain the traditional behavior, use:
  1059.  
  1060.  git config --global push.default matching
  1061.  
  1062. To squelch this message and adopt the new behavior now, use:
  1063.  
  1064.  git config --global push.default simple
  1065.  
  1066. When push.default is set to 'matching', git will push local branches
  1067. to the remote branches that already exist with the same name.
  1068.  
  1069. Since Git 2.0, Git defaults to the more conservative 'simple'
  1070. behavior, which only pushes the current branch to the corresponding
  1071. remote branch that 'git pull' uses to update the current branch.
  1072.  
  1073. See 'git help config' and search for 'push.default' for further information.
  1074. (the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
  1075. 'current' instead of 'simple' if you sometimes use older versions of Git)
  1076.  
  1077. fatal: The current branch master has no upstream branch.
  1078. To push the current branch and set the remote as upstream, use
  1079.  
  1080.    git push --set-upstream origin master
  1081.  
  1082. [ec2-user@ip-10-0-1-250 ~]$ git push --set-upstream origin master
  1083. Username for 'https://github.com/dshamanthreddy/AWSsummit.git': devagarishamanth@gmail.com
  1084. Password for 'https://devagarishamanth@gmail.com@github.com/dshamanthreddy/AWSsummit.git':
  1085. To https://github.com/dshamanthreddy/AWSsummit.git
  1086. ! [rejected]        master -> master (non-fast-forward)
  1087. error: failed to push some refs to 'https://github.com/dshamanthreddy/AWSsummit.git'
  1088. hint: Updates were rejected because the tip of your current branch is behind
  1089. hint: its remote counterpart. Integrate the remote changes (e.g.
  1090. hint: 'git pull ...') before pushing again.
  1091. hint: See the 'Note about fast-forwards' in 'git push --help' for details.
  1092. [ec2-user@ip-10-0-1-250 ~]$ git remote add origin https://github.com/dshamanthreddy/testsam.git
  1093. fatal: remote origin already exists.
  1094. [ec2-user@ip-10-0-1-250 ~]$
  1095. Broadcast message from root@ip-10-0-1-250
  1096.     (unknown) at 2:41 ...
  1097.  
  1098. The system is going down for power off NOW!
  1099. Connection to ec2-54-205-54-2.compute-1.amazonaws.com closed by remote host.
  1100. Connection to ec2-54-205-54-2.compute-1.amazonaws.com closed.
  1101. Shamanthreddys-MacBook-Pro:Downloads shamanthreddy$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement