Dpl: Custom deploy message for gh-pages

Created on 3 Mar 2018  Â·  18Comments  Â·  Source: travis-ci/dpl

I try to change the default commit message for gh-pages to one with an environment variable of the build. My deploy configuration in .travis.yml looks like this:

deploy:
  provider: pages
  skip-cleanup: true
  local-dir: build
  github-token: $GITHUB_TOKEN
  keep-history: true
  commit_message: "Deploy release ${TRAVIS_TAG}"
  on:
    branch: master
    tags: true

But Travis is still deploying with the default commit message and I couldn't find any solution to this after further research. Am I missing something?

pages (GitHub Pages)

Most helpful comment

Reopening to see if anyone is interested in adding this feature.

All 18 comments

At the moment, the pages provider does not provide you with means to do that.

Oh, what a pity. But thanks for the reply!

+1.

In past I deploy my site to GitHub Pages, use .sh script. Part of script:

commitHash=$(git rev-parse HEAD)
commitMessage=$(git log -1 --pretty=%B)
detailedMessage="Commit https://github.com/$TRAVIS_REPO_SLUG/commit/$commitHash pushed to GitHub Pages by Travis CI build $TRAVIS_BUILD_NUMBER — https://travis-ci.org/$TRAVIS_REPO_SLUG/builds/$TRAVIS_BUILD_ID"
git commit -m "$commitMessage" -m "$detailedMessage"

Result:

Custom commit message

It would be nice, if would be possible similar commit messages

Thanks.

Reopening to see if anyone is interested in adding this feature.

The code is here: https://github.com/travis-ci/dpl/blob/244c610bcc6b4e0d315fee4e21d67fe15e64594b/lib/dpl/provider/pages.rb#L171-L179

Some care would be necessary to pass correctly escaped string to do the job.

Interested as well in this feature! It would be awesome to have the possibility of specifying a custom message, when done manually I always used something similar as @Kristinita comment, which includes:

  • last commit SHA-1
  • TRAVIS_BUILD_NUMBER

It actually would be enough to allow committing from the before_deploy step, and then the deploy pipeline only has to push the changes. The current implementation though creates the folder in /tmp _after_ before_deploy.

I hope add this option:

commit_message: "[AUTO BUILD] `date +'%Y-%m-%d %T'`"    # support the commands

then commit message like:

[AUTO BUILD] 2018-04-07 22:29:06

I've opened an PR to add this feature: https://github.com/travis-ci/dpl/pull/824

I'm not well-versed in Ruby so this may not be optimal, but I'm willing to get better so shoot your suggestions if you have any 🙂

Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue in 24 hours. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please do feel free to either reopen this issue or open a new one. We'll gladly take a look again! You can read more here: https://blog.travis-ci.com/2018-03-09-closing-old-issues

The PR needs testing.

Possibly additionally, the default commit message should include [CI skip] to prevent circular builds.

Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please do feel free to either reopen this issue or open a new one. We'll gladly take a look again! You can read more here: https://blog.travis-ci.com/2018-03-09-closing-old-issues

Relevant PR #824 is still open.

@salmanulfarzy If you want to see this issue closed "properly", I suggest you test the PR and report the results.

Excuse me @BanzaiMan if this was added to noise. I'm not familiar with Ruby ecosystem. My earlier attempts to setup this was unsuccessful. I'll try to setup again and test this.

I wish it was possible. I always see "Updates" as commit message to all my commits on my username repo.

Update: To change commit message each time, now basically I edit my deploy script in package.json. Usage - gh-pages -m "your commit message"

I will close this issue here because I believe it is addressed in https://github.com/travis-ci/dpl/pull/1035. Feel free to re-open if needed.

This can be tested using:

deploy:
  provider: pages
  edge:
    branch: sf-port-824
â‹®
Was this page helpful?
0 / 5 - 0 ratings

Related issues

Sytten picture Sytten  Â·  4Comments

sandfox picture sandfox  Â·  8Comments

Rukeith picture Rukeith  Â·  8Comments

yashmehrotra picture yashmehrotra  Â·  7Comments

cotsog picture cotsog  Â·  8Comments