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

Deploy mkdocs when merging to master #106

Merged
merged 2 commits into from
Mar 19, 2018

Conversation

marcusholl
Copy link
Member

Only changes to master and PRs starts the travis job.
On PR Maven tests and mkdocs build for warnings and error check is done.
On change on master Maven is not run and the documentation is built
and deployed using a deploy key. The encrypted deploy key is not part of
this commit, it needs to be provided by an admin for this repository.

@marcusholl
Copy link
Member Author

@o-liver You triggered deployment of changes on master branch initially.

Some questions:

  • can you have a look into the rebased and adapted version here, please?
  • How can we avoid gh-pages updates for master branches in forks?
  • What is the story behind deploy-key.enc file. I cannot find the file in the sources.

.travis.yml Outdated
@@ -4,7 +4,16 @@ install:
- pip install --user mkdocs mkdocs-material
script:
- mvn test -B
- if [[ "${TRAVIS_PULL_REQUEST}" != "false" ]]; then cd documentation && mkdocs build --clean --verbose --strict && cd ..; fi;
- |
Copy link
Member

Choose a reason for hiding this comment

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

I presume this lets you spread the if then else over a few lines. Is that correct?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes

.travis.yml Outdated
else
if [ "${TRAVIS_BRANCH}" == "master" ]
then
gh-pages-deploy
Copy link
Member

Choose a reason for hiding this comment

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

Are you sure you don't have to make this file executable before?

Copy link
Member Author

Choose a reason for hiding this comment

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

I adjusted the file mode for gh-pages-deploy to 755. I gets checked out from git with the executable flag already set.

But I see now something else: should be ./gh-pages-deploy rather than simply gh-pages-deploy.

@o-liver
Copy link
Member

o-liver commented Feb 28, 2018

  • can you have a look into the rebased and adapted version here, please?
    Looks good.
  • How can we avoid gh-pages updates for master branches in forks?
    You could check the TRAVIS_REPO_SLUG environment variable.
    Or you could define an environment variable only available to the non-fork as described here
  • What is the story behind deploy-key.enc file. I cannot find the file in the sources.
    The procedure is to generate a key pair and add the public key to the repository on github while encrypting the private key with the travis cli and adding it to the sources.

@marcusholl marcusholl force-pushed the pr/deployMkDocs branch 4 times, most recently from d9f9eb1 to 0f81bb0 Compare March 2, 2018 13:22
@marcusholl
Copy link
Member Author

Travis build number 491 was fine, but did not report back.
This build actually did not trigger a deployment (since PR must not trigger a deployment). But there is also PR492, which was not a PR and for that the matching branch was updated accordingly (marcusholl/experimental) did in fact deploy.

Copy link
Contributor

@alxsap alxsap left a comment

Choose a reason for hiding this comment

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

looks good

marcusholl and others added 2 commits March 12, 2018 09:38
Only changes to master and PRs starts the travis job.
On PR Maven tests and mkdocs build for warnings and error check is done.
On change on master Maven is **not** run and the documentation is built
and deployed using a deploy key. The encrypted deploy key is not part of
this commit, it needs to be provided by an admin for this repository.
@marcusholl marcusholl merged commit 77a8f66 into SAP:master Mar 19, 2018
@marcusholl marcusholl deleted the pr/deployMkDocs branch March 19, 2018 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants