Skip to content
Snippets Groups Projects
Commit 0a957277 authored by Georges Racinet's avatar Georges Racinet
Browse files

RHGitaly: Makefile for dev setup and packaging

This freezes in particular the Mercurial sources revision,
expressed in the new `rust/mercurial.rev` file.

There is no longer need for the the `ci/prepare-rhgitaly` script
and its associated revision variable.

Run `make -C rust help` for more details.
parent c33ec057
No related branches found
No related tags found
2 merge requests!151heptapod#743: making 0.36 the new stable,!146RHGitaly source packaging and new pipeline rules
......@@ -8,8 +8,7 @@
BASE_IMAGES_TAG: $CI_COMMIT_HG_BRANCH
BASE_IMAGES_COLLECTION: registry.heptapod.net:443/heptapod/ci-images
BASE_IMAGES_MERCURIAL: $BASE_IMAGES_COLLECTION/mercurial
# good enough for now, will have to depend on branch at some point:
MERCURIAL_RUST_DEP_REVISION: default
MERCURIAL_SHARE_FROM: /opt/mercurial/hg
CARGO_HOME: ${CI_PROJECT_DIR}/cargo_home
......@@ -68,7 +67,7 @@
cache:
policy: pull-push
script:
- ci/prepare-rhgitaly
- make -C rust dev-dependencies
- cargo test --manifest-path rust/Cargo.toml
- rust/lint
artifacts:
......@@ -95,7 +94,7 @@
variables:
GITALY_INSTALL_DIR: /opt/gitlab/gitaly
script:
- ci/prepare-rhgitaly
- make -C rust dev-dependencies
# prebuilding RHGitaly to avoid doing it from tests
# (output is interesting and we avoid timeout issues)
- . /root/.cargo/env
......
#!/bin/sh
# Mercurial dependency. Thanks to the share from
# the base image, the pull should be small
MERCURIAL_RUST_DEP=rust/dependencies/mercurial
hg share --noupdate /opt/mercurial/hg ${MERCURIAL_RUST_DEP}
hg -R ${MERCURIAL_RUST_DEP} pull -r ${MERCURIAL_RUST_DEP_REVISION} \
https://foss.heptapod.net/mercurial/mercurial-devel
hg -R ${MERCURIAL_RUST_DEP} update -r ${MERCURIAL_RUST_DEP_REVISION}
all: help
MERCURIAL_SOURCE_REPO = dependencies/mercurial
MERCURIAL_SOURCE_REV := $(shell cat mercurial.rev)
MERCURIAL_SOURCE_REMOTE ?= https://foss.heptapod.net/mercurial/mercurial-devel
.PHONY: help
help:
@echo "Makefile for RHGitaly development setup and packaging"
@echo ""
@echo "Available commands: "
@echo " make dev-dependencies: prepare development dependencies"
@echo " (hg-core, various resources)"
@echo
@echo "Interesting variables: "
@echo " MERCURIAL_SHARE_FROM: if set, Mercurial sources repository"
@echo " will be created (if needed) with"
@echo " 'hg share' from this given path."
.PHONY: dev-dependencies
dev-dependencies: dependencies/mercurial/.hg
hg -R $(MERCURIAL_SOURCE_REPO) pull -r $(MERCURIAL_SOURCE_REV) $(MERCURIAL_SOURCE_REMOTE)
hg -R $(MERCURIAL_SOURCE_REPO) update --config commands.update.check=abort $(MERCURIAL_SOURCE_REV)
dependencies/mercurial/.hg:
ifdef MERCURIAL_SHARE_FROM
hg share --noupdate $(MERCURIAL_SHARE_FROM) $(MERCURIAL_SOURCE_REPO)
else
hg clone --noupdate $(MERCURIAL_SOURCE_REMOTE) $(MERCURIAL_SOURCE_REPO)
endif
59fda8516774ee9e47d2a88e5b6c9f42ab611b1c
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment