Coder Social home page Coder Social logo

tedgonzalez / aws-pipeline-server-side-swift-blog Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aws-samples/aws-pipeline-server-side-swift-blog

1.0 0.0 0.0 21 KB

This code demonstrates how to set up a CI/CD pipeline on AWS for server-side Swift applications. The CloudFormation code sets up a CI/CD pipeline that compiles and hosts the Swift application on both EC2 and ECS. This source code is meant to accompany a blog article which describes the pipeline and configuration.

Home Page: https://aws.amazon.com/blogs/opensource/continuous-delivery-server-side-swift-aws/

License: MIT No Attribution

Dockerfile 23.86% Swift 65.34% Shell 10.81%

aws-pipeline-server-side-swift-blog's Introduction

Server-side Swift development using an AWS CI/CD pipeline

This project is the accompanying source code to the blog article locate here: https://aws.amazon.com/blogs/opensource/continuous-delivery-server-side-swift-aws/. Please check that article out - it goes over the project goals and setup instructions in much greater depth.

Getting started

  1. Create a new S3 bucket that will store your packaged cloudformation templates, or find an existing one to use. The user running the scripts should have read/write access to this bucket, and it should be in the same account as where you want the resources to be provisioned.
  2. Update package.json with the name of the bucket. The scripts should have the CF_BUCKET environment variable set to the name of the bucket.
  3. Optionally, update create-stack.json and update the tags applied to the resources, or the name of the cloudformation stack.
  4. Run npm run-scripts create
  5. Wait for the script to finish. You can view the status either by looking at the AWS console in the Cloudformation section or by running aws cloudformation wait stack-create-complete
  6. Create the docker image. Navigate to ECR within the AWS console, click on codebuild/swift and follow the instructions in View push commands from within the codebuild-image folder.
  7. Copy the contents of the app folder to another directory: cp -r ./app ../swift-codebuild-app.
  8. Change to the newly copied directory and initialize a git repository: cd ../swift-codebuild-app && git init
  9. Navigate to the CodeCommit AWS console, then locate the repository created by the Cloudformation script (it should start with the stack name that you used). Click on that repository and follow the instructions to initialize the repository with the contents of swift-codebuild-app.
  10. Navigate to CodePipeline. Click on the pipeline whose name starts with the Cloudformation stack name. After a few seconds it should pick up the change in the CodeCommit repository and launch. After 10-15 minutes it should complete all three stages: Source, Build, and Release.
  11. Navigate to the EC2 AWS console, then click on the sidebar to find the Load Balancer section. First click on the load balancer whose name starts with swift-EC2. Copy the DNS name and paste it into a browser window. Confirm that it reponds with "It works!"
  12. Navigate to the EC2 AWS console, then click on the sidebar to find the Load Balancer section. First click on the load balancer whose name starts with swift-ECS. Copy the DNS name and paste it into a browser window. Confirm that it reponds with "It works!"
  13. Update the swift-codebuild-app repository. Edit Sources/App/routes.swift and modify return "It works!" to read return "It works! With an update!". Commit those changes and push them to the CodeCommit repository.
  14. Wait for the pipeline to update and confirm that the two load balancers update with the correct message.

License

This library is licensed under the MIT-0 License. See the LICENSE file.

aws-pipeline-server-side-swift-blog's People

Contributors

amazon-auto avatar tedgonzalez avatar

Stargazers

 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.