How to minimize all custom java script files used in an AngularJs project? - angularjs

It is possible to minimize all custom java script file Manually or Automatically ?
We are using TFS for source code management , Its also possible that auto minimize Java script file by source control system or build system , when deploy code in windows Azure system or web deploy?
Note - I am not using .net application its core AngularJs application and communication done by web-api hosted on other server.

It is possible, you could integrate a build script runner like Grunt with your TFS that could minify all your javascript files. When you use Grunt you can also run it manually when developing.
I would suggest you take some time to get familiar with build script runners like Grunt to see what the possibilities are.

Related

What is the right way to upload build folder to production server for create-react-app?

I'm currently working on a live project. The frontend part of the system is in ReactJS. We are using create-react-app as the starter kit.
We are facing some issues in deploying the application on live server. Earlier we followed the strategy of pushing the code on server and then creating the build on it. But we noticed that so long the build was generating, our site became unavailable. Which does not seem right. Hence we decide to create build folder in developer's local machine and push the build to the server. But now we are receiving a lot of change requests and feature requests, hence I'm planning to move to a robust git branching model. I believe this will create problem with the way we are currently handling our deployment strategy(which is to move the build to production).
It will be really helpful if some one can show us the right direction in handling deployment of ReactJS apps.
You can use Jenkins which can be configured to trigger the build as soon as a code in a branch is checked-in in GIT. I have not worked on Jenkins but surely, I have seen people using Jenkins for such things.
Jenkins will trigger the build in its own environment (or you can create a temp folder for the time being the build is getting generated if Jenkins operates on the server directly) which will generate the output bundle. So your code will not be removed from the server for that while and you can patch your new files to the actual folder (which can also be automated using Jenkins).

Best way to Continuous deployment for Drupal 7 websites

I tried many modules to deploy the changes from development to staging manually but didn't find the better way to deploy the changes either coding or database to the staging server automatically.
Is there anything for Drupal 7 by which I can push my changes from development to staging without any manual work? I want all database related configuration, codes etc to be pushed automatically on the live server.
Thanks
There are many ways you can automate your deployment. one of which we follow is as below:
Using third party services like platform or pantheon for deployment.
Using hook_update_N along with features and strongram modules for configuration management.
Using shell script for running custom commands after deployment.
Using jenkins for deployment automation.
Some other tools / services can be found here https://www.kelltontech.com/monkey-talk

AngularJS Startup - seed vs script

I'm currently working on a small AngularJS application to deploy on a web server, but I'm having a hard time understanding the difference between using Angular's startup seed compared to linking the script in the HTML, like this:
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.4/angular.js"></script>
I understand that using the startup seed lets you develop locally, but you can also link the script and download something like http-server to achieve the same effect, right?
So what are the benefits/drawbacks to using one startup method over another? Specifically, which would be more beneficial for hosting the app on a web server like Apache?
The benefit the seed adds is in configuration. They have done a lot of setup by creating and configuring a task runner to handle things like running a local web server, unit and e2e testing.
Without the seed you would have to set all of that up yourself from scratch. But if you don't care about testing, and you want to use your own local web server, then you don't need it.
Honestly if you are planning on hosting your even-remotely serious web app on a server, you have a lot more to worry about than what the seed provides.
You'll need a build process to concatenate all of your vendor and source code into a one large minified, obfuscated file for serving to the masses, for starters.
https://g00glen00b.be/angular-grunt/

Can I use MTM to execute my testcases that are wriiten in Selenium Java using Eclipse IDE

I have a application scenario where I am currently executing my test cases(written in selenium C#) using MTM, I want to know whether same can be achieved using selenium java from eclipse?
The same can be achieved using TFS 2015, in which we can create a new build of type ant/maven.Once the build has been created queueing the build would result in execution of test cases on pre configured agent machine.
While creating a build we need to provide build.xml (for ant) or pom.xml (for maven) which will contain all the details specific to the project and execute the same.
No
You can't use MTM to execute Java tests, however Microsoft is moving away form that model. This is likely because of this issue and they have already moved to using Team Build with VSTS & TFS 2015+ to execute all sorts of Functional Tests.
https://blogs.msdn.microsoft.com/dgartner/2016/02/23/running-selenium-tests-as-part-of-your-release-with-vsts-release-management/
They have a specific task for this and you can now associate all automated test results with Requirements for reporting without the need for Test Cases in tge middle.

Should i be using gradle for continuous deployment?

anyone has past experience with gradle? i'm thinking of using it for continuous deployment... i'm considering either using my own scripts (python) or gradle.
can anyone tell from experience which way he thinks recommanded to go? note i already use maven and i don't intend to move away for my dependency management and project management.
thanks
We have implemented Gradle-based deployment and environment management in a big governmental project (100+ servers). But we had to develop a custom set of plugins (which is actually rather straight forward process in Gradle) to handle tasks like remote SSH command execution through Groovy DSL, creation of application server domains/clusters (we are using WebLogic), application/configuration deployment.
We also are thinking of integrating Gradle with Puppet for easier Linux administration.
If you are coming from Java world, then using Gradle (which is Groovy-based) would be rather simple for you, because you can reuse your Java/Ant/Maven/Groovy knowledge to write scripts. Also an ability to create DSLs in Groovy may allow you to build interesting abstractions. Gradle also has very clean API which allows building nice dependencies between tasks. It also integrates very well with Maven infrastructure and you can reuse all Ant tasks.
Yes, Gradle-based deployment possible with gradle-ssh-plugin
Here is an article with good usage example.

Resources