Skip to content

Commit

Permalink
Merge branch 'fedora-33' into 'master'
Browse files Browse the repository at this point in the history
Migrate to Fedora 33

Closes #2

See merge request ModioAB/housekeeper!33
  • Loading branch information
notCalle committed Nov 26, 2020
2 parents 9dc2c93 + 2bf0686 commit eae33f5
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 29 deletions.
86 changes: 61 additions & 25 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,66 @@
%YAML 1.1
---
# Keep the includes first to illustrate that definitions that everything that
# follows override included definitions.
include:
# Only run for branches and tags
# https://docs.gitlab.com/ee/ci/yaml/#workflowrules-templates
- template: 'Workflows/MergeRequest-Pipelines.gitlab-ci.yml'
# See https://gitlab.com/gitlab-org/gitlab/tree/master/lib/gitlab/ci/templates
# - file: /templates/container-build.yaml
# project: ModioAB/base-image
# ref: master


default:
# Allow running pipelines to be cancelled if made redundant
interruptible: true
image: registry.gitlab.com/modioab/base-image/fedora-${FEDORA_ROOT_RELEASE}/build:master

# FIXME: The following defaults should be a template

# Retry jobs when parts of the CI system itself fails
# https://docs.gitlab.com/ee/ci/yaml/#retry
retry:
max: 2
when:
- api_failure
- runner_system_failure
- scheduler_failure
tags:
- x86_64

variables:
# Podman defaults to OCI images, since 2019-02-15+ onwards, gitlab registry
# fails to work properly with the default `oci` images.
# TODO: Test & bug-report this
BUILDAH_FORMAT: docker
FEDORA_ROOT_RELEASE: 33

stages:
- test
- publish
- test
- publish

test:
image: registry.gitlab.com/modioab/base-image/fedora-31/build:master
stage: test
when: always
script:
- pip3 install -r requirements-dev.txt
- pip3 install .
- pytest .
- mypy .
- flake8 .
coverage: '/^TOTAL.+?(\d+\%)$/'
artifacts:
reports:
junit:
- testreport.xml
- mypyreport.xml
stage: test
when: always
script:
- pip3 install -r requirements-dev.txt
- pip3 install .
- pytest .
- mypy .
- flake8 .
coverage: '/^TOTAL.+?(\d+\%)$/'
artifacts:
reports:
junit:
- testreport.xml
- mypyreport.xml

container:
image: registry.gitlab.com/modioab/base-image/fedora-31/build:master
stage: publish
tags:
- x86_64
script:
- make -f build.mk login
- pip3 install wheel
- make build-publish
stage: publish
script:
- make -f build.mk login
- pip3 install wheel
- make build-publish
...
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Submit image
FROM registry.gitlab.com/modioab/base-image/fedora-31/python:master
ARG IMAGE_BUILD_FROM
FROM $IMAGE_BUILD_FROM
MAINTAINER "D.S. Ljungmark" <ljungmark@modio.se>

ARG URL=unknown
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### Configuration

IMAGE_BUILD_FROM = registry.gitlab.com/modioab/base-image/fedora-$(FEDORA_ROOT_RELEASE)/python:master
IMAGE_REPO = registry.gitlab.com/modioab/housekeeper
IMAGE_ARCHIVE = image.tar

Expand Down
14 changes: 13 additions & 1 deletion build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,14 @@ IMAGE_TAG = $(_image_repo):$(_image_tag_prefix)$(IMAGE_TAG_SUFFIX)

_podman = podman


ifdef IMAGE_BUILD_FROM
_image_build_from_arg = --build-arg=IMAGE_BUILD_FROM="$(IMAGE_BUILD_FROM)"
else
_image_build_from_arg =
endif


ifdef IMAGE_BUILD_VOLUME
_build_volume = --volume $(IMAGE_BUILD_VOLUME):/build:ro,z
else
Expand Down Expand Up @@ -450,6 +458,7 @@ define _cmd_image_podman_build =
--build-arg=URL="$(CI_PROJECT_URL)" \
--build-arg=DATE="$(_date)" \
--build-arg=HOST="$(_host)" \
$(_image_build_from_arg) \
--tag=$(IMAGE_LOCAL_TAG) \
.
endef
Expand All @@ -462,6 +471,7 @@ define _cmd_image_docker_build =
--build-arg=URL="$(CI_PROJECT_URL)" \
--build-arg=DATE="$(_date)" \
--build-arg=HOST="$(_host)" \
$(_image_build_from_arg) \
--tag=$(IMAGE_LOCAL_TAG) \
.
endef
Expand Down Expand Up @@ -713,7 +723,9 @@ ifneq ($(FEDORA_ROOT_ARCHIVE),)

CLEANUP_FILES += $(FEDORA_ROOT_ARCHIVE)

FEDORA_ROOT_RELEASE ?= 31
ifeq ($(FEDORA_ROOT_RELEASE),)
$(error You must set FEDORA_ROOT_RELEASE to build a Fedora root file system)
endif

define _cmd_fedora_root =
$(Q)set -u && \
Expand Down

0 comments on commit eae33f5

Please sign in to comment.