WCOMAB / SqlServerSlackAPI

SqlServerSlackAPI is a SQL Server CLR assembly for direct communication with Slack via TSQL
Microsoft Public License
29 stars 7 forks source link

Need build instructions #1

Closed paquettej closed 9 years ago

paquettej commented 9 years ago

Being unfamiliar with cake and appveyor, could you provide build instructions as well as deployment instructions?

devlead commented 9 years ago

@snowmoonsoftware sure will take a look at that, thanks for the feedback. :+1:

va3paw commented 9 years ago

Got error opening the solution with VS 2013 - says my VS is too old. What version of VS do you use?

Also, when running build.ps, nuget cannot download packages, gives error: The type initializer for 'NuGet.ProxyCache' threw an exception.

devlead commented 9 years ago

Hi,

We're using Visual Studio 2013, Update 4 with SQL Server Data tools 12.0.41012.0 and NuGet 2.8.50926.664.

But will take a look and see if I can reproduce the errors.

Regards, /Mattias

devlead commented 9 years ago

Hi,

Tried a new install of VS2013 and got an error, make sure you have the latest version of instructions available here SQL Server database tooling in Visual Studio 2013: https://msdn.microsoft.com/en-us/dn864412

But basically they are available via in Visual Studio ->Tools -> Extensions and Updates menu.

After upgrading SSDT i was able to build fine.

Temporarily disabled assembly signing to make it easier to build, I will look into if I can fix this via build script or at least provide better instructions.

Will also look at fixing a myget nuget package, so we have pre-build/signed assemblies available.

va3paw commented 9 years ago

Thank you! Updating to VS2013 Update 4 helped. Also disabling assembly signing helped as well. Was able to build. Now attempting deployment to SQL Server.

devlead commented 9 years ago

Great, it will need to be signed for it to work in SQL Server, I'm fixing the build script to handle this.

va3paw commented 9 years ago

Right, just generated my own key, so was able to rebuild DLL and deploy it to SQL server using provided deploy.sql script. All worked well. Got a token from slack.com, able to post messages! Thanks so very much!!

paquettej commented 9 years ago

Sorry for hijacking this issue, but could you detail how you generated your own key? I’m not familiar with the process..

Thanks! Jeff Paquette 508 667 1205 jeff@snowmoonsoftware.com www.snowmoonsoftware.com skype: snowmoonsoftware

On Apr 21, 2015, at 5:24 PM, Paul notifications@github.com wrote:

Right, just generated my own key, so was able to rebuild DLL and deploy it to SQL server using provided deploy.sql script. All worked well. Got a token from slack.com, able to post messages! Thanks so very much!!

— Reply to this email directly or view it on GitHub https://github.com/WCOMAB/SqlServerSlackAPI/issues/1#issuecomment-94946997.

devlead commented 9 years ago

@snowmoonsoftware not hijacking the thread! I missed to get back to you.

You can use makecert & pvk2pfx SDK tools or create in studio.

But I have now adjusted the build script to sign the assembly, the self signed cert in the repo (.\src\SqlServerSlackAPI\SqlServerSlackAPI.pfx) password is SqlServerSlackAPI

So just build in Studio and when doing release you can just build.ps1 and it will build & sign release for you.

devlead commented 9 years ago

@snowmoonsoftware Using command line this is the process for created self sign cert (preferably for production you've bough an real cert, but for testing this is just fine)

First use makecert, it's included in the Windows SDK usually located C:\Program Files (x86)\Windows Kits\[sdk version]\bin\[cpu] i.e. C:\Program Files (x86)\Windows Kits\8.1\bin\x64

Creating the private key & cert used to create pfx is done like this

&"C:\Program Files (x86)\Windows Kits\8.1\bin\x64\makecert.exe" -n "CN=WCOM AB" -cy authority -a sha512 -sv "privatekey.pvk" -r thecert.cer

It will ask you for a password if you don't want one just press ok.

To combine private key & cert into a pfx we use the pvk2pfx tool found in same folder as makecert You call pvk2pfx like this

&"C:\Program Files (x86)\Windows Kits\8.1\bin\x64\pvk2pfx.exe" -pvk .\privatekey.pvk -spc .\thecert.cer -pfx privatekeyandcert.pfx

You will now have a PFX.

va3paw commented 9 years ago

@snowmoonsoftware In Visual Studio, go to Solution Explorer, right click on Project -> Properties In Properties, click on SQLCLR tab, then [Signing...] button Enable checkbox 'Sign the assembly', then in the dropdown choose 'New...', In 'Create Strong Name Key' put some key file name and then enter some password, then click [OK] button.

Then build solution - the DLL assembly will be signed. Then copy files from bin/debug folder to your server, and open Deploy.sql in SSMS. In Deploy.sql, update the path to the DLL file and update the name of the database which will contain the CLR function (replace SlackApiTestDB with your db name; If unsure, you can use 'master').

devlead commented 9 years ago

Indeed @va3paw :+1:

Will try to find some time to update the ReadMe with build instructions, CI is up and running, so when I'll get a moment over i fix prebuilt with real cert signed assemblies.

Please let me know if you have any more questions or suggestions, thanks for your feedback @snowmoonsoftware & @va3paw :+1:

devlead commented 9 years ago

@va3paw password is SqlServerSlackAPI so you could also just change password by entering SqlServerSlackAPI 3 times and it will remember it for you.

va3paw commented 9 years ago

@devlead thank you, great package! :+1: