From c2067f97109197617d09de81d977ccbc0be96419 Mon Sep 17 00:00:00 2001 From: Kye-Maloy Date: Mon, 30 Oct 2017 13:14:44 +0000 Subject: [PATCH 1/9] Migrated to Swift 4 --- Package.swift | 35 ++++++++++++++++++++++------------- README.md | 12 ++++++------ 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/Package.swift b/Package.swift index 5872920..3eec6ca 100644 --- a/Package.swift +++ b/Package.swift @@ -1,3 +1,6 @@ +// swift-tools-version:4.0 +// The swift-tools-version declares the minimum version of Swift required to build this package. + /** * Copyright IBM Corporation 2017 * @@ -16,22 +19,28 @@ import PackageDescription + let package = Package( name: "TodoList", + products: [], + + dependencies: [ + .package(url: "https://github.com/IBM-Swift/Kitura.git", from: "1.0.0"), + .package(url: "https://github.com/davidungar/miniPromiseKit", from: "4.0.0"), + .package(url: "https://github.com/IBM-Swift/Kitura-CouchDB.git", from: "1.0.0"), + .package(url: "https://github.com/IBM-Swift/CloudEnvironment.git", from: "4.0.5"), + .package(url: "https://github.com/IBM-Bluemix/cf-deployment-tracker-client-swift.git", from: "3.0.0"), + .package(url: "https://github.com/SwiftyJSON/SwiftyJSON.git", from: "3.1.4") + ], + targets: [ - Target( + .target( name: "Server", - dependencies: [.Target(name: "TodoList")] + dependencies: [.target(name: "TodoList")] ), - Target( - name: "TodoList" - ) - ], - dependencies: [ - .Package(url: "https://github.com/IBM-Swift/Kitura.git", majorVersion: 1), - .Package(url: "https://github.com/davidungar/miniPromiseKit", majorVersion: 4), - .Package(url: "https://github.com/IBM-Swift/Kitura-CouchDB.git", majorVersion: 1), - .Package(url: "https://github.com/IBM-Swift/CloudConfiguration.git", majorVersion: 2), - .Package(url: "https://github.com/IBM-Bluemix/cf-deployment-tracker-client-swift.git", majorVersion: 3) - ] + .target( + name: "TodoList", + dependencies: ["CloudEnvironment", "SwiftyJSON", "MiniPromiseKit", "CouchDB", "Kitura"] + ), + ] ) diff --git a/README.md b/README.md index 22f03a8..f1fef47 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,9 @@ Todo backend is an example of using the [Kitura](https://github.com/IBM-Swift/Ki ## Quick start for local development: -You can set up your development environment and use XCode 8 for editing, building, debugging, and testing your server application. To use XCode, you must use the command line tools for generating an XCode project. +You can set up your development environment and use Xcode 9 for editing, building, debugging, and testing your server application. To use Xcode, you must use the command line tools for generating an Xcode project. -1. Download [Xcode 8](https://swift.org/download/) +1. Download [Xcode 9](https://swift.org/download/) 2. Download [CouchDB](http://couchdb.apache.org/) and install ``` @@ -24,7 +24,7 @@ You can set up your development environment and use XCode 8 for editing, buildin git clone https://github.com/IBM-Swift/TodoList-CouchDB ``` -4. Generate an XCode project +4. Generate an Xcode project ``` swift package generate-xcodeproj @@ -40,9 +40,9 @@ You can set up your development environment and use XCode 8 for editing, buildin ## Quick start on Linux -To build the project in Linux, you need to first install the Swift 3 toolchain. +To build the project in Linux, you need to first install the Swift 4 toolchain. -1. Install the [Swift 3 RELEASE toolchain](http://www.swift.org) +1. Install the [Swift 4 RELEASE toolchain](http://www.swift.org) 2. Install CouchDB: @@ -242,4 +242,4 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +Unless required by applicable law or agreed to in writing, software :distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. From 9115da6a263aa52b45151162f1181487b8da8520 Mon Sep 17 00:00:00 2001 From: Kye-Maloy Date: Mon, 30 Oct 2017 13:17:37 +0000 Subject: [PATCH 2/9] Added hidden files to commit --- .gitignore | 1 + .swift-version | 2 +- .travis.yml | 13 +++++++++---- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index ff859e6..d1d054f 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ TodoListFull.xcworkspace couchdb.stdout couchdb.stderr +Package.pins /cloud_config.json diff --git a/.swift-version b/.swift-version index 8c50098..5186d07 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -3.1 +4.0 diff --git a/.travis.yml b/.travis.yml index 56873b0..38846e4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,7 @@ +branches: + only: + - master + - /^issue.*$/ matrix: include: @@ -5,7 +9,8 @@ matrix: dist: trusty sudo: required - os: osx - osx_image: xcode8 + osx_image: xcode9 + sudo: required before_install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi @@ -14,9 +19,9 @@ before_install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then open "Apache CouchDB.app"/ && sleep 5 ; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update -y ; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget https://swift.org/builds/swift-3.1-release/ubuntu1404/swift-3.1-RELEASE/swift-3.1-RELEASE-ubuntu14.04.tar.gz ; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then tar xzvf swift-3.1-RELEASE-ubuntu14.04.tar.gz ; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export PATH=swift-3.1-RELEASE-ubuntu14.04/usr/bin:$PATH ; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget https://swift.org/builds/swift-4.0-release/ubuntu1404/swift-4.0-RELEASE/swift-4.0-RELEASE-ubuntu14.04.tar.gz ; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then tar xzvf swift-4.0-RELEASE-ubuntu14.04.tar.gz ; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export PATH=swift-4.0-RELEASE-ubuntu14.04/usr/bin:$PATH ; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get -y install couchdb clang-3.8 ; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo couchdb -b && sleep 5 ; fi From 790fd3318ca6108d382bb4f40922c53a4e3e600b Mon Sep 17 00:00:00 2001 From: Kye-Maloy Date: Mon, 30 Oct 2017 13:27:18 +0000 Subject: [PATCH 3/9] Removed package.pins --- Package.pins | 96 ---------------------------------------------------- 1 file changed, 96 deletions(-) delete mode 100644 Package.pins diff --git a/Package.pins b/Package.pins deleted file mode 100644 index ad0e462..0000000 --- a/Package.pins +++ /dev/null @@ -1,96 +0,0 @@ -{ - "autoPin": true, - "pins": [ - { - "package": "CCurl", - "reason": null, - "repositoryURL": "https://github.com/IBM-Swift/CCurl.git", - "version": "0.2.3" - }, - { - "package": "CloudConfiguration", - "reason": null, - "repositoryURL": "https://github.com/IBM-Swift/CloudConfiguration.git", - "version": "2.0.0" - }, - { - "package": "CloudFoundryDeploymentTracker", - "reason": null, - "repositoryURL": "https://github.com/IBM-Bluemix/cf-deployment-tracker-client-swift.git", - "version": "3.0.0" - }, - { - "package": "CloudFoundryEnv", - "reason": null, - "repositoryURL": "https://github.com/IBM-Swift/Swift-cfenv.git", - "version": "4.0.1" - }, - { - "package": "Configuration", - "reason": null, - "repositoryURL": "https://github.com/IBM-Swift/Configuration.git", - "version": "0.2.4" - }, - { - "package": "HeliumLogger", - "reason": null, - "repositoryURL": "https://github.com/IBM-Swift/HeliumLogger.git", - "version": "1.7.0" - }, - { - "package": "Kitura", - "reason": null, - "repositoryURL": "https://github.com/IBM-Swift/Kitura.git", - "version": "1.7.0" - }, - { - "package": "Kitura-CouchDB", - "reason": null, - "repositoryURL": "https://github.com/IBM-Swift/Kitura-CouchDB.git", - "version": "1.7.0" - }, - { - "package": "Kitura-TemplateEngine", - "reason": null, - "repositoryURL": "https://github.com/IBM-Swift/Kitura-TemplateEngine.git", - "version": "1.7.0" - }, - { - "package": "Kitura-net", - "reason": null, - "repositoryURL": "https://github.com/IBM-Swift/Kitura-net.git", - "version": "1.7.0" - }, - { - "package": "LoggerAPI", - "reason": null, - "repositoryURL": "https://github.com/IBM-Swift/LoggerAPI.git", - "version": "1.7.0" - }, - { - "package": "MiniPromiseKit", - "reason": null, - "repositoryURL": "https://github.com/davidungar/miniPromiseKit", - "version": "4.2.0" - }, - { - "package": "SSLService", - "reason": null, - "repositoryURL": "https://github.com/IBM-Swift/BlueSSLService.git", - "version": "0.12.31" - }, - { - "package": "Socket", - "reason": null, - "repositoryURL": "https://github.com/IBM-Swift/BlueSocket.git", - "version": "0.12.43" - }, - { - "package": "SwiftyJSON", - "reason": null, - "repositoryURL": "https://github.com/IBM-Swift/SwiftyJSON.git", - "version": "16.0.0" - } - ], - "version": 1 -} \ No newline at end of file From 60bb5a56d12ce2e2dc2addeca7dac420df4eb3e7 Mon Sep 17 00:00:00 2001 From: Kye-Maloy Date: Mon, 30 Oct 2017 15:14:18 +0000 Subject: [PATCH 4/9] Added dependency and make vars public in TodoList.swift --- Package.swift | 8 ++++---- Sources/TodoList/TodoList.swift | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Package.swift b/Package.swift index 3eec6ca..8e8cc84 100644 --- a/Package.swift +++ b/Package.swift @@ -27,20 +27,20 @@ let package = Package( dependencies: [ .package(url: "https://github.com/IBM-Swift/Kitura.git", from: "1.0.0"), .package(url: "https://github.com/davidungar/miniPromiseKit", from: "4.0.0"), - .package(url: "https://github.com/IBM-Swift/Kitura-CouchDB.git", from: "1.0.0"), + .package(url: "https://github.com/IBM-Swift/Kitura-CouchDB.git", from: "1.7.2"), .package(url: "https://github.com/IBM-Swift/CloudEnvironment.git", from: "4.0.5"), - .package(url: "https://github.com/IBM-Bluemix/cf-deployment-tracker-client-swift.git", from: "3.0.0"), + .package(url: "https://github.com/IBM-Bluemix/cf-deployment-tracker-client-swift.git", from: "4.0.1"), .package(url: "https://github.com/SwiftyJSON/SwiftyJSON.git", from: "3.1.4") ], targets: [ .target( name: "Server", - dependencies: [.target(name: "TodoList")] + dependencies: [.target(name: "TodoList"), ] ), .target( name: "TodoList", - dependencies: ["CloudEnvironment", "SwiftyJSON", "MiniPromiseKit", "CouchDB", "Kitura"] + dependencies: ["CloudEnvironment", "SwiftyJSON", "MiniPromiseKit", "CouchDB", "Kitura", "CloudFoundryDeploymentTracker"] ), ] ) diff --git a/Sources/TodoList/TodoList.swift b/Sources/TodoList/TodoList.swift index 70a76f2..3a98990 100644 --- a/Sources/TodoList/TodoList.swift +++ b/Sources/TodoList/TodoList.swift @@ -41,9 +41,9 @@ enum Result { /// TodoList for CouchDB public class TodoList: TodoListAPI { - static let defaultCouchHost = "127.0.0.1" - static let defaultCouchPort = UInt16(5984) - static let defaultDatabaseName = "todolist" + public static let defaultCouchHost = "127.0.0.1" + public static let defaultCouchPort = UInt16(5984) + public static let defaultDatabaseName = "todolist" let databaseName = "todolist" let designName = "todosdesign" From 425059cdb8120e4dfcb591040e1b6b13be808c5e Mon Sep 17 00:00:00 2001 From: Kye-Maloy Date: Mon, 30 Oct 2017 15:46:31 +0000 Subject: [PATCH 5/9] Added dependency to Package.swift --- Package.swift | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Package.swift b/Package.swift index 8e8cc84..b9ad438 100644 --- a/Package.swift +++ b/Package.swift @@ -28,19 +28,19 @@ let package = Package( .package(url: "https://github.com/IBM-Swift/Kitura.git", from: "1.0.0"), .package(url: "https://github.com/davidungar/miniPromiseKit", from: "4.0.0"), .package(url: "https://github.com/IBM-Swift/Kitura-CouchDB.git", from: "1.7.2"), - .package(url: "https://github.com/IBM-Swift/CloudEnvironment.git", from: "4.0.5"), + .package(url: "https://github.com/IBM-Swift/CloudEnvironment.git", from: "4.0.5"), .package(url: "https://github.com/IBM-Bluemix/cf-deployment-tracker-client-swift.git", from: "4.0.1"), - .package(url: "https://github.com/SwiftyJSON/SwiftyJSON.git", from: "3.1.4") + .package(url: "https://github.com/rob-deans/CloudConfiguration.git", from: "2.1.0") ], targets: [ - .target( - name: "Server", - dependencies: [.target(name: "TodoList"), ] - ), .target( name: "TodoList", - dependencies: ["CloudEnvironment", "SwiftyJSON", "MiniPromiseKit", "CouchDB", "Kitura", "CloudFoundryDeploymentTracker"] + dependencies: ["CloudEnvironment", "MiniPromiseKit", "CouchDB", "Kitura", "CloudFoundryDeploymentTracker"] ), + .target( + name: "Server", + dependencies: [.target(name: "TodoList"), "CloudConfiguration"] + ) ] ) From 61f90daa9320b80c525115ed864d7bb5a065e5f7 Mon Sep 17 00:00:00 2001 From: Andrew Lees Date: Tue, 31 Oct 2017 14:12:48 +0000 Subject: [PATCH 6/9] added tests to target --- .gitignore | 1 + Package.swift | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index d1d054f..ffcc2c0 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ TodoListFull.xcworkspace couchdb.stdout couchdb.stderr Package.pins +Package.resolved /cloud_config.json diff --git a/Package.swift b/Package.swift index b9ad438..e3c5c1c 100644 --- a/Package.swift +++ b/Package.swift @@ -41,6 +41,10 @@ let package = Package( .target( name: "Server", dependencies: [.target(name: "TodoList"), "CloudConfiguration"] + ), + .testTarget( + name: "TodoListTests", + dependencies: ["TodoList"] ) ] ) From a2eaef9dd3b07e628995d966e039c7eadea7d19c Mon Sep 17 00:00:00 2001 From: Andrew Lees <32634907+Andrew-Lees11@users.noreply.github.com> Date: Tue, 31 Oct 2017 16:36:01 +0000 Subject: [PATCH 7/9] Fixed whitespace --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 38846e4..489a505 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ branches: - only: - - master - - /^issue.*$/ + only: + - master + - /^issue.*$/ matrix: include: From 5b60d067c438a0fe697fa7270253bc8cc7f0c6ce Mon Sep 17 00:00:00 2001 From: Kye Maloy Date: Tue, 31 Oct 2017 17:02:21 +0000 Subject: [PATCH 8/9] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 489a505..4dc4132 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,7 +23,7 @@ before_install: - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then tar xzvf swift-4.0-RELEASE-ubuntu14.04.tar.gz ; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export PATH=swift-4.0-RELEASE-ubuntu14.04/usr/bin:$PATH ; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get -y install couchdb clang-3.8 ; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo couchdb -b && sleep 5 ; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo mkdir /var/run/couchdb && sudo couchdb -b && sleep 5 ; fi script: - swift build From 0529aeab944e2d737730e4f3873d49fe3aa19861 Mon Sep 17 00:00:00 2001 From: Kye-Maloy Date: Thu, 2 Nov 2017 11:34:30 +0000 Subject: [PATCH 9/9] Removed MiniPromiseKit, removed items from .gitignore --- .gitignore | 2 -- Package.swift | 3 +-- README.md | 18 +++++++++--------- Sources/Server/main.swift | 5 ++++- Sources/TodoList/TodoList.swift | 1 - 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index ffcc2c0..80f0bed 100644 --- a/.gitignore +++ b/.gitignore @@ -2,9 +2,7 @@ /.build /Packages /*.xcodeproj -TodoListFull.xcworkspace couchdb.stdout couchdb.stderr -Package.pins Package.resolved /cloud_config.json diff --git a/Package.swift b/Package.swift index e3c5c1c..9e6a468 100644 --- a/Package.swift +++ b/Package.swift @@ -26,7 +26,6 @@ let package = Package( dependencies: [ .package(url: "https://github.com/IBM-Swift/Kitura.git", from: "1.0.0"), - .package(url: "https://github.com/davidungar/miniPromiseKit", from: "4.0.0"), .package(url: "https://github.com/IBM-Swift/Kitura-CouchDB.git", from: "1.7.2"), .package(url: "https://github.com/IBM-Swift/CloudEnvironment.git", from: "4.0.5"), .package(url: "https://github.com/IBM-Bluemix/cf-deployment-tracker-client-swift.git", from: "4.0.1"), @@ -36,7 +35,7 @@ let package = Package( targets: [ .target( name: "TodoList", - dependencies: ["CloudEnvironment", "MiniPromiseKit", "CouchDB", "Kitura", "CloudFoundryDeploymentTracker"] + dependencies: ["CloudEnvironment", "CouchDB", "Kitura", "CloudFoundryDeploymentTracker"] ), .target( name: "Server", diff --git a/README.md b/README.md index f1fef47..a99d150 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Todo backend is an example of using the [Kitura](https://github.com/IBM-Swift/Kitura) Swift framework for building a productivity app with a database for storage of tasks. [![Build Status](https://travis-ci.org/IBM-Swift/TodoList-CouchDB.svg?branch=master)](https://travis-ci.org/IBM-Swift/TodoList-CouchDB) -![](https://img.shields.io/badge/Swift-3.1%20RELEASE-orange.svg) +![](https://img.shields.io/badge/Swift-4.0%20RELEASE-orange.svg) ![](https://img.shields.io/badge/platform-Linux,%20macOS-blue.svg?style=flat) ![Bluemix Deployments](https://deployment-tracker.mybluemix.net/stats/9eef579b69ef97de1ef1083552adeea2/badge.svg) @@ -69,7 +69,7 @@ To build the project in Linux, you need to first install the Swift 4 toolchain. Then access [http://localhost:8080/](http://localhost:8080/) in your browser to see an empty database. -## Deploying to Bluemix +## Deploying to IBM Cloud ### Using the IBM Cloud Tools for Swift @@ -77,13 +77,13 @@ The TodoList for Cloudant is deployable with a graphical user interface. Downloa - [IBM Cloud Application Tools for Swift](http://cloudtools.bluemix.net/) -### Deploy to Bluemix Button +### Deploy to IBM Cloud Button -You can use this button to deploy TodoList to your Bluemix account, all from the browser. The button will create the application, create and bind any services specified in the manifest.yml file and deploy. +You can use this button to deploy TodoList to your IBM Cloud account, all from the browser. The button will create the application, create and bind any services specified in the manifest.yml file and deploy. [![Deploy to Bluemix](https://deployment-tracker.mybluemix.net/stats/9eef579b69ef97de1ef1083552adeea2/button.svg)](https://bluemix.net/deploy?repository=https://github.com/IBM-Swift/TodoList-CouchDB.git) -### Deploying Docker to IBM Bluemix Container +### Deploying Docker to IBM Cloud Container For the following instructions, we will be using our [Bash Script](config.sh) located in the root directory. You can attempt to complete the whole process with the following command: @@ -118,7 +118,7 @@ Or, you can follow the step-by-step instructions below. ./config.sh stop ``` -4. Push created Docker container to Bluemix +4. Push created Docker container to IBM Cloud ``` ./config.sh push-docker @@ -136,7 +136,7 @@ Or, you can follow the step-by-step instructions below. ./config.sh create-db ``` -7. Create a Bluemix container group where your app will live, binding it to your bridge CF application in the process +7. Create a IBM Cloud container group where your app will live, binding it to your bridge CF application in the process ``` ./config.sh deploy @@ -158,7 +158,7 @@ At this point, your app should be deployed! Accessing your apps route should ret ### Manually -Bluemix is a hosting platform from IBM that makes it easy to deploy your app to the cloud. Bluemix also provides various popular databases. [Cloudant](https://cloudant.com/) is an offering that is compatible with the CouchDB database, but provides additional features. You can use Cloudant with your deployed TodoList-CouchDB application. +IBM Cloud is a hosting platform from IBM that makes it easy to deploy your app to the cloud. IBM Cloud also provides various popular databases. [Cloudant](https://cloudant.com/) is an offering that is compatible with the CouchDB database, but provides additional features. You can use Cloudant with your deployed TodoList-CouchDB application. 1. Get an account for [Bluemix](https://console.ng.bluemix.net/registration/) @@ -227,7 +227,7 @@ This Swift application includes code to track deployments to [IBM Bluemix](https * Labels of bound services * Number of instances for each bound service and associated plan information -This data is collected from the parameters of the `CloudFoundryDeploymentTracker`, the `VCAP_APPLICATION` and `VCAP_SERVICES` environment variables in IBM Bluemix and other Cloud Foundry platforms. This data is used by IBM to track metrics around deployments of sample applications to IBM Bluemix to measure the usefulness of our examples, so that we can continuously improve the content we offer to you. Only deployments of sample applications that include code to ping the Deployment Tracker service will be tracked. +This data is collected from the parameters of the `CloudFoundryDeploymentTracker`, the `VCAP_APPLICATION` and `VCAP_SERVICES` environment variables in IBM Cloud and other Cloud Foundry platforms. This data is used by IBM to track metrics around deployments of sample applications to IBM Cloud to measure the usefulness of our examples, so that we can continuously improve the content we offer to you. Only deployments of sample applications that include code to ping the Deployment Tracker service will be tracked. ### Disabling Deployment Tracking Deployment tracking can be disabled by removing the following line from `main.swift`: diff --git a/Sources/Server/main.swift b/Sources/Server/main.swift index 039ed11..61099c9 100644 --- a/Sources/Server/main.swift +++ b/Sources/Server/main.swift @@ -23,12 +23,12 @@ import CloudFoundryDeploymentTracker import TodoList import Configuration import CloudFoundryConfig +import CloudEnvironment HeliumLogger.use() let configFile = "cloud_config.json" let databaseName = "todolist" - extension TodoList { public convenience init(config: CloudantService) { @@ -42,6 +42,9 @@ let todos: TodoList let manager = ConfigurationManager() +let cloudEnv = CloudEnv() +let cloudantCredentials = cloudEnv.getCloudantCredentials(name: "MyTodoListDB") + do { manager.load(.environmentVariables).load(file: configFile) let cloudantConfig = try manager.getCloudantService(name: "TodoListCloudantDatabase") diff --git a/Sources/TodoList/TodoList.swift b/Sources/TodoList/TodoList.swift index 3a98990..90b99a1 100644 --- a/Sources/TodoList/TodoList.swift +++ b/Sources/TodoList/TodoList.swift @@ -18,7 +18,6 @@ import Foundation import LoggerAPI import SwiftyJSON -import MiniPromiseKit import Dispatch import CouchDB