Skip to content

Commit

Permalink
Merge pull request #33 from xsf/feature/gitlab-pipeline
Browse files Browse the repository at this point in the history
Support experiments on GitLab.com
  • Loading branch information
horazont authored Jun 14, 2020
2 parents 747b0a4 + 4e7a3ff commit 9c25446
Show file tree
Hide file tree
Showing 18 changed files with 90 additions and 146 deletions.
75 changes: 2 additions & 73 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,73 +1,2 @@
# Python
# https://github.com/github/gitignore/blob/master/Python.gitignore

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Vim
# https://github.com/github/gitignore/blob/master/Global/Vim.gitignore

[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
*.un~
Session.vim
.netrwhist
*~

*.html
/Makefile
/registrar
50 changes: 50 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
stages:
- build
- pack

"build@main":
image: registry.gitlab.com/xsf/docker-images/registry-buildspace/image:0.1.0
stage: build
script:
- make
rules:
- if: '$CI_COMMIT_REF_NAME =~ /^main$/'
when: always
- when: never
artifacts:
paths:
- registrar/
expire_in: '1 day'

"pack@main":
image: docker:19.03.11
stage: pack
services:
- docker:19.03.11-dind
script:
- 'export IMAGE_REF="${CI_REGISTRY_IMAGE}/packed:main-$(date -Idate)-${CI_COMMIT_SHORT_SHA}"'
- 'export LATEST_REF="${CI_REGISTRY_IMAGE}/packed:main-latest"'
- 'docker build -t "$IMAGE_REF" -f pack-only.Dockerfile .'
- 'docker image tag "$IMAGE_REF" "$LATEST_REF"'
- 'docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY'
- 'docker push "$IMAGE_REF"'
- 'docker push "$LATEST_REF"'
rules:
- if: '$CI_COMMIT_REF_NAME =~ /^main$/'
when: on_success
- when: never

"build@mr":
image: registry.gitlab.com/xsf/docker-images/registry-buildspace/image:0.1.0
stage: build
script:
- make
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: always
- when: never
artifacts:
expose_as: "Content"
paths:
- registrar/
expire_in: '1 day'
7 changes: 2 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ addons:
packages:
- xsltproc
- libxml2-utils
before_install:
- wget -O git-ratchet https://github.com/iangrunert/git-ratchet/releases/download/v0.3.1/linux_amd64_git-ratchet
- chmod +x git-ratchet
- git fetch https://github.com/xsf/registrar.git refs/notes/*:refs/notes/*
script:
- echo "lint,$(xmllint --nonet --noout --noent --loaddtd --valid *.xml 2>&1 | wc -l)" | ./git-ratchet check -v
- make validate
- make build
27 changes: 27 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
xsltproc ?= xsltproc
xmllint ?= xmllint
OUTDIR ?= registrar
srcs = $(wildcard *.xml)
html = $(patsubst %.xml,$(OUTDIR)/%.html,$(srcs))
xml = $(patsubst %.xml,$(OUTDIR)/%.xml,$(srcs))

all: validate build

build: $(html) $(xml)

validate:
$(foreach srcfile,$(srcs),$(xmllint) --nonet --noout --noent --loaddtd --valid "$(srcfile)" > /dev/null && ) true

$(OUTDIR):
mkdir -p "$@"

$(html): $(OUTDIR)/%.html: %.xml %.xsl | $(OUTDIR)
$(xsltproc) --stringparam OUTPUT_FILENAME "$@" "$(patsubst %.xml,%.xsl,$<)" "$<" > "$@"

$(xml): $(OUTDIR)/%.xml: %.xml %-xml.xsl | $(OUTDIR)
$(xsltproc) "$(patsubst %.xml,%-xml.xsl,$<)" "$<" > "$@"

clean:
rm -rf "$(OUTDIR)"

.PHONY: all clean validate
65 changes: 0 additions & 65 deletions all.sh

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 4 additions & 2 deletions formtypes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,8 @@
</option>
</field>
<field var='pubsub#subscription_type'
type='list-single'>
type='list-single'
label=''>
<option label='Receive notification of new items only'>
<value>items</value>
</option>
Expand All @@ -402,7 +403,8 @@
</option>
</field>
<field var='pubsub#subscription_depth'
type='list-single'>
type='list-single'
label=''>
<option label='Receive notification from direct child nodes only'>
<value>1</value>
</option>
Expand Down
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions pack-only.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM nginx:1-alpine
COPY registrar/ /usr/share/nginx/html/registar/
RUN sed -ri '/root\s+\/usr\/share\/nginx\/html/s/^(.+)$/\1\nautoindex on;/' /etc/nginx/conf.d/default.conf

EXPOSE 80
File renamed without changes.
1 change: 0 additions & 1 deletion stream-features.xml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,5 @@
<element>c</element>
<desc>Indicate support for Entity Capabilities 2.0 and publish capabilities to peer.</desc>
<doc>&xep0390;</doc>
<status>provisional</status>
</feature>
</registry>
File renamed without changes.

0 comments on commit 9c25446

Please sign in to comment.