News for hackers. Stuff that matters.
Re:GitLab Master Plan by HorizonXP on Tuesday September 13, 2016 @10:42AM (#12488658)
We are currently on Github and are using CoreOS' Quay.io private Docker registry with Github hooks for automated build creation. Total cost: $50/month for Github for private repos, and $100/month for CoreOS' managed service that includes Quay.io.

Years ago, I did set up our own private Docker registry and build server, but it was a lot of work to setup and maintain, so I killed it. Hopefully and probably, that's become easier to do today.

However, last night, I decided that I had had enough with our current setup (it's slow, expensive, and cumbersome), and moved to GitLab. Here were the steps:

1. Create an account.

2. Create a repository, and select the option to import from Github.

3. Connect my Github account, and import all of our private repositories.

4. Ensure Container Registry was enabled for the repositories.

5. Create a .gitlab-ci.yaml file in each repository to build our Docker images. (https://docs.gitlab.com/ce/ci/docker/using_docker_build.html)

6. Decide that I didn't want to use the Shared Runners.

7. Spin up an EC2 Ubuntu instance, install GitLab's multi-runner. (https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/blob/ma...)

8. Add the new runner to each repo.

9. Start a build to ensure Docker image gets built.

In less than 10 steps, I was able to migrate all of our code and CI to GitLab, in less than 2 hours. With the repository mirroring, Github can remain synced to GitLab, so that I have time to modify our deployment scripts to use the GitLab URLs instead. I'll be cancelling our GitHub and CoreOS subscriptions this week.

As our team grows, we will likely host GitLab on our own servers, and I expect that will go smoothly. I'll be happy to pay them at that time. Right now, I'm really happy with this migration.

Re:GitLab Master Plan by daveguy on Tuesday September 13, 2016 @10:50AM (#12488738)
I would love to hear how this is running for you after a month -- when some of the edge cases have been poked. It would be good to know if you run into problems or if it is still going as smoothly as the initial setup.

I switched over to GitLab for a static blog when I realized I could use the free shared runners to compile any static site generator out there. Such a beautiful feature. I would be interested to hear how it holds up in a production environment.

Re:GitLab Master Plan by StavrosK on Tuesday September 13, 2016 @11:40AM (#12489243)
We've been using it in production for months, and it's as great as it was the first day. I've also made a static blog with the Gitlab runner, and my experience has been similarly positive.
Re:GitLab Master Plan by komali2 on Tuesday September 13, 2016 @01:09PM (#12490235)
Do either of you mind linking to your static blogs or an article discussing your process here? I've only ever used a wordpress install for blogging but have been thinking about just building a static blog from scratch.
Re:GitLab Master Plan by qwertyuiop924 on Tuesday September 13, 2016 @02:16PM (#12490871)
Building a static blog from scratch is just writing HTML files for your posts, and then linking them them to a list of pages, placing it at the top. The classic example of this is JWZ's "gruntle," or jwzrants, which actually predates the term blog. You can find it at https://www.jwz.org/gruntle/.

However, most of us prefer to generate such things from templates and markup files. The most popular system for doing this, by far, is Jekyll (https://jekyllrb.com/), probably because Github recommends it. Metalsmith (http://www.metalsmith.io/) and Wintersmith (http://wintersmith.io/), while not as popular, are certainly options if you're a JS fan, and don't mind cutting code to write your configurations, and have some very nice features for customization. However, if you're coming from Wordpress, I'd reccomend Lektor (https://www.getlektor.com/). It's Python based, well documented, and uses a simple file tree to build the website like all other options discussed. However, it also provides a simple admin panel, which can be used to write your posts, manage your posts, and publish the generated site to your server.

As for distributing a static site, you just have to stick it onto some kind of hosting. S3, Apache, Github pages, whatever. Once again, Lektor can do this via the admin panel. For the rest of the generators, you're on your own: you'll have to write the scripts yourself, but this is fairly trivial.

Re:GitLab Master Plan by connorshea on Tuesday September 13, 2016 @09:00PM (#12493538)
Here's mine: https://connorshea.gitlab.io, repo here: https://gitlab.com/connorshea/connorshea.gitlab.io

Danger recently moved their site over (https://gitlab.com/danger-systems/danger.systems, https://danger.systems/) if you want another example.

We have a bunch of working example sites in a bunch of different static site generators at the "pages" group: https://gitlab.com/groups/pages

Jekyll, Middleman, Pelican, Metalsmith, Octopress, Nanoc, etc. etc. All working examples. We also have gitlab-ci.yml templates if you create the YML file via the web editor, so for many of these you can get a simple site deploying pretty quick.

And if you want a bit more guidance we have a series of blog posts on static sites & GitLab Pages: https://about.gitlab.com/2016/06/03/ssg-overview-gitlab-page...

Personally I'd recommend Jekyll, but it really depends on what languages you're comfortable in :)

(Shout-out to Marcia, Axil, Kamilt, and others for helping build out Pages and these examples over the last while, really awesome resources!)

Re:GitLab Master Plan by darekkay on Wednesday September 14, 2016 @05:34AM (#12495251)
Re:GitLab Master Plan by sytse on Tuesday September 13, 2016 @09:32PM (#12493656)
Thanks for commenting Connor!
Re:GitLab Master Plan by mrswag on Wednesday September 14, 2016 @08:34AM (#12496175)
I use a simple bash script[1] to paste together html headers and markdown files processed by python-markdown.

The resulting .html is pushed with the source to the github repo. This setup, while not very sexy, doesn't even need a CI.

[1] http://toastedcornflakes.github.io/generate.sh

Re:GitLab Master Plan by StavrosK on Tuesday September 13, 2016 @09:07PM (#12493570)
Mine is just a half-finished Lektor site here:

http://portfolio.stavros.io

Not much to see, but it was pretty straightforward to make, you just write the templates.

Re:GitLab Master Plan by kej on Tuesday September 13, 2016 @01:28PM (#12490418)
Not exactly what you asked, but you might want to see StaticGen[1], a big list of resources for static site generation.

[1] http://www.staticgen.com

Re:GitLab Master Plan by sytse on Tuesday September 13, 2016 @10:46AM (#12488700)
Great to hear you had such a good experience and that the integrated container registry was so easy to use.
Re:GitLab Master Plan by cedricziel on Tuesday September 13, 2016 @11:11AM (#12488949)
That's exactly my experience. I used the docker omnibus containers to get quickly up and running. Running, supervising and updating is a pleasure in combination with docker-compose.

As for CI, I utilized the docker-machine runner so we could autoscale based on demand.

Big plus: With Google Cloud Platform, we can leverage preemptible VMs for the runners (not for the coordinator of course), so the cost is really low.

Re:GitLab Master Plan by sytse on Tuesday September 13, 2016 @11:15AM (#12488981)
Awesome, if you're using Google Cloud you'll be happy to hear that we just merged Kubernetes support for Runner creation https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/merge_r... Giving you the option to use Google Container engine to spin up new Runners.
Re:GitLab Master Plan by swozey on Tuesday September 13, 2016 @03:36PM (#12491497)
This is fantastic. Right now I use GCE autoscaling groups to spin up runners while I've got several kubernetes clusters running 24/7. It'll be nice to utilize those for builds (especially with how fast the scheduler is) going forward. Saves money, as well.
Re:GitLab Master Plan by sytse on Tuesday September 13, 2016 @08:52PM (#12493495)
Awesome, glad to hear you can make use of this.
Re:GitLab Master Plan by HorizonXP on Tuesday September 13, 2016 @12:14PM (#12489631)
This is awesome! Our whole stack runs on Kubernetes, so this kind of integration is very welcome!
Re:GitLab Master Plan by sytse on Tuesday September 13, 2016 @08:44PM (#12493462)
Glad to hear that. And many thanks to James Munnelly for being patients with me and the rest of our team over the period of a year to get this done.
Re:GitLab Master Plan by hackerboos on Tuesday September 13, 2016 @11:27AM (#12489093)
I've pretty much done all the steps you've listed. My problem now is how to get those build docker images onto servers somewhere.

What services are people using for that?

Re:GitLab Master Plan by sytse on Tuesday September 13, 2016 @11:57AM (#12489449)
You can also deploy from GitLab, see https://about.gitlab.com/2016/08/26/ci-deployment-and-enviro... for an introduction.
Re:GitLab Master Plan by jadbox on Tuesday September 13, 2016 @11:40AM (#12489245)
I'm working on an open source project that does just that: deploy container updates. It's not available just yet, but you can follow me for when I announce it. https://twitter.com/jadbox
Re:GitLab Master Plan by swozey on Tuesday September 13, 2016 @03:33PM (#12491465)
Gitlab-ci can do this easily with the gitlab-ci-multirunner docker image. My CI/CD spins up multirunners in autoscaling groups and those said multirunners (it's basically a docker container with privilege mode to spin up the Dockerfiles of whatever you're building) handle the builds, whether they're node or ruby or anything else I've made into docker images.
Re:GitLab Master Plan by kt9 on Tuesday September 13, 2016 @02:24PM (#12490939)
Check out Distelli - https://www.distelli.com

Disclaimer: I'm the founder

Re:GitLab Master Plan by StavrosK on Tuesday September 13, 2016 @11:39AM (#12489238)
I haven't tried it, but I think you just do "docker pull <your gitlab repo index url>".