Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MISP-1958 ci pipeline fix #150

Open
wants to merge 22 commits into
base: master/imx6
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 62 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,69 @@ include:
ref: master
file: /gitlab_ci_templates/jedi-gitlab-ci-template.yml

default:
# Only the prepare/cleanup_enviroment steps don't use the image containing the Docker
image: "${BUILD_PIPELINE_IMAGE}"

.retrieve_source:
before_script:
- git -c submodule.linux.url="https://ultimaker-ci:${CI_PERSONAL_ACCESS_TOKEN}@github.com/Ultimaker/linux" submodule update --init --recursive
- git -c submodule.drivers.net.wireless.realtek.rtl8822ce.url="https://ultimaker-ci:${CI_PERSONAL_ACCESS_TOKEN}@github.com/Ultimaker/rtl8822ce" submodule update --init --recursive
#- rm -rf /builds/ultimaker/embedded/platform/um-kernel/linux
- git clone --branch ${CI_COMMIT_REF_NAME} ${CI_REPOSITORY_URL} --depth=1
#- echo "Initializing submodules ${CI_COMMIT_REF_NAME} ${CI_REPOSITORY_URL}"
#- git -c submodule.drivers.net.wireless.realtek.rtl8822ce.url="https://ultimaker-ci:${CI_PERSONAL_ACCESS_TOKEN}@github.com/Ultimaker/rtl8822ce" submodule update --init --recursive --force
- git submodule foreach --recursive git -c submodule.drivers.net.wireless.realtek.rtl8822ce.url="https://ultimaker-ci:${CI_PERSONAL_ACCESS_TOKEN}@github.com/Ultimaker/rtl8822ce" submodule update --init
#- git submodule add -b master https://ultimaker-ci:${CI_PERSONAL_ACCESS_TOKEN}@github.com/Ultimaker/rtl8822ce ./linux/drivers/net/wireless/realtek/rtl8822ce
#- git submodule update --init
#- git submodule update --init --recursive --force
# WORKS FOR LINUX not for realtek: - git submodule update --init --recursive
#- ls /builds/ultimaker/embedded/platform/um-kernel/linux
#- ls /builds/ultimaker/embedded/platform/um-kernel/linux/drivers
#- ls /builds/ultimaker/embedded/platform/um-kernel/linux/drivers/net
#- ls /builds/ultimaker/embedded/platform/um-kernel/linux/drivers/net/wireless
#- ls /builds/ultimaker/embedded/platform/um-kernel/linux/drivers/net/wireless/realtek
#- ls /builds/ultimaker/embedded/platform/um-kernel/linux/drivers/net/wireless/realtek/rtl8822ce
- ls /builds/ultimaker/embedded/platform/um-kernel/linux/drivers/net/wireless/realtek/rtl8822ce
#- git -c submodule.drivers.net.wireless.realtek.rtl8822ce.url="https://ultimaker-ci:${CI_PERSONAL_ACCESS_TOKEN}@github.com/Ultimaker/rtl8822ce" submodule update --init --recursive

# Overriding prime-jedi 'prepare_environment'.
# Prevents execution of source retrieval steps which cannot handle submodules not in GitLab
# The 'script' body is an exact match of prime-jedi's jedi-gitlab-ci-template.yml step.
prepare_environment:
image: "registry.hub.docker.com/library/docker:stable-git"
extends:
- .jobs_common
- .retrieve_source
stage: prepare
script:
- |
if [ -f ./docker_env/make_docker.sh ]; then
./docker_env/make_docker.sh "${BUILD_PIPELINE_IMAGE}"
else
docker build --rm -t "${BUILD_PIPELINE_IMAGE}" ./docker_env/

if ! docker run --rm --privileged -e "ARM_EMU_BIN=${ARM_EMU_BIN}" -v "${ARM_EMU_BIN}:${ARM_EMU_BIN}:ro" "${BUILD_PIPELINE_IMAGE}" "./buildenv_check.sh"; then
echo "Something is wrong with the build environment, please check your Dockerfile."
exit 1
fi
fi

docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
docker push "${BUILD_PIPELINE_IMAGE}"

# Overriding prime-jedi 'prepare_environment'.
# Prevents execution of source retrieval steps which cannot handle submodules not in GitLab
# The 'script' body is an exact match of prime-jedi's jedi-gitlab-ci-template.yml step.
cleanup_environment:
image: "registry.hub.docker.com/library/docker:stable-git"
extends:
- .jobs_common
stage: cleanup
when: always
script:
- |
if ! docker inspect --type image "${BUILD_PIPELINE_IMAGE}" 1> /dev/null; then
docker rmi -f "${BUILD_PIPELINE_IMAGE}"
fi

# Build stage
# ===========
Expand All @@ -23,3 +82,4 @@ build:
- ci/add_private_key.sh
- ./build.sh
- cp -v ./_build*/*.deb "./"

3 changes: 2 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[submodule "linux"]
path = linux
url = https://github.com/Ultimaker/linux.git
url = https://github.com/Ultimaker/linux.git
branch = master-som_imx6