From 80e889b8f07bd21ff5dd24ee60e8b4c24096adbf Mon Sep 17 00:00:00 2001 From: Evan Read Date: Mon, 17 Sep 2018 08:50:10 +1000 Subject: [PATCH] Add GitLab docs linting image to project, based on existing docs image for linting --- .gitlab-ci.yml | 2 ++ Dockerfile.gitlab-docs-lint | 17 +++++++++++++++++ README.md | 32 +++++++++++++++++--------------- 3 files changed, 36 insertions(+), 15 deletions(-) create mode 100644 Dockerfile.gitlab-docs-lint diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index dac9a69..a8bdc40 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -118,6 +118,7 @@ omnibus-gitlab-xenial test: *test_build release-tools test: *test_build sitespeed-gitlab test: *test_build www-gitlab-com-2.4 test: *test_build +gitlab-docs-lint test: *test_build # Builds @@ -191,6 +192,7 @@ omnibus-gitlab-xenial: *build_and_deploy release-tools: *build_and_deploy sitespeed-gitlab: *build_and_deploy www-gitlab-com-2.4: *build_and_deploy +gitlab-docs-lint: *build_and_deploy cache-google-chrome: stage: automation diff --git a/Dockerfile.gitlab-docs-lint b/Dockerfile.gitlab-docs-lint new file mode 100644 index 0000000..67ceeeb --- /dev/null +++ b/Dockerfile.gitlab-docs-lint @@ -0,0 +1,17 @@ +FROM ruby:2.5-alpine +MAINTAINER GitLab Documentation Team + +WORKDIR /tmp + +RUN apk update && apk upgrade && apk add --no-cache \ + build-base \ + bash \ + grep + +RUN wget https://gitlab.com/gitlab-com/gitlab-docs/-/archive/master/gitlab-docs-master.tar.bz2 \ + && tar xvjf gitlab-docs-master.tar.bz2 \ + && mv gitlab-docs-master gitlab-docs \ + && rm gitlab-docs-master.tar.bz2 + +RUN cd gitlab-docs \ + && bundle install --jobs 4 diff --git a/README.md b/README.md index b24d3c5..3b39012 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +# GitLab Build Images + This repository is used to build docker images that are used to build and test various parts of GitLab: @@ -5,25 +7,25 @@ various parts of GitLab: 1. Test GitLab-CE/EE project 1. Build gitlab-org/www-gitlab-com project -# Adding a new image +## Adding a new image There are two methods to adding a new image: -1. Use a docker buildfile -2. Use a custom image with versioned features -## Use a docker buildfile +1. Use a docker buildfile. +1. Use a custom image with versioned features. + +### Use a docker buildfile A bespoke image is one that uses it's own Dockerfile. In the interests of avoiding repetition, it's better to use the custom docker build if possible. -Assuming the image you want to add is called `new-image`.... +Assuming the image you want to add is called `new-image`: -1. Add a test task: `new-image test: *test_build` -1. Add a new build task: `new-image: *build_and_deploy` -1. Add a Dockerfile: `Dockerfile.new-image` +1. Add a test task: `new-image test: *test_build`. +1. Add a new build task: `new-image: *build_and_deploy`. +1. Add a Dockerfile: `Dockerfile.new-image`. - -## Use a custom image with versioned features +### Use a custom image with versioned features To add a new image to the build, edit [`.gitlab-ci.yml`](https://gitlab.com/gitlab-org/gitlab-build-images/blob/master/.gitlab-ci.yml). @@ -56,7 +58,7 @@ options are: 1. `ansible` 1. `graphicsmagick` -### Adding a new build +#### Adding a new build As an example, if you want to add new image for Ruby 2.4 with `git` 2.14 and `golang` 1.9, the name would be `ruby-2.4-golang-1.9-git-2.14`. @@ -64,15 +66,15 @@ the name would be `ruby-2.4-golang-1.9-git-2.14`. 1. Add a test task: `ruby-2.4-golang-1.9-git-2.14 test: *test_custom` 1. Add a new build task: `ruby-2.4-golang-1.9-git-2.14: *build_and_deploy_custom` -# Note regarding Google Chrome +## Note regarding Google Chrome Google has a policy of yanking older versions of Google Chrome from their PPA -whenever a new major version is released. To help maintain consistant build +whenever a new major version is released. To help maintain consistent build images, there is a CI step that saves the latest Google Chrome .deb into an S3 -bucket. The install for Chrome will attempt to retrieve from the bucket if it +bucket. The install for Chrome will attempt to retrieve from the bucket if it cannot find the file in the apt repository. See `scripts/cache-google-chrome` for more details. -# Contributing +## Contributing See [Contributing](CONTRIBUTING.md)