Git hosting for co-operators : GitLab at git.coop

Thank to testing by @decentral1se we are please to announce that GitLab CI is now available on the Co-operative GitLab server at git.coop using Docker and it is set to use debian:latest.

I’m now looking at setting up GitLab Container Registry.

See this Loomio thread for the background story of this service.

2 Likes

Thanks @chris! Great to see this happening. I believe git.coop is now more compelling than ever.

2 Likes

Thanks @decentral1se, I have started having a play with it and have got Ansible printing “Hello world!”, next job is to get it doing something more useful. :slight_smile:

Sounds great, Chris. Good work!

Over the last week @kate and I have setup a system for managing bind zonefiles at git.coop and I’m rather pleased with this, it means that not very technical people have a web based interface to edit their domain name zone files and more technical people have the option to integrate domain name management into other processes.

When a edit is submitted we use GitLab CI to spin up a Debian Docker container to test the zone files in:

before_script:
  - apt update
  - apt install -y bind9utils dnsutils wget
  - wget https://git.coop/webarch/scripts/raw/master/bin/named-checkserial
test:
  script:
    - for zone in *.hosts; do named-checkzone localhost $zone; done
    - for zone in *.hosts; do named-checkzone $(echo $zone | sed 's/\.hosts$//') $zone; done
    - for zone in *.hosts; do bash ./named-checkserial $zone; done

This takes less than a minute to run and ends with an output like this:

$ for zone in *.hosts; do named-checkzone localhost $zone; done
zone localhost/IN: loaded serial 2018041601
OK
$ for zone in *.hosts; do named-checkzone $(echo $zone | sed 's/\.hosts$//') $zone; done
zone example.org.uk/IN: loaded serial 2018041601
OK
$ for zone in *.hosts; do bash ./named-checkserial $zone; done
Serial number for example.org.uk in example.org.uk.hosts has been increased compared to the live version.
Job succeeded

Then our four (two in Sheffield, one in Iceland and one in Luxembourg) DNS servers update with the changes.

We are currently offering this service for a one-off setup of £60.

1 Like

We have enabled the GitLab Docker Registry at registry.git.coop and this means that you can now use GitLab CI at git.coop to build and host Docker containers :slight_smile:.

So far we have only built a couple of containers to test everything, one to be used by the Bind 9 zonefile repos CI (having packages pre-installed in the containers used for testing results in the syntax tests taking 15 seconds rather than one minute and 15 seconds) and another with a recent version of Ansible for use by repos that are doing deployment using Ansible from Docker containers.

The GitLab CI posted above for checking Bind 9 hosts files has now been improved to only check changed files (to speed it up for repos with a lot of zone files):

image: registry.git.coop/webarch/containers/images/dns:0.1

stages:
  - test

before_script:
  - wget -q https://git.coop/webarch/scripts/raw/master/bin/named-checkserial

test:
  script:
    - export HOSTS_CHANGED=$(git show --name-only --format=oneline | tail -n+2 | grep '\.hosts$')
    - if [[ -z ${HOSTS_CHANGED} ]]; then echo 'No hosts files changed in last git commit'; fi
    - if [[ -n ${HOSTS_CHANGED} ]]; then for zone in ${HOSTS_CHANGED}; do bash ./named-checkserial $zone; done; fi
    - if [[ -n ${HOSTS_CHANGED} ]]; then for zone in ${HOSTS_CHANGED}; do named-checkzone -i full -k fail -m fail -M fail -n fail -S fail localhost $zone; done ; fi
    - if [[ -n ${HOSTS_CHANGED} ]]; then for zone in ${HOSTS_CHANGED}; do named-checkzone -i full -k fail -m fail -M fail -n fail -S fail $(echo $zone | sed 's/\.hosts$//') $zone; done ; fi
1 Like

I know that some people and co-ops are not prepared to fill in a form and pay £1 to join Webarchitects to get access to git.coop and I agree that it would be nice if it was free and open to all for no cost but after visiting gitlab.freedesktop.org today, where currently there are two noticed pinned to the top of every page:

I’m very glad that the hurdle we have to account creation means we haven’t had any issues of this nature.

1 Like