Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tagging of remote repo. #903

Merged
merged 3 commits into from
Jan 4, 2017
Merged

Add tagging of remote repo. #903

merged 3 commits into from
Jan 4, 2017

Conversation

arknoll
Copy link
Contributor

@arknoll arknoll commented Jan 3, 2017

Fixes #830.

Changes proposed:
Todos:

  • Create a new deploy:tag target, which create a tag on remotes.
  • Add a prompt to the deploy target which asks Would you like to create a tag?.
  • If yes, prompt for tag name "Enter the name of the tag to create:" and use input to set the value of deploy.tag property.
  • Modify deploy target. If deploy.tag is set, call deploy:tag after deploy:commit.
  • Modify deploy:push-remote target. If deploy.tag is set, push tags too.
  • Document new feature.

Note: I incorporated this into my project's .travis.yml by adding:

deploy:
   - provider: script
     script: blt deploy -Ddeploy.commitMsg="Automated commit by Travis CI for Build ${TRAVIS_TAG}" -Ddeploy.branch="master-build" -Ddeploy.tag="${TRAVIS_TAG}"
     skip_cleanup: true
     on:
       tags: true
       php: 5.6

Using this in travisCI will force a tag on the master branch. TRAVIS_BRANCH variable is set to the same as TRAVIS_TAG when travis is building based on a tag.

@grasmash grasmash added the Enhancement A feature or feature request label Jan 3, 2017
@@ -18,6 +18,10 @@
promptText="Enter a deploy branch (defaults to [current branch]-build)"
promptCharacter=":"
defaultValue="${branch.current}-build"/>
<propertyprompt propertyName="deploy.tag" useExistingValue="true"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to split this into two prompts:

  • Add a prompt to the deploy target which asks Would you like to create a tag?.
  • If yes, prompt for tag name "Enter the name of the tag to create:" and use input to set the value of deploy.tag property.

Otherwise, this will always create a tag.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refactoring now.

<if>
<isset property="deploy.tag"/>
<then>
<exec command="echo ${deploy.remote} | openssl md5 | cut -d' ' -f 2" outputProperty="remoteName"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remoteName should already be set here, so I think this line can be removed.


<target name="deploy:tag" description="Tag repository.">
<!-- Add -build to tag. -->
<exec command="git tag -a ${deploy.tag}-build -m '${deploy.commitMsg}'" dir="${deploy.dir}" logoutput="true" level="${blt.exec_level}" passthru="true"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This tags the "build" repo, but not the source repo, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we want to also tag the source repo? @geerlingguy

@geerlingguy
Copy link
Contributor

It's failing on the Drupal VM test (/home/travis/build/acquia/blt/tests/phpunit/Blt/DrupalVmTest.php:36)... that doesn't seem related.

@arknoll
Copy link
Contributor Author

arknoll commented Jan 4, 2017

@geerlingguy it looks like 8.x branch itself is failing. I agree, this seems unrelated to this PR.

@grasmash grasmash merged commit 9b05d42 into acquia:8.x Jan 4, 2017
@geerlingguy
Copy link
Contributor

@grasmash - I think I noticed a note about tagging the source repo... basically this should only create a tag in the artifact repo if the build is being run on a tag already created in the source repo (I think, right?).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement A feature or feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants