summaryrefslogtreecommitdiffstats
path: root/scripts/ci/gitlab/docker.yml
blob: 827bb470a15315c244568d1ea6549a89a3fb9dd6 (plain)
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
.bb_docker_local:
  # intended to be run on meta-updater's master branch which contains the
  # reference docker files
  # parameters:
  #   - BITBAKE_IMAGE
  #   - BITBAKE_CHECKOUT_IMAGE
  #   - BITBKAE_IMAGE_MASTER
  #   - BITBAKE_CHECKOUT_IMAGE_MASTER
  image: docker:stable
  stage: docker
  services:
    - docker:dind
  before_script:
    - docker login -u gitlab-ci-token -p "$CI_JOB_TOKEN" "$CI_REGISTRY"
  script:
    - docker pull "$BITBAKE_IMAGE" || docker pull "$BITBKAE_IMAGE_MASTER" || true
    - docker build --pull --cache-from "$BITBKAE_IMAGE_MASTER" --cache-from "$BITBAKE_IMAGE" -f ./scripts/ci/Dockerfile.bitbake -t "$BITBAKE_IMAGE" ./scripts/ci
    - docker push "$BITBAKE_IMAGE"

    - docker pull "$BITBAKE_CHECKOUT_IMAGE" || docker pull "$BITBAKE_CHECKOUT_IMAGE_MASTER" || true
    - docker build --pull --cache-from "$BITBAKE_CHECKOUT_IMAGE_MASTER" --cache-from "$BITBAKE_CHECKOUT_IMAGE" -f ./scripts/ci/Dockerfile.checkout -t "$BITBAKE_CHECKOUT_IMAGE" ./scripts/ci
    - docker push "$BITBAKE_CHECKOUT_IMAGE"

.bb_docker_remote:
  # intended to be run on other branches and repos: just pulls the last master image
  # parameters:
  #   - BITBAKE_IMAGE
  #   - BITBAKE_CHECKOUT_IMAGE
  image: docker:stable
  stage: docker
  services:
    - docker:dind
  before_script:
    - docker login -u gitlab-ci-token -p "$CI_JOB_TOKEN" "$CI_REGISTRY"
  script:
    - docker pull "$BITBAKE_IMAGE"
    - docker pull "$BITBAKE_CHECKOUT_IMAGE"