Outlook add-in Production and Development deployment - outlook

I created an react-outlook add-in using the yeoman generator and successfully deployed the war file in the oracle web logic server.
However, whenever I make small changes I need to create a new war file and deploy it again and again to test the add-in. I cannot test the add-in when it is deployed in the localhost due to CORS policy errors (Cannot call APIs).
Since, creating war files and deploying them again and again in the server is a tedious process, is there a way to easily test the add-in or a way to make the same process a bit easy?
Currently, I'm following these steps whenever I make a change in the code that needs to be tested.
Create the dist folder (npm run build)
Generate the war file
Copy the war file in my local folder and paste it in the network folder
Publish it in the oracle server
If it helps, I can see following two lines in the webpack.config.js file as well
const urlDev = "https://localhost:3000/";
const urlProd = "https://www.contoso.com/"; // CHANGE THIS TO YOUR PRODUCTION DEPLOYMENT LOCATION
Thank you in advance!

You can use webpack to automate the process of generating and copying the war file to the dist folder.
The URLs mentioned in your post are used when you build a debug or release version of the add-in. Depending on that the manifest file contains the appropriate URLs, so you could run it locally or from any web server.
As for CORS, see Addressing same-origin policy limitations in Office Add-ins for possible solutions.

Related

CI for hotswapping non-compiled files into VSO and Octopus pipeline

Context:
Currently we manually get a git dev branch built into a package into VSO, and once that package is built it deploys to Octopus and takes down the site for a good amount of time as all the built packages are loaded into each server the site sits on... But, honestly, a lot of the bug fixes end up being in js files that could easily just be hot swapped in... and it's just so annoying to have to wait for poor OPs and support to do all of this just for a teensy tiny change.
The pipedream:
I would like to set up CI that allows hot swapping of js,css,cshtml,html files to VSO and Octopus... This will allow small petty changes in javascript files to be issued out fast and without deployments...
...and also have another option that allows me to say, "look, i've changed some csharp files so i need a built package to be pushed up into VSO and Octopus". A manual rebuild if you will.
Question:
I'm missing the vocabulary to search for this in Google and wondered if you guys can help me on a path to setting this up.
You can just include the modified files (remain folder structure) in the package, then push this package to Octopus server and deploy with this package, then the necessary files will be replaced.
My workflow of IIS deploy:
New Deployment Target with Listening tentacle mode
Add Deploy to IIS process template for Octopus project
Enable Custom installation directory feature in Configure Features window of Process
Specify Custom Install Directory path in process
Build tasks:
Add Copy Files task to copy necessary files (e.g. js)
Add Package Application task to package these files (remain folder structure)
Add Push Packages to Octopus task
Add Create Octopus Release task
On the other hand, you can include all published files to package (tested with File System publish), then deploy with that package, the Octopus can compare files and just replace the modified files ({webapp}.dll will be replaced too, checked the Created, Modified time on target server)
Regarding get changed files during build, you can call Get commit with Changed items REST API, then create/modify the build variable (e.g. depAll) through Logging Command (e.g. PS: Write-Host "##vso[task.setvariable variable=depAll];]Yes") per to the changed files result, then using this variable in task condition (Control Options of each task) to determine which tasks need to be run. Specify conditions for running a task

How to set default value for <project>.SetParameters.xml for deployment page

During build msbuild creates deployment packages for several my web projects (and wcf services) which I want to run from command line (as last step of automated build process) to deploy to several different servers.
The structure of IIS application folders is the same on each one.
My problem is that I cannot find how to configure (override default value of IIS application). It is in .SetParameters.xml, like:
which is not what I want.
I read that it is possible to create parameters.xml in the project and put there something like:
or some say
I'm trying this but it does not change content of .SetParameters.xml
Can you advice what am I missing, or/and alternative way to do this.
Thanks!
If you want to deploy the web application package manually—either by running the .deploy.cmd file or by running MSDeploy.exe from the command line—there's nothing to stop you manually editing the SetParameters.xml file prior to the deployment. However, if you’re working on an enterprise-scale solution, you may need to deploy a web application package as part of a larger, automated build and deployment process. In this scenario, you need the Microsoft Build Engine (MSBuild) to modify the SetParameters.xml file for you. You can do this by using the MSBuild XmlPoke task.
For more information, please refer to: https://www.asp.net/web-forms/overview/deployment/web-deployment-in-the-enterprise/configuring-parameters-for-web-package-deployment

