Flyway migration scripts between different git branches - flyway

We have multiple git branches lets say A and B which have same sql scripts for now.
Now we have to start creating new scripts on branch B where after a while eventually that will be merged to main branch. Now if my branch B is exceeded
example:
Branch A has v1, v2 scripts and
Branch B has v1,v2,v3,v4.
In case i want to use v4 migration script file in branch A with the same name how do i do that ?

Related

Serve RMarkdown outputs without version controlling them

We frequently use RMarkdown based packages to create websites with R (bookdown, blogdown, distill...) and use github-pages to serve the html files via the url username.github.io/repo.
In this approach, the ouput (i.e. html / css) files are also version controlled, and are frequently included in commits by mistake (git commit -a). This is annoying since these files clutter the commit and often lead to fictitious files conflicts.
Ideally, the outputfiles would not be version controlled at all, since the binary files (images) additionally bloat the repo. So I'm looking for a solution where:
Git ignores the output files completely but provides an alternative (but comparable1) method to gh-pages to serve them
Git ignores the output files temporally and committing / pushing them to gh-pages is done in a separate, explicit command
1: The method should be command line based and provide a nice URL to access the website
You could have .html, .css etc. ignored in the main and all other branches but the branch, for example, the gh-page branch, where your github-page is built from.
Git does not support different .ignore files in different branches so you would have to set up a bash script that replaces the ignore file each time you checkout a new branch. See here for how to do that: https://gist.github.com/wizioo/c89847c7894ede628071
Maybe not the elegant solution you were hoping for but it should work.
If you have a python installation on your computer, you can use GitHub Pages Import, a tool designed specifically for this purpose.
You need a python installation since it has to be installed with pip, but once it's installed it integrates beautifully with into an R / RMarkdown workflow.
Once it's installed (pip install ghp-import), you can run ghp-import docs (assuming docs is where your RMarkdown outputs are stored).
There are a bunch of practical options that you can use, including -p to additionally push the changes to your remote after the commit.
You need to tell Git to ignore the folder the book gets built into.
So, for example, by default bookdown puts all the built files in a folder called "_book"
Just add the following line to the .gitignore file in your project.
_book
Then you can work on your book and build it and push changes without worrying about the site being updated.
To update the site, you want to create a gh-pages branch that is only used for the hosted content. Do that with these commands from in your book folder:
git checkout --orphan gh-pages
git rm -rf .
# create a hidden file .nojekyll
touch .nojekyll
git add .nojekyll
git commit -m"Initial commit"
git push origin gh-pages
Make sure (once you put your book content in that branch) that GitHub is set to use that branch for hosting, rather than the folder you were using before.
Then, you can switch back to your main branch with the following command:
git checkout master
Next, you will clone your gh-pages branch into your main project:
git clone -b gh-pages https://github.com/yourprojecturl.git book-output
Then, when you have a version of the built book (in the _book folder) ready to use as your live site, use the following commands to copy the content into the book-output folder and push that to the gh-pages branch where the live site is:
cd book-output
git rm -rf *
cp -r ../_book/* ./
git add --all *
git commit -m"Update the book"
git push -q origin gh-pages
You can continue to use this last set of commands whenever you have a version in _book that you're ready to push live.

control-m migrate from dev to prod

I am new in Control-M 8.0, could someone help me out?
I developed 3 new jobs a1,a2,a3 in DEV folder xyz, and I want to move a1,a2,a3 to PROD folder xyz. Currently there are b1,b2 in PROD xzy folder.
My questions are:
how to deploy to PROD from DEV? Is the below correct?
I export a1,a2,a3 from DEV xzy folder to a.xml file.
I export b1,b2 from PROD xyz folder to b.xml.
open a.xml and b.xml.
copy the content of a.xml and paste to into bottom of b.xml and save as bb.xml.
send bb.xml to product support team to import to PROD
in bb.xml. do I need to change hostname, creation_user, version_host of DEV to PROD hostname, creation_user, version_host? Will these be changed automatically when support team deploy bb.xml?
Do we have to make JOBISN unique? In bb.xml, job a1 and job b1 have the same JOBISN, do I have to change JOBISN of a1 to any other value that is not same as JOBISN of b1?
Open the two folders in the same "Workspace" then copy those jobs from one table to the other one. Change the values you need as hostname, user, etc...
Control-8 does not do that. Control-M 9.0.18 does it. You should consider upgrade your Control-M.

Create Gitblit proposal ticket using git subtree

I have a project ProjectA that uses shared library LibB. LibB is added to ProjectA using git subtree:
git remote add rm_LibB ssh://user#127.0.0.1:222/LibB.git
git subtree add --prefix=libs/LibB --squash rm_LibB/master
According to this documentation to create a proposal ticket you should do:
git checkout -b mytopic
...add a single commit...
git push origin HEAD:refs/for/new
However in case of subtree I'm usually using:
git subtree push --prefix=libs/LibB rm_LibB master
if I want to push changes made in LibB(being in ProjectA) to a master branch on remote LibB reposioty.
So far I've tried to
git subtree push --prefix=libs/LibB rm_LibB refs/for/new
which results in creating a new branch refs/for/new on remote LibB repository with no ticket created.
My current solution is to create proposal ticket from web interface and then
git subtree push --prefix=libs/LibB rm_LibB ticket/N
where N is the ticket ID.
But I would like to be able to create proposal tickets automatically.

Can you help interpreting my svn diff output?

I am comparing two folders using SVN DIFF (one in branch and one in trunk) ... aim is to determine the list of changes.
I then made some changes to the files in the branch. But the output shows that I have modified them in the trunk.
Why does this happen ?
Is there a better command to obtain the results I am looking for ?
The command that I am using now:
SVN DIFF --SUMMARIZE (URL of a folder in Trunk) (URL of a folder in Branch)

Tell MSDeploy.exe to skip deploying a few select files in subsequent deployments

How do you tell MSDeploy.exe to skip deploying a few select files in subsequent deployments?
For e.g. I deploy a package that has files A, B and C. Then, I make another fresh build and therefore another package of the same application, only this time with the new version of the binaries A, B and C.
Now, I want MSDeploy.exe to deliver/deploy only files A and C, and to not deploy the new version of file B.
Is there a way to do that?
I think you can create a rule in the config file if you wish to skip those files in every single deployment.
The config file is located at C:\Program Files\IIS\Microsoft Web Deploy V2. It is called msdeploy.exe (XML Config File). The sample config file is in the same directory as masdeploy.exe.configsettings.example
Please post your solutions or any other findings.

Resources