Make images in gitlab ci

This commit is contained in:
Jeremy Soller 2018-06-10 09:54:05 -06:00
parent 2f7ff3d625
commit e7375348e0
4 changed files with 40 additions and 38 deletions

View file

@ -1,21 +1,14 @@
variables: variables:
GIT_STRATEGY: "none" GIT_STRATEGY: "pull"
GIT_SUBMODULE_STRATEGY: "none" GIT_SUBMODULE_STRATEGY: "recursive"
GIT_CHECKOUT: "false" GIT_CHECKOUT: "true"
before_script: before_script:
- | - |
apt-get update -qq && apt-get update -qq &&
apt-get install -qq \ apt-get install -qq \
autopoint \
autoconf \
automake \
bison \
build-essential \ build-essential \
clang \
cmake \
curl \ curl \
flex \
fuse \ fuse \
genisoimage \ genisoimage \
git \ git \
@ -24,19 +17,13 @@ before_script:
nasm \ nasm \
pkg-config \ pkg-config \
software-properties-common \ software-properties-common \
syslinux \ syslinux &&
texinfo \
wget &&
apt-key adv -q --batch --yes --keyserver keyserver.ubuntu.com --recv-keys AA12E97F0881517F && apt-key adv -q --batch --yes --keyserver keyserver.ubuntu.com --recv-keys AA12E97F0881517F &&
add-apt-repository 'deb https://static.redox-os.org/toolchain/apt ./' && add-apt-repository 'deb https://static.redox-os.org/toolchain/apt ./' &&
apt-get update -qq && apt-get update -qq &&
apt-get purge -qq binutils-doc && apt-get purge -qq binutils-doc &&
apt-get install -qq x86-64-unknown-redox-gcc && apt-get install -qq x86-64-unknown-redox-gcc &&
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none &&
build:
script:
- |
[ -d "$CI_PROJECT_NAME" ] || git clone "$CI_REPOSITORY_URL" "$CI_PROJECT_NAME" && [ -d "$CI_PROJECT_NAME" ] || git clone "$CI_REPOSITORY_URL" "$CI_PROJECT_NAME" &&
cd "$CI_PROJECT_NAME" && cd "$CI_PROJECT_NAME" &&
git remote set-url origin "$CI_REPOSITORY_URL" && git remote set-url origin "$CI_REPOSITORY_URL" &&
@ -45,5 +32,11 @@ build:
git submodule update --init --recursive && git submodule update --init --recursive &&
source "$HOME/.cargo/env" && source "$HOME/.cargo/env" &&
rustup update && rustup update &&
cargo install cargo-config xargo && cargo install cargo-config xargo
make ci
img:
script:
- |
cd "$CI_PROJECT_NAME" &&
source "$HOME/.cargo/env" &&
make ci-img IMG_TAG=$CI_COMMIT_REF_NAME

View file

@ -32,7 +32,7 @@ matrix:
before_script: before_script:
- cd cookbook && ./setup.sh && cd .. - cd cookbook && ./setup.sh && cd ..
script: script:
- make clean && make travis - make clean && make travis IMG_TAG=$TRAVIS_TAG
deploy: deploy:
provider: releases provider: releases

View file

@ -40,12 +40,6 @@ fetch:
"$$(cargo run --manifest-path ../installer/Cargo.toml -- --list-packages -c ../initfs.toml)" \ "$$(cargo run --manifest-path ../installer/Cargo.toml -- --list-packages -c ../initfs.toml)" \
"$$(cargo run --manifest-path ../installer/Cargo.toml -- --list-packages -c ../filesystem.toml)" "$$(cargo run --manifest-path ../installer/Cargo.toml -- --list-packages -c ../filesystem.toml)"
ci:
cd cookbook && ./fetch.sh \
"$$(cargo run --manifest-path ../installer/Cargo.toml -- --list-packages -c ../ci.toml)"
cd cookbook && ./repo.sh \
"$$(cargo run --manifest-path ../installer/Cargo.toml -- --list-packages -c ../ci.toml)"
# Emulation recipes # Emulation recipes
include mk/qemu.mk include mk/qemu.mk
include mk/bochs.mk include mk/bochs.mk
@ -61,14 +55,23 @@ include mk/filesystem.mk
# Disk images # Disk images
include mk/disk.mk include mk/disk.mk
# Travis target # CI image target
travis: FORCE ci-img: FORCE
make INSTALLER_FLAGS= build/harddrive.bin.gz build/livedisk.iso make INSTALLER_FLAGS= build/harddrive.bin.gz build/harddrive-efi.bin.gz build/livedisk.iso build/livedisk-efi.iso
rm -rf build/travis rm -rf build/img
mkdir build/travis mkdir build/img
mv build/harddrive.bin.gz build/travis/redox_$(TRAVIS_TAG).bin.gz mv build/harddrive.bin.gz build/img/redox_$(IMG_TAG)_harddrive.bin.gz
mv build/livedisk.iso build/travis/redox_$(TRAVIS_TAG).iso mv build/livedisk.iso build/img/redox_$(IMG_TAG)_livedisk.iso
cd build/travis && sha256sum -b redox_$(TRAVIS_TAG).bin.gz redox_$(TRAVIS_TAG).iso > SHA256SUM mv build/harddrive-efi.bin.gz build/img/redox_$(IMG_TAG)_harddrive-efi.bin.gz
mv build/livedisk-efi.iso build/img/redox_$(IMG_TAG)_livedisk-efi.iso
cd build/img && sha256sum -b * > SHA256SUM
# CI packaging target
ci-pkg: FORCE
cd cookbook && ./fetch.sh \
"$$(cargo run --manifest-path ../installer/Cargo.toml -- --list-packages -c ../ci.toml)"
cd cookbook && ./repo.sh \
"$$(cargo run --manifest-path ../installer/Cargo.toml -- --list-packages -c ../ci.toml)"
# An empty target # An empty target
FORCE: FORCE:

View file

@ -40,6 +40,9 @@ build/harddrive-efi.bin: build/bootloader.efi build/filesystem.bin
mcopy -i $@.partial -s bootloader-efi/res ::redox_bootloader mcopy -i $@.partial -s bootloader-efi/res ::redox_bootloader
cat $@.partial build/filesystem.bin > $@ cat $@.partial build/filesystem.bin > $@
build/harddrive-efi.bin.gz: build/harddrive-efi.bin
gzip -k -f $<
build/livedisk-efi.iso: build/bootloader.efi build/kernel_live build/livedisk-efi.iso: build/bootloader.efi build/kernel_live
dd if=/dev/zero of=$@.partial bs=1048576 count=272 dd if=/dev/zero of=$@.partial bs=1048576 count=272
mkfs.vfat $@.partial mkfs.vfat $@.partial
@ -50,3 +53,6 @@ build/livedisk-efi.iso: build/bootloader.efi build/kernel_live
mcopy -i $@.partial -s bootloader-efi/res ::redox_bootloader mcopy -i $@.partial -s bootloader-efi/res ::redox_bootloader
mcopy -i $@.partial -s build/kernel_live ::redox_bootloader/kernel mcopy -i $@.partial -s build/kernel_live ::redox_bootloader/kernel
mv $@.partial $@ mv $@.partial $@
build/livedisk-efi.bin.gz: build/livedisk-efi.bin
gzip -k -f $<