Commit c6edf72f authored by Stefan Lankes's avatar Stefan Lankes
Browse files

add initial support of GitLab CI/CD pipelines

parent 79b99bd8
Pipeline #383606 failed with stages
in 10 minutes and 41 seconds
stages:
- prepare
- build
- test
variables:
DOCKER_FILE: Dockerfile
DOCKER_TAG: latest
DOCKER_IMAGE: ${CI_REGISTRY_IMAGE}
GIT_SUBMODULE_STRATEGY: normal
.prepare:docker: &prepare_docker
stage: prepare
image:
name: quay.io/buildah/stable
variables:
_BUILDAH_STARTED_IN_USERNS: ""
BUILDAH_ISOLATION: chroot
BUILDAH_LAYERS: "true"
before_script:
- buildah version
- buildah login --username "${CI_REGISTRY_USER}" --password "${CI_REGISTRY_PASSWORD}" "${CI_REGISTRY}"
script:
- buildah bud -f ${DOCKER_FILE} -t ${DOCKER_IMAGE}:${DOCKER_TAG} .
- buildah push ${DOCKER_IMAGE}:${DOCKER_TAG} docker://${DOCKER_IMAGE}:${DOCKER_TAG}
after_script:
- buildah logout "${CI_REGISTRY}"
tags:
- builder
prepare:docker:
<<: *prepare_docker
build:uhyve:
stage: build
image: ${CI_REGISTRY_IMAGE}
script:
- cargo build
- cargo build --release
artifacts:
paths:
- target/debug/uhyve
- target/release/uhyve
test:demo:
stage: test
dependencies:
- build:uhyve
image: ${CI_REGISTRY_IMAGE}
script:
- lscpu
- kvm-ok
- cargo test -- --nocapture
- cd $CI_BUILDS_DIR
- git clone --recurse-submodules https://github.com/hermitcore/rusty-hermit.git
- cd -
- cd $CI_BUILDS_DIR/rusty-hermit
- cargo build -p rusty_demo
- RUSTFLAGS="-Clinker-plugin-lto" cargo build -p rusty_demo --release
- cd -
- target/debug/uhyve -v -c 1 $CI_BUILDS_DIR/rusty-hermittarget/x86_64-unknown-hermit/debug/rusty_demo
- target/debug/uhyve -v -c 2 $CI_BUILDS_DIR/rusty-hermit/target/x86_64-unknown-hermit/debug/rusty_demo
- target/release/uhyve -v -c 1 $CI_BUILDS_DIR/rusty-hermit/target/x86_64-unknown-hermit/release/rusty_demo
- target/release/uhyve -v -c 2 $CI_BUILDS_DIR/rusty-hermit/target/x86_64-unknown-hermit/release/rusty_demo
tags:
- privileged
FROM ubuntu:latest
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get -y install cpu-checker util-linux apt-transport-https curl wget binutils build-essential gcc libtool bsdmainutils pkg-config libssl-dev git qemu-kvm qemu-system-x86 nasm seabios qemu-utils fdisk grub-pc grub-pc-bin grub-imageboot grub-legacy-ec2 multiboot kpartx gzip && \
apt-get clean
# Install Rust toolchain
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly --profile minimal
RUN /root/.cargo/bin/cargo install cargo-download
RUN /root/.cargo/bin/cargo install uhyve
ENV PATH="/root/.cargo/bin:/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/:${PATH}"
ENV EDITOR=vim
# Switch back to dialog for any ad-hoc use of apt-get
ENV DEBIAN_FRONTEND=dialog
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment