Skip to content

Commit 2683968

Browse files
committed
Add Gitlab CI config and Dockerfile
1 parent 3333f48 commit 2683968

File tree

3 files changed

+69
-0
lines changed

3 files changed

+69
-0
lines changed

.dockerignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build/

.gitlab-ci.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
image: docker:stable
2+
3+
variables:
4+
# When using dind service we need to instruct docker, to talk with the
5+
# daemon started inside of the service. The daemon is available with
6+
# a network connection instead of the default /var/run/docker.sock socket.
7+
#
8+
# The 'docker' hostname is the alias of the service container as described at
9+
# https://docs.gitlab.com/ee/ci/docker/using_docker_images.html#accessing-the-services
10+
#
11+
# Note that if you're using Kubernetes executor, the variable should be set to
12+
# tcp://localhost:2375 because of how Kubernetes executor connects services
13+
# to the job container
14+
DOCKER_HOST: tcp://docker:2375/
15+
# When using dind, it's wise to use the overlayfs driver for
16+
# improved performance.
17+
DOCKER_DRIVER: overlay2
18+
19+
services:
20+
- docker:dind
21+
22+
before_script:
23+
- docker info
24+
25+
build:
26+
stage: build
27+
script:
28+
- docker build -t avr-rust .
29+
- docker run avr-rust echo hello world

Dockerfile

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
FROM ubuntu:18.04
2+
3+
USER root
4+
5+
# Install dependencies.
6+
RUN apt-get update && apt-get install -y build-essential cmake curl git python
7+
8+
# Create a regular user.
9+
RUN useradd -m rustacean
10+
11+
# Copy the code over, create an empty directory for builds.
12+
ADD . /code
13+
# RUN cd /code
14+
RUN mkdir /build && cd /build
15+
16+
# symlink Rust build directory to the /build volume
17+
# RUN mkdir /build && ln -sf /build /code/build
18+
19+
# Compile rust.
20+
# RUN /code/x.py build
21+
22+
# Generate Makefile using settings suitable for an experimental compiler
23+
RUN /code/configure \
24+
--enable-debug \
25+
--disable-docs \
26+
--enable-llvm-assertions \
27+
--enable-debug-assertions \
28+
--enable-optimize \
29+
--enable-llvm-release-debuginfo \
30+
--experimental-targets=AVR
31+
32+
RUN make
33+
RUN make install
34+
35+
# Drop down to the regular user
36+
USER rustacean
37+
38+
VOLUME /code
39+
VOLUME /build

0 commit comments

Comments
 (0)