Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

...

  1. Checkout Datical project from your source control (Git, TFS, SVN)
  2. Run "hammer removeLabels" command. This command takes two arguments:
    1. lookupChangesets - This is the script name which you want to abandon, e.g., "abandoned,temp_table.sql". The "temp_table.sql" will be the FIRST user provided argument.
    2. labels - This is the label you want to remove from your changesets, e.g., "abandoned"
      1. Once you agree on what naming convention to use to abandon changes, this argument can be programmatic (e.g., "abandoned/1.0.0") or hard-coded (e.g., "abandoned").
  3. Run "hammer addLabels" command. This command takes two arguments:
    1. lookupChangesets - This is the script name which you unabandon, e.g., "temp_table.sql". The "temp_table.sql" is the FIRST user provided argument.
    2. labels - This is the new release label you want to give to your changesets, e.g., "release/2.0.0". The "release/2.0.0" is the SECOND user provided argument.
  4. Commit and push Datical project back into source control
  5. Publish a new artifact version


Here is the complete sample script with some additional code for before and after status:

...

Code Block
languagebash
firstline1
titleAbandon Changes
linenumberstrue
echo -------------------------------
set PATH=%PATH%;C:\apps\Datical\repl

git clone http://user@bitbucket.datical.net/scm/bbu/ddb.git
cd ddb

git branch --set-upstream-to=origin/master master 
git status

hammer findChangeSets --lookupChangesets="abandoned,%lookupChangesets%"
hammer removeLabels --lookupChangesets="abandoned,%lookupChangesets%" --labels="abandoned"
hammer addLabels --lookupChangesets="%lookupChangesets%" --labels="%newReleaseLabel%"
hammer findChangeSets --lookupChangesets="%lookupChangesets%,%newReleaseLabel%"

REM add steps to commit Datical project into Git.
echo commit new changes back into Bitbucket
call git add -A
call
git commit -m "Automations:UnabandonScript-%lookupChangesets% - build number=%BUILD_NUMBER%"
call git push -u origin master
echo -------------------------------

...

Here is how the abandoned changeset looks like in Datical GUI:


Now that the "abandoned" label has been added, you want to make removed, make sure to create a new artifact version.

  1. When you use your deployment automation tool you will use your newly created versioned artifact to deploy database changes.

Make sure that you alway deploy using "!abandoned" label (notice the "!") with your deploy automation tool. Here is a sample deploy command you would use:

    1. hammer deploy STAGE --labels "release/2.0.0 AND !abandoned"
    2. hammer deploy PROD --labels "release/2.0.0 AND !abandoned"


Filter by label (Content by label)
showLabelsfalse
max5
spacescom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@1ff1d7
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel in ("unabandon","abandon") and type = "page" and space = "DDKB"
labelsabandon unabandon

...