forked from chibiegg/vivado-docker
-
Notifications
You must be signed in to change notification settings - Fork 8
/
.gitlab-ci.yml
59 lines (52 loc) · 3.16 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Kaniko is the recommended method for running Docker-builds as of May 2019.
# See https://docs.gitlab.com/ee/ci/docker/using_kaniko.html for GitLab's documentation.
# Variables -------------------------------------------------------------------
variables:
PROJ_NAME: '${SERIES}-$CI_COMMIT_REF_NAME-${OS}${OS_VERSION}-${VERSION}-${VIEW}'
# Stages ----------------------------------------------------------------------
stages:
- build
# Job templates ---------------------------------------------------------------
.job_template:
stage: build
tags:
- docker-privileged-xl
image:
# We recommend using the CERN version of the Kaniko image: gitlab-registry.cern.ch/ci-tools/docker-image-builder
name: gitlab-registry.cern.ch/ci-tools/docker-image-builder
entrypoint: [""]
variables:
DOCKER_DRIVER: overlay2
DOCKER_REGISTRY: https://index.docker.io/v1/
NO_CACHE: "true"
CONTEXT_DIR: "${OS}/${OS_VERSION}/${SERIES}/${VERSION}/${VIEW}/"
FROM: "${OS}:${OS_VERSION}"
TO_GITLAB: "${CI_REGISTRY_IMAGE}/${OS}${OS_VERSION}_${SERIES}${VERSION}_${VIEW}:latest" #GitLab
TO_DOCKERHUB: "aperloff/vivado-docker:${OS}${OS_VERSION}_${SERIES}${VERSION}_${VIEW}" #DockerHub
script:
# General pipeline information
- echo "Pipeline source - $CI_PIPELINE_SOURCE"
- echo "Building the Xilinx Docker image on ${DATE}"
- echo ${CI_PROJECT_DIR}/${CONTEXT_DIR}/
- ls -alh ${CI_PROJECT_DIR}/${CONTEXT_DIR}/
# Prepare Kaniko configuration file
- echo "Logging into the registry ${CI_REGISTRY}"
- export DOCKER_AUTH="$(echo -n $DOCKER_USERNAME:$DOCKER_PASSWORD | base64)" # https://github.com/GoogleContainerTools/kaniko#pushing-to-docker-hub
- echo "{\"auths\":{\"${CI_REGISTRY}\":{\"username\":\"${CI_REGISTRY_USER}\",\"password\":\"${CI_REGISTRY_PASSWORD}\"}, \"${DOCKER_REGISTRY}\":{\"auth\":\"${DOCKER_AUTH}\"}}}" > /kaniko/.docker/config.json
# Build and push the image from the Dockerfile at the root of the project.
# To push to a specific docker tag, amend the --destination parameter, e.g. --destination $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME
# See https://docs.gitlab.com/ee/ci/variables/predefined_variables.html#variables-reference for available variables
- df -ih
- ls -lh $CI_PROJECT_DIR/$CONTEXT_DIR/
- /kaniko/executor --context ${CI_PROJECT_DIR}/${CONTEXT_DIR} --dockerfile ${CI_PROJECT_DIR}/${CONTEXT_DIR}/Dockerfile --destination ${TO_GITLAB} --destination ${TO_DOCKERHUB} --single-snapshot --cleanup --build-arg VERSION=${VERSION}
- df -ih
# Jobs/Includes ---------------------------------------------------------------
include:
# - local: '/centos/7.4.1708/vivado/2019.2/x11/.gitlab-ci.yml'
# - local: '/centos/7.7.1908/vivado/2019.2/x11/.gitlab-ci.yml'
# - local: '/sl/7/vivado/2018.2/x11/.gitlab-ci.yml'
# - local: '/sl/7/vivado/2019.1/x11/.gitlab-ci.yml'
# - local: '/sl/7/vivado/2019.2/x11/.gitlab-ci.yml'
# - local: '/sl/7/vitis/2019.2/x11/.gitlab-ci.yml'
- local: '/sl/7/vitis/2020.1/x11/.gitlab-ci.yml'
# - local: '/ubuntu/18.04/vivado/2019.1/vnc/.gitlab-ci.yml'