From 0fa5523b39b93a49ebbca61b84ffe4841d47c791 Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Mon, 29 Apr 2019 22:56:00 +0200 Subject: [PATCH] initial --- .gitlab-ci.yml | 22 ++++++++++++++++++++++ Dockerfile | 31 +++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 .gitlab-ci.yml create mode 100644 Dockerfile diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..496e187 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,22 @@ +image: docker:stable + +stages: + - build + +variables: + IMAGE_NAME: registry.gitlab.com/wolutator/build-env-arduino + +build: + stage: build + tags: + - hottis + - linux + - docker + script: + - VERSION=`cat VERSION` + - echo "Version is $VERSION" + - docker build --tag $IMAGE_NAME:latest --tag $IMAGE_NAME:$VERSION . + - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY + - docker push $IMAGE_NAME:latest + - docker push $IMAGE_NAME:$VERSION + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c09a908 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,31 @@ +FROM registry.gitlab.com/wolutator/base-build-env:latest + +MAINTAINER Wolfgang Hottgenroth + +ARG ArduinoPackage=arduino-cli-latest-linux64.tar.bz2 +ARG ArduinoUID="2252" +ARG ArduinoGID="2252" + +RUN \ + apt update && \ + apt install -y wget && \ + rm -rf /var/lib/apt/lists/* && \ + cd /tmp && \ + wget https://downloads.arduino.cc/arduino-cli/${ArduinoPackage} && \ + Filename=`tar -tjf ${ArduinoPackage}` && \ + tar -xjf ${ArduinoPackage} && \ + mv $Filename /usr/bin/arduino-cli && \ + groupadd -r -g $ArduinoGID arduino && \ + useradd -r -u $ArduinoUID -g arduino arduino + +USER arduino + +RUN \ + arduino-cli config init + +CMD ["/bin/bash"] + + + + +