Commit 880d7b61 authored by Marcel Huber's avatar Marcel Huber
Browse files

basic set of coast build tools installed

parents
.git
README.md
*.swp
variables:
MY_IMAGE_NAME: "COAST build tools image"
MY_BUILT_IMAGE: "coastbuild:latest"
MY_DOCKER_IMAGE: marcelhuberfoo/arch-build-coast
MY_DOCKER_FILE: Dockerfile
MY_DOCKER_CONTEXT: .
stages:
- build
- test
- deploy
before_script:
build:
image: docker:latest
stage: build
tags:
- docker
script:
- apk --no-cache --quiet add git
- env | sort
- ./build.sh
test:
stage: test
tags:
- docker
script:
- docker run --rm $MY_BUILT_IMAGE python2 -V
deploy:
stage: deploy
tags:
- docker
only:
- tags
- triggers
script:
- docker login -u "$DOCKER_USER" -p "$DOCKER_PASS"
- docker tag ${MY_BUILT_IMAGE} ${MY_DOCKER_IMAGE}:latest
- docker tag ${MY_BUILT_IMAGE} ${MY_DOCKER_IMAGE}:$(docker run --rm --entrypoint /bin/sh $MY_DOCKER_IMAGE -c 'echo -n ${BUILD_TAG}')
- docker push ${MY_DOCKER_IMAGE}:latest
- docker push ${MY_DOCKER_IMAGE}:$(docker run --rm --entrypoint /bin/sh $MY_DOCKER_IMAGE -c 'echo -n ${BUILD_TAG}')
- if [ -n "$MICROBADGER_UPDATE_HOOK" ]; then curl --silent --request POST $MICROBADGER_UPDATE_HOOK; fi
- docker rmi ${MY_BUILT_IMAGE}
FROM marcelhuberfoo/arch-build
MAINTAINER Marcel Huber <marcelhuberfoo@gmail.com>
ARG BUILD_TIME
ARG BUILD_DATE
ARG BUILD_TAG
ARG MY_IMAGE_NAME
ARG MY_DOCKER_FILE
ARG CI_PROJECT_URL
ARG VCS_REF
ARG VCS_URL
LABEL org.label-schema.build-date="$BUILD_TIME" \
org.label-schema.docker.dockerfile="$MY_DOCKER_FILE" \
org.label-schema.name="$MY_IMAGE_NAME" \
org.label-schema.url="$CI_PROJECT_URL" \
org.label-schema.vcs-ref="$VCS_REF" \
org.label-schema.vcs-url="$VCS_URL" \
org.label-schema.version="$BUILD_TAG" \
org.label-schema.schema-version="1.0"
ENV BUILD_DATE=$BUILD_DATE
ENV BUILD_TAG=$BUILD_TAG
USER root
RUN sh -c 'echo -e "[infinality-bundle]\nSigLevel = Never\nServer = http://bohoomil.com/repo/\$arch\n[infinality-bundle-fonts]\nSigLevel = Never\nServer = http://bohoomil.com/repo/fonts" \
| cat /etc/pacman.conf - > /tmp/pacman.conf && \
pacman -Syy --noconfirm --quiet --noprogressbar --needed --config /tmp/pacman.conf \
python2-tox lib32-openssl lib32-zlib gdb doxygen graphviz \
harfbuzz-icu fontconfig-infinality-ultimate ibfonts-meta-base && \
printf "y\\ny\\n" | pacman -Scc && \
rm -f /var/lib/pacman/sync/*.db'
# ADD entrypoint.sh /
# ADD pip.conf /$UNAME/.pip/
# RUN sed -i "s|USER|$UNAME|" /$UNAME/.pip/pip.conf
# RUN chown -R $UNAME:$GNAME /$UNAME/.pip
The MIT License (MIT)
Copyright (c) 2016 Marcel Huber and IFS Institute for Software at HSR Rapperswil, Switzerland
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
#!/bin/sh
_BUILD_TAG="$(git describe --abbrev=0 --tags 2>/dev/null)"
_VCS_URL="$(echo $CI_BUILD_REPO | sed 's|gitlab-ci-token[^@]*@||')"
_CI_PROJECT_URL="${CI_PROJECT_URL:-https://gitlab.dev.ifs.hsr.ch/}"
if [ -n "$_BUILD_TAG" ]; then
_revs_ahead_tag=$(git rev-list --count ${_BUILD_TAG}..)
_commit_id_short=$(git log -1 --format=%h)
_VCS_REF="$(echo $_BUILD_TAG | sed -e 's/^[-_/a-zA-Z]\+//' -e 's/[-_+]/./g').${_revs_ahead_tag}.g${_commit_id_short}"
else
_VCS_REF="0.$(git rev-list --count ${CI_BUILD_REF_NAME:-master}).g$(git log -1 --format=%h)"
fi
set -e
docker build \
--build-arg MY_DOCKER_FILE="$MY_DOCKER_FILE" \
--build-arg MY_IMAGE_NAME="$MY_IMAGE_NAME" \
--build-arg BUILD_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
--build-arg BUILD_DATE=$(date +"%Y%m%d") \
--build-arg BUILD_TAG=$_BUILD_TAG \
--build-arg CI_PROJECT_URL=$_CI_PROJECT_URL \
--build-arg VCS_REF=$_VCS_REF \
--build-arg VCS_URL=$_VCS_URL \
--tag=$MY_BUILT_IMAGE --file=$MY_DOCKER_FILE $MY_DOCKER_CONTEXT
[global]
index-url=https://devpi.coast-project.org/coast/CoastSconsider/+simple
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