Commit 2c80a963 authored by Rahix's avatar Rahix 🦀
Browse files

Merge 'Set up basic CI pipeline'

See merge request !15
parents 55ec109c bcfcd8ab
image: "engel-simulator-builder:latest"
stages:
- check
- build
check:
stage: check
script:
- rustc --version
- cargo --version
- cargo fmt -- --check
only:
- merge_requests
build-dev:
stage: build
script:
- ls -al /usr/local/cargo/bin
- wasm-pack build --dev
only:
- merge_requests
build-release:
stage: build
script:
- wasm-pack build
- cd www
- npm install
- npm run rust-web-modules
- npm run build
artifacts:
paths:
- www/dist
only:
- master
FROM rust:1.48.0-buster
RUN rustup component add rustfmt
RUN cargo install wasm-pack
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
RUN apt-get install -y nodejs
# Setup
## Install and register runnner
- Install GitLab runner
- See https://docs.gitlab.com/runner/install/
- Register using `gitlab-runner register`
- See https://docs.gitlab.com/runner/register/
- Use `docker` executor
## Build local docker image
To speed up the build, we use a customized docker image.
The easiest way is to build the image locally:
- Clone repo to runner machine:
`git clone https://gitlab.muc.ccc.de/engel-simulator-2020/game.git`
- Build docker image:
`docker build game/ci -t engel-simulator-builder`
## Enable local docker images
The GitLab runner will always try to pull images from docker hub by default. To use local images, you must enable this in `nano /etc/gitlab-runner/config.toml`.
Here, add `pull_policy = "if-not-present"` to the `[runners.docker]` section.
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