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

Automatic continous deployment of develop branch to a (new) update site #123

Closed
vorburger opened this issue Sep 10, 2018 · 10 comments
Closed

Comments

@vorburger
Copy link
Member

vorburger commented Sep 10, 2018

In order to "keep the lights on" for this project (see #124), one thing we should sort out is to get a p2 site to which we automatically continously deploy to. The last thing I have time for, for this project, is to do any sort of manual work for testing, or play Git Flow and merge a develop to master branch, to "cut releases" with "releases notes" and what not.

The simplest thing that works is to just have automatic continous deployment deployment of the develop branch to a update site. If someone merges a commit that break things or even installation - then that's just too bad, someone better revert that fast, or commit a fix.

I'm doing this for another Eclipse plugin at LastNPE.org via this Travis YAML; perhaps I can set up the same for this project here.

If I remember correctly, I couldn't get that to work for a gh-pages branch, like this project currently uses... so for both this and "historical" reasons, IMHO it's best to start with a new URL for a new p2 repo, instead of the existing p2 site on http://m2e-code-quality.github.io/m2e-code-quality/site (as per http://m2e-code-quality.github.io/m2e-code-quality/). This will have the added advantage that we will not break anyone pulling from that old site and relying on FindBugs support - because that will break and it will be SpotBugs only here going forward, with #113 ...

@vorburger
Copy link
Member Author

see doc/release.md ...

@vorburger
Copy link
Member Author

@vorburger vorburger changed the title Automatic continous deployment deployment of develop branch to a (new) update site Automatic continous deployment of develop branch to a (new) update site Sep 14, 2018
vorburger added a commit to vorburger/m2e-code-quality that referenced this issue Sep 14, 2018
@vorburger
Copy link
Member Author

I'm doing this for another Eclipse plugin at LastNPE.org via this Travis YAML

#131 should be the equivalent for here...

BUT I forgot 😸 how the hell that github_token: $GITHUB_TOKEN business works, I cannot find anymore how/where to "Set in travis-ci.org dashboard" (inline comment). Will have to read up on that - some other day.

Also, importantly, the Travis build must now do install instead of just test, because com.basistech.m2e.code.quality.site doesn't build (its target/site/ is empty) if you only run up to test - so #131 changes that. This won't just affect the deploy, but Travis builds to verify all future PRs as well, but that doesn't matter.

@vorburger
Copy link
Member Author

how the hell that github_token: $GITHUB_TOKEN business works

but.. doing this would require a personal access token with write privilege to ALL OF MY repos. On Travis' Settings UI it's read only (stars), not visible, but somehow.. I'm still not entirely comfortable with this. E.g. if Travis' UI ever had a bug, other committers to to this project may be able to get that token.

https://developer.github.com/v3/guides/managing-deploy-keys/#machine-users which explicitly suggests creating a dedicated new GitHub user account for such purposes, and that seems like a better solution; I'll do that instead.

@vorburger
Copy link
Member Author

vorburger commented Sep 18, 2018

creating a dedicated new GitHub user account for such purposes

https://github.com/m2e-code-quality-bot (michael.vorburger+m2e-code-quality-bot on Gmail)

I'm happy to share the password of this new m2e-code-quality-bot GitHub user account with any other active commiters on this project, please just contact me by email and I'll oblige.

This user also just became a Member (but not co-Owner) of the organization, and was made a Collaborator on the m2e-code-quality-p2-site repo (only).

She has a New personal access token of Scope repo (only), which I've just added as Environment Variable "GITHUB_TOKEN" to Travis settings for m2e-code-quality.

I've just merged #131 as 143f0a4 - let's see if this works...

vorburger added a commit to vorburger/m2e-code-quality that referenced this issue Sep 18, 2018
vorburger added a commit to vorburger/m2e-code-quality that referenced this issue Sep 18, 2018
because it interferes with Continous Deployment (I don't know
how to get Travis' pages deploy to only kick in for one of the
matrix builds; see details in issue m2e-code-quality#123).
vorburger added a commit that referenced this issue Sep 18, 2018
because it interferes with Continous Deployment (I don't know
how to get Travis' pages deploy to only kick in for one of the
matrix builds; see details in issue #123).
@vorburger
Copy link
Member Author

let's see if this works...

just 2 problems:

  1. Git Hub pages only works for a branch named master or gh-pages, not develop (this is about branches in m2e-code-quality-p2-site, not m2e-code-quality). As master could be confusing (because m2e-code-quality-p2-site contains what was built from m2e-code-quality's develop and not master branch), d69e100 switches that, and GitHub pages is now enabled from the gh-pages branch in the m2e-code-quality-p2-site repo.

  2. That matrix build (for mars, neon & oxyen target platforms...) now deploys x3 to m2e-code-quality-p2-site, in arbitrary order. That is not great, as not predictable. I'm not sure how to make Travis do that deploy only for one of the matrix builds... anyone got a clue? In the mean time, to simplify, I've removed the matrix build - let's just build this on a single TP, see fb625eb.

@vorburger
Copy link
Member Author

Hm... the Settings have now been showing "Your GitHub Pages site is currently being built from the gh-pages branch." for over 1/2h ... AFAIK it' usually much faster. On http://m2e-code-quality.github.io/m2e-code-quality-p2-site/site.xml for https://github.com/m2e-code-quality-p2-site/ we still get a 404... (The 404 on / without site.xml would be normal, just because there is no index.html, and GitHub pages doesn't do directory listing; it will work in Eclipse.) I'll contact support@github.com to see if they can help.

BTW: Does anyone reading this remember more about p2 stuff than I do right now and knows why https://github.com/m2e-code-quality/m2e-code-quality-p2-site has site.xml & Co. but e.g. https://github.com/lastnpe/eclipse-external-annotations-m2e-plugin-p2-site has p2.index and content.xml.xz & Co. ? Do we need to bump the Tycho versions, or something like that? PRs more than welcome...

@vorburger
Copy link
Member Author

GitHub Pages just seems to have been REALLY slow, but meanwhile our CD p2 site seems to be up on https://m2e-code-quality.github.io/m2e-code-quality-p2-site/... would anyone like to test it and confirm that it works, for manual installation from Eclipse, and re-open this issue if it's NOK?

@vorburger
Copy link
Member Author

for over 1/2h ... AFAIK it' usually much faster
I'll contact support@github.com to see if they can help
seems to have been REALLY slow, but meanwhile

FTR: GitHub Support manually triggered the first build, because, quote from support ticket:

It looks you had your bot user perform the initial push to the repository. As a security feature, we require that a GitHub Pages repository be initialized by a user that is the owner or an admin. Any future pushes to the repository will automatically trigger a rebuild.

@pgalbraith
Copy link
Member

pgalbraith commented Sep 19, 2018

I can't say I've tested anything other than installing, but at least can confirm things install without error going back as far as 4.3 (kepler). For kepler/luna/mars spotbugs does not install, presumably due to a newer dependency, but eclipse recognizes this and handles it gracefully.

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

No branches or pull requests

2 participants