Copy file during Team City Build

I've got an MVC 5 project stored in Git. I've installed TeamCity 9.1.7 (build 37573) on our build server and I've set it up to successfully perform a build when a developer checks in code to Git. My goal is to deploy the MVC application using MS Web Deploy if the build is successful. I've seen a number of tutorials that suggest using a web deploy package, but these tutorials are six or more years old. Is this still the preferred method for deploying a successful TeamCity build to IIS?
Further, we've added the web.config file to gitignore for a number of reasons. Git houses as Web.config.base that developers will copy to their own web.config file as a starting point. A developer will copy the web.config.base file to web.config when they first pull down the project. I've tried to set up a command line task in TeamCity to xcopy the web.config.base file to web.config
Working Directory: (left blank)
Command: xcopy MyMVCProject\Web.config.base MyMVCProject\Web.config
This build step fails with exit code 4 at all times. I've set the TeamCity build agent service to run as a local administrator. I've tried this as straight command text as above, as a cmd or bat file, and with a variety of different path styles, going so far as to use the TeamCity working directory variable, excluding the MyMVCProject from the path, including the MyMVCSolution in the path, etc. Any ideas as to why the xcopy would fail?
This is the same problem I was facing.
But at last, we put the master web.config file on the server where TeamCity is installed.
Then once the Project gets deployed , I replaced the web.config file with the web.config file which is alreay present on server.
So there will be no conflict in the web.cofig file
You just need to add one more build step after the Web deploy step.
In that you can use Xcopy and you can replaced you web.config file
Hope this will work
WebDeploy is still a great option for deploying ASP.NET web applications. Its even used with the brand new ASP.NET Core framework. We don't use TC but do you WebDeploy/MSDeploy extensively at work to deploy 50+ applications.
Regarding your config setup, I've never seen this approach. We use Parameterization to handle config changes per environment (local dev included). If you're worried about security of the config values, you could secure your SetParameter files which have the sensitive info and include the web.config in source control with default or placeholder values.
http://www.dotnetcatch.com/2014/09/08/parameterizationpreview-visual-studio-extension/

Custom Config for Publishing to File System

I am having a MDHA Project and I am deploying to Devices and to the Web.
Is it possible (like in usual VS Projects) to have an custom Config, which calls a batch script on anything like this to publish the files on a file System?
Actually when i create a custom Config, it will also try to deploy it as an APP.
Thanks Markus
If I understand your question correctly, you want to use the same set of web assets (HTML, CSS, Javascript. etc.) to build both a hybrid app and a web site. I have a similar situation where my assets are part of an existing ASP.NET project.
I created a companion MDHA project and reused the assets by adding a target & task to the MDHA project file that copies the assets from the ASP.NET project to the MDHA project directory. Even though the assets are not part of the MDHA project definition (i.e., they are not present as items in the project file), this approach works because MDHA looks for files under the project directory on disk.
Of course, all of this depends on having web assets that are available at build-time.

appharbor not deploying static content

I just started hosting a web application on AppHarbor, and i configured it to listen to my github repository commits.
After each commit, I see on AppHarbor the build running the tests, and deploying, but when i go to my app page, hosted on AppHarbor I don't see any images, and the js scripts are missing.
I can actually see them in the github source, but when I download the package from AppHarbor, they seem to be missing from my 'static' folder...
Anyone else run into this problem ?... Any possible causes for this ?...
I solved the problem -
The reason this was happening because the content wasn't being copied to the output directory. I don't know exactly how AppHarbor build there Deployment scripts, but I changed the Copy To Output Directory option value to Copy Always and this solved the problem.
(The Build Action was already set to Content)
Make sure that the files are included in the C# project, and that their Build Action is set to Content.

Resources