Skip to content
Snippets Groups Projects
Commit e7375348 authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Make images in gitlab ci

parent 2f7ff3d6
No related branches found
No related tags found
No related merge requests found
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,26 +17,26 @@ before_script: ...@@ -24,26 +17,26 @@ 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 &&
[ -d "$CI_PROJECT_NAME" ] || git clone "$CI_REPOSITORY_URL" "$CI_PROJECT_NAME" &&
cd "$CI_PROJECT_NAME" &&
git remote set-url origin "$CI_REPOSITORY_URL" &&
git fetch origin &&
git checkout "$CI_COMMIT_SHA" &&
git submodule update --init --recursive &&
source "$HOME/.cargo/env" &&
rustup update &&
cargo install cargo-config xargo
build: img:
script: script:
- | - |
[ -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 fetch origin &&
git checkout "$CI_COMMIT_SHA" &&
git submodule update --init --recursive &&
source "$HOME/.cargo/env" && source "$HOME/.cargo/env" &&
rustup update && make ci-img IMG_TAG=$CI_COMMIT_REF_NAME
cargo install cargo-config xargo &&
make ci
...@@ -32,7 +32,7 @@ matrix: ...@@ -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
......
...@@ -40,12 +40,6 @@ fetch: ...@@ -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 ...@@ -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:
......
...@@ -40,6 +40,9 @@ build/harddrive-efi.bin: build/bootloader.efi build/filesystem.bin ...@@ -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 ...@@ -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 $<
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