deployment,f#,f#-fake , FAKE FtpHelper Usage
FAKE FtpHelper Usage
Question:
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.
http://fsharp.github.io/FAKE/apidocs/fake-ftphelper.html
All I've been able to come up with is,
Target "Ftp" (fun _ ->
|> Request uploadAFolder (fun p ->
{p with
server = ftp://10.100.200.300:21/;
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?
Answer:
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 "ftp://10.100.200.300:21/" "joey" "somepassword1" "buildDir" "/httpdoc"
)
Related:
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...
tomcat,deployment,spring-boot,war
I use Spring Boot 1.2.4.RELEASE with gs-rest-service source file. I got: 127.0.0.1 - - [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...
git,deployment,gruntjs,yeoman,branching-and-merging
I created a new project using Yeoman. Using Grunt I've created the dist directory. My whole project is on Github, https://github.com/d3a1i0/mykungfuisstrong.com, 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...
c#,f#,functional-programming
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...
templates,f#,visual-studio-2015
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....
node.js,deployment,sails.js,openshift
I'm trying to deploy my node.js sails app on openshift. I followed procedure outlined in https://gist.github.com/mdunisch/4a56bdf972c2f708ccc6 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 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,deployment,flask,web-deployment
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#,operator-overloading
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...
dictionary,f#,converter,record
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
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 =...
deployment,ftp,laravel-5,shared-hosting
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 mydomain.com I...
ruby-on-rails,ruby-on-rails-4,deployment,capistrano
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...
list,f#
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?...
deployment,uml,modeling,enterprise-architect
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...
.net,powershell,f#,system.reactive,f#-async
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...
parsing,f#,dsl,lexer,fsyacc
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...
asp.net-mvc,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...
android,qt,deployment,qml,qt5.4
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...
c#,f#,conditional-operator
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?...
f#
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 =...
c#,visual-studio-2010,deployment,setup-deployment
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
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,...
sql,sql-server,deployment
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...
.net,f#
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 |> Seq.map Option.get I have the idea I've seen something like that in the F#...
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...
wpf,xaml,f#,fsxaml
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="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="AboutStack" MouseRightButtonDown="AboutStack_MouseRightButtonDown" Title="About" SizeToContent="WidthAndHeight"> <StackPanel>... The F# file contains: open FsXaml type MainWindow = XAML<"MainWindow.xaml", true>...
java,osx,deployment
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...
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...
django,api,nginx,deployment,uwsgi
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...
.net,wpf,deployment,installer,publisher-policy
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,...
f#,type-providers,duck-typing
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...
ruby-on-rails,ubuntu,ruby-on-rails-4,deployment,capistrano
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...
linux,build,f#
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...
git,deployment,continuous-integration,bitbucket
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...
web,f#,websharper
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...
ruby-on-rails-4,deployment
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...
recursion,f#,tail-recursion
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...
f#,deedle
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#
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 =...
scala,f#,functional-programming,tail-recursion,continuation-passing
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)...
scripting,f#,interpreted-language
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...
generics,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...
asynchronous,f#,streamreader
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...
.net,f#,immutability
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...
python,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...
visual-studio-2010,f#
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...
f#
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,...
parsing,f#,dsl,fparsec
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 =...
f#
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...