deployment,f#,f#-fake , FAKE FtpHelper Usage

FAKE FtpHelper Usage


Tag: deployment,f#,f#-fake

I am trying to use F# FAKE to deploy a zip file to GoDaddy using FTP. There seems to be a FTPHelper in FAKE but I can't find any usage examples of how to create a target to use it.

All I've been able to come up with is,

Target "Ftp" (fun _ ->
        |> Request uploadAFolder (fun p ->
        {p with
            server =;
            user = joey;
            pwd = somepassword1;
            srcPath = buildDir;
            rootPath = /httpdoc;

I am a n00b still learning F# so the syntax is still a bit foreign to me and there doesn't seem to be any tutorials yet for using it and the above doesn't seem to be close to being right. Does anyone have a bit more insight to show me how the FtpHelper usage should be?


uploadAFolder is a function defined as:

val uploadAFolder: server:string -> user:string -> pwd:string -> srcPath:string -> rootDir:string -> unit

The function takes several parameters rather than a single record. I believe it would be used as follows:

Target "Ftp" (fun _ -> 
    uploadAFolder "" "joey" "somepassword1" "buildDir" "/httpdoc"


F# - writing an (GA) evaluation function in F#

Background: I am currently working on a genetic algorithm (GA) in F#. (I come from a strong C# background and have only been using F# for a day now) Problem: I have an error evaluation function to determine how valid a proposed solution is.Lets assume a simplified error algorithm: Calculate...

Spring boot war file deploy on Tomcat

I use Spring Boot 1.2.4.RELEASE with gs-rest-service source file. I got: - - [18/Jun/2015:09:59:25 +0300] "GET /gs-rest-service-0.1.0/ HTTP/1.1" 404 1021 There are no other exceptions in Tomcat logs. I have read related questions, but my test doesn't run. Spring Boot War deployed to Tomcat I have read howto-create-a-deployable-war and...

How do I create a deploy git branch for my Yeoman project?

I created a new project using Yeoman. Using Grunt I've created the dist directory. My whole project is on Github,, and I've created a prod branch. My question is how do I get my prod branch to have only the contents of dist instead of having the dist directory...

Properly implement F# Unit in C#

This question is not about C#/F# compatibility as in this one. I'd like to know the proper way to implement a type like F# Unit in place of using void. Obviously I'll discard this result and I'll not expose this type to the outside world. Wondering if an empty class...

All the F# templates in VS 2015 RC disappear

I installed in a fresh Win 8.1 machine VS 2015 RC. I load VS and create a F# project. Fine. Eventually, I do some other stuff (that I have not remember) and then I found that no single F# template (for projects) exist anymore in VS. Only C#/VB ones....

running node.js sails app on openshift

I'm trying to deploy my node.js sails app on openshift. I followed procedure outlined in but still doesn't work. also try this: Node.js app on openshift no matter what i'm getting "Service Temporarily Unavailable" The server is temporarily unable to service your request due to maintenance downtime or capacity...

F# I want to filter my output

I have a problem which I have simplified for the purpose of this question. Let's just say I have 2 lists. The first actually represents a list of classes but for this purpose, let's say it simply represents a list of ints (2,4,6,8,10). I have another list of ints that...

Python/Flask deployment without pip

I've usually deployed my Flask applications with a fairly simple fabric script that put the source on the target machine, used pip to install any dependencies, then fired up uwsgi with all the necessary settings and off it went. However, I have a new issue that some new security settings...

F# Custom operators

I've defined a custom operator in F# like this: static member (&?) value defaultValue = if value = null then defaultValue else value The operator is defined within a type and should be called in the following scenario: I'm retrieving information about the system processors using WMI. Now i want...

How convert any record into a map/dictionary in F#?

I need to serialize arbitrary records into maps/dictionary. I imagine my end type look like this: type TabularData= array<Map<string, obj>> But I have problems in build a generic function that accept any record and turn them into Map....

F# Discriminated Union - “downcasting” to subtype

I don't really know what the proper title for this question should be, but: I have a discriminated union called MyDiscriminatedUnion in F#: type MyDiscriminatedUnion = | Foo of Foo | Bar of Bar where Foo and Bar are record types: type Foo = { ... } type Bar =...

Laravel 5 on shared hosting getting internal server error

I am trying to get my Laravel 5 project running on my shared hosting through FTP. I have uploaded all my project files from my local XAMP-folder to the server root directory and put the files in the 'public' folder in the public_html folder. When I go to I...

Capistrano Rails deploy with new migration files

I want to deploy from a new branch I have created. On this branch, the db/migrate content has changed, I removed some migration files and regenerated a new one. The problem is, when I cap staging deploy from this branch, it fails when running migrations PG::DuplicateTable: ERROR: relation "partners" already...

F# - Recursive function to copy a list

I wrote this code to recursively copy my list: let sp = [2;4;6;8;10] let copy (s1:'a list) = let rec copy acc ind = if(ind>=0) then copy (s1.[ind]::acc) (ind-1) else acc copy [] (s1.Length-1) sp |> copy |> printfn "%A" How to make this code easier?...

What underlying difference makes Node Instances appear different?

I have two similar (if not identical) node instances that are appearing differently in a deployment diagram (and anywhere else that I use them). I may have done some odd things in the past while beating EA into submission. But, now ... by pulling every lever I can imagine, I...

Post messages from async threads to main thread in F#

There is a subscription to an observable that sends out log messages. Some of the log messages come from other threads because they are are in F# async blocks. I need to be able to write out the messages from the main thread. Here is the code that currently filters...

shift/reduce and reduce/reduce errors in F# using fsyacc and fslex

I'm creating my own external DSL, which I intend to be pretty small and include some basic functionality. When I compile my project, it builds successfully but it shows a lot of shift/reduce and reduce/reduce errors. And most of them are around my binary operators. Here is part of my...

Azure deployment from source without TFS?,azure,deployment
Does anyone knows if the deployment from source feature of Azure is intended to work with .NET projects ? I mean, if I put source code in the local git repository of Azure and then trigger a deploy, is my source code going to be compiled and then deployed or...

Deploying to Android results in file not found after adding QtQuick Controls

After importing QtQuick.Controls 1.2 and using StackedWidget component, I now get an error when deploying to Android as seen below. The missing file AnimationDrawable.qml is not missing from the Android build directory so I do not understand why it is not packaged with the APK. It deploys fine when I...

Conditional Operator in F# (A?B:C) [duplicate]

This question already has an answer here: Does F# have the ternary ?: operator? 3 answers In C#, we have the conditional operator: [condition] ? [value if true] : [value if false] But I can't seem to find this in F#. Does it exist?...

How to rewrite this C# code

I have this C# code: const int bufferLen = 4096; byte[] buffer = new byte[bufferLen]; int count = 0; while ((count = stream.Read(buffer, 0, bufferLen)) > 0) { outstream.Write(buffer, 0, count); } I need to rewrite it in F#. I can do it like this: let bufferLen : int =...

Deployment Project - custom action update

Situation: I have a Deployment Project in visual studio 2010 setup to install a console application. This console application has some custom actions written into it for the Deployment project. EDIT: To clarify, these custom actions are using the System.Configuration.Install.Installer class in .NET. I use the Committed, BeforeUninstall, AfterUninstall events...

F# computation expression transparent state passing with Bind

I have the following code that try to read a possibly incomplete data (image data, for example) from a network stream using usual MaybeBuilder: let image = maybe { let pos = 2 //Initial position skips 2 bytes of packet ID let! width, pos = readStreamAsInt 2 pos let! height,...

Finding deployment data to a SQL Database

In an effort to maintain versions of the databases we have in our CMDB, I have to obtain the versions of some databases deployed to our servers by a third party company. Is there a system table, view or procedure that allows me to view information regarding recent deployments (code...

Filtering a sequence of options and collecting the values of all the Somes. Is there a built-in function in F# for that?

A common pattern in F# is to want to filter something by whether it is "Some"thing and in case it is, getting its value: module Option = let values s = s |> Seq.filter Option.isSome |> Option.get I have the idea I've seen something like that in the F#...

Return a modified version of same type in F#

If I've got a class hierarchy like type Employee(name) = member val name: string = name type HourlyEmployee(name, rate) = inherit Employee(name) member val rate: int = rate type SalariedEmployee(name, salary) = inherit Employee(salary) member val salary: int = salary And I want a function that updates the name field...

Referencing event from .xaml file in .fs file

I want to declare an event in a XAML file and then add a handler in a fs file. The upper part of the XAML file would be something like (MouseRightButtonDown): <Window xmlns="" xmlns:x="" x:Class="AboutStack" MouseRightButtonDown="AboutStack_MouseRightButtonDown" Title="About" SizeToContent="WidthAndHeight"> <StackPanel>... The F# file contains: open FsXaml type MainWindow = XAML<"MainWindow.xaml", true>...

Change the “about this” window on mac app

On Macs, there's a default menu at the top for basic application handling functions: I've made an application using Java for my Grade 10 final project, (and I'm quite convinced that it's better than Microsoft Paint) and I decided to package it. Using Eclipse, I exported it as a Mac...

Can you list the contents of a namespace or module in F#

Similar to this question about clojure, is it possible to list the contents of a namespace or module in F#? When I open a namespace for a loaded DLL I'm not receiving an error that the namespace doesn't exist, but then when I try to use the documented functions I'm...

Deployment of Python API

I'm trying to understand the simplest way to deploy a Django application in production. Many recommend nginx or Apache along with uwsgi or gunicorn. I think that is more than my situation requires, and I would like know if my thinking is correct. This application is nothing more than an...

Slow wpf startup due to publish policy… maybe

I have deployed my .NET assemblies with x-copy for years, without any issue. From last week, we have a small team that wich has the task of build a setup that includes .NET assemblies and exe and c++ legacy exe and dll (more tha 200 files). After the first installation,...

Duck typing with type provider instances [duplicate]

This question already has an answer here: How do I write this member constraint in F#? 1 answer I am writing an F# script to operating on tables in a database. All of the tables have a Guid Id property. I want to make use of duck typing to...

Unable to deploy through capistrano after ubuntu upgrade

I recently upgraded my development machine to Ubuntu 15.04 (was 14.04LTS) and ran into a problem when trying to deploy changes to my server. The interesting bit is, that I can ssh into my server without any issues (hence, the key file is setup correct), but when I try to...

How can I resolve the “Could not fix timestamps in …” “…Error: The requested feature is not implemented.”

I have been trying to build a project in F# on Linux that I have located here on github. It's a basic kata project that I am working on as a demo. However on Linux (specifically Ubuntu 14.04 LTS Desktop) I haven't been able to get it to build yet...

How to automate deployment of source & compiled code (excluding git history) to third-party developers?

I'm going to setup some tools/techiques/environments so that when I need to provide the source code for third-party developers, I do it without git history with some sensitive code already compiled and stripped. So I want to automate this process, so that I always provide the latest version of it...

Doc.Checkbox 'change' event does not occur in Websharper.UI.Next

I have reactive Var variable varDone and Doc.Checkbox for its representation named cbDoc. After changing the value of varDone I need to call my function. For this, I wrote the code illustrated in the following pseudo-code: open WebSharper open WebSharper.UI.Next open WebSharper.UI.Next.Html open WebSharper.UI.Next.Notation // declaring reactive bool variable let...

How to correctly add ENV[“SECRET_KEY”BASE"] in rails

I am having a difficult time setting up Rails 4.2 in production on a VM running on passenger and nginx, and not using RVM or anything similar. I got Incomplete response received from application and looking in the nginx error log it said something about missing secret_key_base and secret_key although...

How to recursively identify cells of specific type in grid?

I'm learning F# and I'm building a minesweeper app. As part of that, I'm trying to have a method that detonates all adjacent mines if a mine is detonated, recursively. So if I have a grid like: | 0 | 1 | 2 | ------------------------ 0 | E-1 | M...

Duplicate Key in index of Deedle Series

I have a list of events that occur in a system. My goal is to take the list of events and create a sliding window of the series to determine rate event occurrences. The events are loaded into the events list from an application outside of this scope of the...

F# - Result is list of list of int instead of a list of int

I have quite a complex problem that I have simplified for the purpose of this question. Let's just say the problem is as follow: I want a list of the first 3 numbers (1,2,3) added to all of these numbers: 0,10,20 So I want the following desired output: all =...

Is this definition of a tail recursive fibonacci function tail-recursive?

I've seen around the following F# definition of a continuation-passing-style fibonacci function, that I always assumed to be tail recursive: let fib k = let rec fib' k cont = match k with | 0 | 1 -> cont 1 | k -> fib' (k-1) (fun a -> fib' (k-2)...

interpreting a script through F#

I really like F# but I feel like it's not succint and short enough. I want to go further. I do have an idea of how I'd like to improve it but I have no experience in making compilers so I thought I'd make it a scripting language. Then I...

How to implement generics with type annotations in F#

I have the following skeleton of code: type MyException<'T> () = inherit Exception() type IMyInterface = abstract member Method<'T when 'T : (new: unit -> 'T) and 'T :> Exception> : string -> int type MyClass = interface IMyInterface with member this.Method s = let i = s.IndexOf "a" if...

Asynchronously manipulating data from streamReader in F#

On the line of Read large txt file multithreaded?, I have the doubt of whether it is equivalent to pass to each thread an sliced chunk of a Seq and whether it will safely handle the paralellism; is it StreamReader thread-safe? Here is the code I am using to test...

What is the difference between member val and member this in F#?

When I created a class containing a generic, mutable .NET Stack in F# like the example below, that stack ignores anything I push onto it. open System.Collections.Generic type Interp(code: int array) = member val PC = 0 with get, set member this.stack: Stack<int> = new Stack<int>() member this.Code = code...

How to handle Arithmetic operation OverflowException in F#?

I'm doing Project Euler problem 1 in F#: Multiples of 3 and 5 If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples...

F# “The value of constructor … not defined”

So, this is my second F# console application. The code goes like this: let rec fact n = if n = 1 then 1.0 else float(n)*fact(n-1);; let rec pow x n = if n = 1 then x else float(x) * pow x (n-1);; let rec func1 eps x n...

Does let!/do! always run the async object in a new thread?

From the wikibook on F# there is a small section where it says: What does let! do?# let! runs an async<'a> object on its own thread, then it immediately releases the current thread back to the threadpool. When let! returns, execution of the workflow will continue on the new thread,...

FParsec parses only first half

In my AST, I have something like this: type Program = Declaration list and Declaration = | TypedefDeclaration of TypedefDeclaration and TypedefDeclaration = | Typedef1 of Name * TypeName | Typedef2 of Name * Name For parsing both of the statements, I have used something like this: let tdefpartial =...

Why embed async in async?

I read the following code from the book Expert f#, Why the function collectLinks embeds let! html = async { .... } in the outer async block? How about just flat it by removing the inner async? Same question for the function waitForUrl in urlCollector which has a do! Async.StartChild...