Skip to content

Instantly share code, notes, and snippets.

View 0xTim's full-sized avatar
:octocat:
Coding

Tim Condon 0xTim

:octocat:
Coding
View GitHub Profile
@0xTim
0xTim / Notes.md
Last active February 13, 2019 01:52
Changes for the Ray Wenderlich Vapor Videos for Vapor 3 RC 2

Vapor 3 RC 2 Updates

Vapor 3 RC 2 is out! To update, ensure that your Package.swift contains something like:

.package(url: "https://github.com/vapor/vapor.git", from: "3.0.0-rc"),
.package(url: "https://github.com/vapor/fluent-mysql.git", from: "3.0.0-rc"),
.package(url: "https://github.com/vapor/leaf.git", from: "3.0.0-rc"),
@0xTim
0xTim / deploy.yaml
Created February 17, 2021 17:50
CF stack for a Vapor app
AWSTemplateFormatVersion: 2010-09-09
Description: CloudFormation stack for a Vapor app
Parameters:
TaskDefinition:
Type: String
ServiceNameBase:
Type: String
# update with the name of the service
Default: your-servoce
Certificate:
@0xTim
0xTim / deploy.swift
Last active December 19, 2022 13:13
A Swift script to deploy an app (in this case Vapor) to AWS Fargate from scratch. It first checks to see if there's a repository in ECR for the app, if not it creates one, builds the container and pushes it. It then checks for a registered task definition. In one doesn't exist in ECS, it updates the provided task definition with the latest ECR i…
#!/usr/bin/swift
import Foundation
// MARK: - Script variables
let awsProfileName: String? = "myProfile"
let serviceName = "someService"
// MARK: - Functions
@discardableResult
func shell(_ args: String..., returnStdOut: Bool = false, stdIn: Pipe? = nil) -> (Int32, Pipe) {