I just cloned our remote repo on my new system that I just installed Node/npm on. Then I ran npm install to get all the packages installed. Was this not the right command?
VSCode is showing me huge differences in the lock file. The lockFileVersion changed from 1 to 2 and there many, perhaps hundreds, of changes in this huge file. Why would that happen and what is the potential impact of checking this in?
It looks like the changes are mostly related to node modules. example:
"node_modules/css-declaration-sorter/node_modules/chalk/node_modules/supports-color": {}
Where that entry wasn't there in the existing repo.
Or am I making a big deal out of nothing?
Your package.json file specifies limits and ranges of acceptable versions, while the lock file specifies the exact versions you are using, taking into account all the dependency resolutions that were available the last time you ran install.
In general, if your code builds and runs, you want to publish the lock file to your repository. This will ensure the production build will use the exact versions you have built with.
A while back I generated a project with JHipster Registry, among other things (let's call it conf1). After a few months I realized I don't need it and changed everything I need to so my project would work properly (this one will be conf2) and it work as expected.
Now, every time I want to upgrade my project, JHipster generates everything based on config1 instead of config2, which means my changes to get rid of anything I don't want, for instance JHipster Registry, get overridden by the upgrade.
So my question is: what do I need to change so that every time I upgrade to a new JHipster version, I don't get it done based on config1?
Deleting the jhipster_upgrade branch solved the issue.
How would you get ansible or puppet to deal with the following use case:
An application, X version 1, is installed with its configuration variables for version 1. Subsequently X version 2 is released with a different config variable set (i.e. that appplication may have added or removed a variable from their files under /etc). I want to upgrade to X version 2 and preserve old configuration from X version 1. I also want the option to rollback to X version 1 at a later date restoring it to the configuration state it had prior to upgrading to X version 2.
How would you go about ensuring this using Ansible or Puppet?
Your question is likely to be flagged as overly broad because there are so many potential answers/approaches, and it's going to depend greatly upon a number of other questions, such as:
Are you using a package manager (rpm, apt, etc) or are you installing applications manually, using gnu automake, or something else?
Precisely what sorts of configuration files are involved, how many, where are they located, etc?
At the most basic level, if you're relying on well-maintained packages then simply using the appropriate package manager may suffice. If you're doing anything beyond that then you're going to have to customize things based on your own preferences. There is no single wrong or right answer as to how to do this sort of thing simply because there are so many different approaches based on your individual needs/requirements.
As way of one example, suppose you have an application that relies on the configuration file /etc/service.conf, which only has a single entry containing a version number:
version: 1.2.3
You could simply template this file and specify the version number in Ansible or Puppet. For example, in Ansible you would just have a template that looks like this:
version: {{ version }}
And then a playbook that looks something like this:
- hosts: localhost
vars:
version: 1.2.3
tasks:
- yum: name=package-{{ version }}
state=present
- template: src=service.template
dest=/etc/service.conf
Of course you might want to expand this to ensure other versions of the package are removed so only the latest version exists.
If your environment is more complex, for example having a lot of different configuration files that need to be maintained and/or templating not being a viable solution then you probably want to implement some sort of backup/archiving of the configuration files before updating them. This could also be done any one of a number of ways, for example:
Using the Ansible fetch module to fetch configuration files from the target server
Simply invoking tar, cp, or something similar to make a backup of the files on the target server
You could also design a completely unique method of maintaining multiple versions of applications. For example, we use symlinks to manage multiple versions of third party applications as well as our own applications. We build and install different versions of Apache in locations like /deploy/software/httpd-2.2.21, /deploy/software/httpd-2.4.0, etc. and have a symlink named /deploy/software/httpd that points to the version we currently want to run. All the version-specific configuration files, etc. remain in the version-specific directory, so switching versions is as simple as shutting down Apache, changing the symlink, and restarting Apache.
When building a new version of my application, it's possible that files that were needed in a previous version are no longer needed. I would like these to be cleaned up during an upgrade. My ideas so far:
I considered using the InstallDelete, but this would require the current build to know what files the previous build contained. The build process is automated, and I'd prefer that the build didn't have to check in anything. (It makes tagging and the like rather messy.)
I also considered running an uninstall, but this would mean that the upgrade could not be fully rolled back (since the application would have been uninstalled).
Is there a way to detect files that were present in the old install but not the new one during the install and to have Inno delete them in a way that could be rolled back (or that happens only if the install was successful)?
So I'm using Visual Studio 2012, and whenever I create a new project I always leave out the "Add to source control" option, mainly because I don't what it is, what it's purpose is, or if it would be beneficial to me to use it.
I'm developing a rather large library on my own. I plan on making it open source. Is this what source control is for? Reading up online did not help me unfortunately, I'm still desperately confused. Is source control the same as version control too, by the way?
Some clarification would be greatly appreciated.
Thanks!
Alex
Source control (otherwise known as revision control: http://en.wikipedia.org/wiki/Revision_control) is a way in which you can store and manage changes and revisions to your code-base.
Google: SVN, Git, Mercurial and Google Code, GitHub, Bitbucket.
I personally never start a propject (personal or otherwise without it). Also, I like BitBucket (www.Bitbucket.com) for managing my projects. It's free for a single user and they support Git and Mercurial.
Quite simply, source control is a repository where your source code is stored. It's purpose is to provide a storage spot that is separate to the copy that you are currently working with, so you can make changes locally and then submit them back to your source control repository.
Think of it as being like a library - you can get code out, you can return (modified) code to it. It also gets more complex than that - you can use source control to handle multiple versions of the same source, and to merge changes from one copy to another. Additionally most (all) source control systems should provide a mechanism for tracing changes to code (i.e. audit tracking), and a means to "roll back" or revert to a previous version.
There are a variety of source control systems, some of which you install locally and some which you install centrally and access remotely. In all cases the underlying philosophies are mostly the same, although there are some differences around terminology and implementation of features. Source control is considered to be a system that is separate to your editor, your editor then provides a means to specify which source control provider to use and the location of the source control repository.
I have found this
Git Source Control Provider is a plug-in that integrates git with
Visual Studio
According to this, seems like source control = version control
You were asked this when starting a project because it's much easier to setup before you have many messy pieces. Github is a form of version control. An organized place for code to grow.
Version control really shines if you're collaboratively working on a project with many different pieces to it. Source or version control is the process of taking the many different parts that are being worked on simultaneously and bringing them together as a final project.
If you're working on your own it still may be beneficial to practice with, as still holds some value in allowing a process of documentation, and modular pieces being brought together for a final project.
This wonderful post explains many of the benefits of using version control for your pet projects.
Well, there are a number of good reasons:
1. It’s good to be in the habit. Sure, you may be working alone. But in
the future you may not be. Or your “weekend hobby project” might turn
into a popular project with many developers. If anything like that
happens, being in the habit of using source code control will stand
you in good stead.
2. It protects your code. Since your code is stored
in on a server apart from your development machine, you have a backup.
And then, you can even backup the code on the server. Sure, you can
zip it all up any time you want, but you don’t get all the other
benefits I’m listing here.
3. It can save your butt. Sometimes, you
might accidently delete something. You might make mistakes and change
code that you didn’t want changed. You might start off on some crazy
idea when you are feeling a bit saucy, and then regret it. Source
control can save you from all of these by making it a piece of cake to
revert to any previous state. It’s like a really powerful “undo”
feature.
"Source control" refers to the concept of storing all files that make up the source of an application in an (usually online) repository - where one can manage with fine detail exactly what has changed in the source code between versions, manage issues, involve other people with the project, and generally provide a platform to collaboratively manage a project.
The term is usually synonymous with version control - although you can have a repository and not explicitly name versions. Version control in particular just refers to labeling major versions of your project with a hierarchical numbering scheme (1.2.4 etc.)
There are several different tools that implement different kinds of source control. For example, Git is a source control tool that sets lets you manage a project. Github is a web-site that repositories managed with Git are usually stored on. Mercurial is yet another source control tool.
Typically, source control can be complicated to understand, and usually requires significant time studying tutorials. A lot of concepts are unfamiliar to solo programmers who have only worked on small projects. Changes to source code are managed through commits, and different branches of the project can be worked on by multiple people. Changes from separate branches can be merged, and the project can be forked by another user entirely (at least for Git).
Making your library open source is a good idea, and it's not too hard to give it a home on github. I would look into some resources to find out how to set it up.
Wikipedia says:
Revision control, also known as version control and source control
(and an aspect of software configuration management), is the
management of changes to documents, computer programs, large web
sites, and other collections of information. Changes are usually
identified by a number or letter code, termed the "revision number",
"revision level", or simply "revision". For example, an initial set of
files is "revision 1". When the first change is made, the resulting
set is "revision 2", and so on. Each revision is associated with a
timestamp and the person making the change. Revisions can be compared,
restored, and with some types of files, merged.
In simpler terms, source control allows multiple people to work on the same project without everyone clobbering everyone else's changes. Changes to the same file are merged together, and conflicts can be resolved.
It also allows you to keep version history. You can roll back a file to the way it existed at any point in time, as well as maintain different branches of the program; a way to organize groups of changes.
As Si puts it, source (or version) control will save your life 20 times over.
Source control keeps a detailed history of your code. This enables you and any collaborators to:
Review the history of any code
See changes between two versions
Revert any code you just goofed up
Prevent you from losing any code
Discover which changes caused bugs / crashes
Blame whoever messes up your code
Keep an up-to-date backup of all of your code
Even if you're not working collaboratively, source control is so useful when you accidentally delete your code. I speak from experience.
I would recommend using Git or Mercurial, as they allow branching and offer a more isolated workspace for collaborators to experiment without fear of harming any code.
For online collaboration, Github and Bitbucket are great and integrate well with Git and Mercurial, respectively. They also allow you to track collaborators' changes, choose and merge changes into a central repository, and keep a detailed list of issues.