]> granicus.if.org Git - esp-idf/commitdiff
ci: build IDF docker image in CI
authorIvan Grokhotkov <ivan@espressif.com>
Mon, 8 Jul 2019 16:42:46 +0000 (18:42 +0200)
committerbot <bot@espressif.com>
Thu, 18 Jul 2019 06:18:04 +0000 (06:18 +0000)
tools/ci/config/build.yml

index 5e6b3cde03027ffeea1a00f5acd8c5cc68b21e81..215f5117e7d1ea2d3c8cb93d9426ab405daf4001 100644 (file)
@@ -259,3 +259,26 @@ test_build_system_cmake:
     - mkdir test_build_system
     - cd test_build_system
     - ${IDF_PATH}/tools/ci/test_build_system_cmake.sh
+
+build_docker:
+  stage: build
+  image: espressif/docker-builder:1
+  tags:
+    - build_docker_amd64_brno
+  only:
+    refs:
+      - master
+      - /^release\/v/
+      - /^v\d+\.\d+(\.\d+)?($|-)/
+      - schedules
+  variables:
+    DOCKER_TMP_IMAGE_NAME: "idf_tmp_image"
+  before_script: []
+  script:
+    - export DOCKER_BUILD_ARGS="--build-arg IDF_CLONE_URL=${CI_REPOSITORY_URL} --build-arg IDF_CLONE_BRANCH_OR_TAG=${CI_COMMIT_REF_NAME} --build-arg IDF_CHECKOUT_REF=${CI_COMMIT_TAG:-$CI_COMMIT_SHA}"
+    # Build
+    - docker build --tag ${DOCKER_TMP_IMAGE_NAME} ${DOCKER_BUILD_ARGS} tools/docker/
+    # We can't mount $PWD/examples/get-started/blink into the container, see https://gitlab.com/gitlab-org/gitlab-ce/issues/41227.
+    # The workaround mentioned there works, but leaves around directories which need to be cleaned up manually.
+    # Therefore, build a copy of the example located inside the container.
+    - docker run --rm --workdir /opt/esp/idf/examples/get-started/blink ${DOCKER_TMP_IMAGE_NAME} idf.py build