.gitlab-ci.yml 1.58 KB
Newer Older
fuyanbin's avatar
fuyanbin committed
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
# This file is a template, and might need editing before it works on your project.
# see https://docs.gitlab.com/ee/ci/yaml/README.html for all available options

# you can delete this line if you're not using Docker
before_script:
  - echo "before script."
  - echo "everything is ok."

after_script:
  - echo "hello world"
  - echo "everything is ok."

variables:
  BUILD_DIR: /build/
  PACKAGE_NAME: armbian-build
  GIT_DEPTH: "1"

stages:
  - build
  - notify_failure

build_job:
  stage: build
  script:
    - echo "Building the package ${PACKAGE_NAME}"
    - echo "Building paramaters:"
fuyanbin's avatar
fuyanbin committed
27
    - echo "event ${BUILD_PACKAGE_EVENT}" | base64 -d; echo 
fuyanbin's avatar
fuyanbin committed
28
29
30
31
32
33
34
    - echo "${BUILD_PACKAGE_JSON}" | base64 -d; echo 
    - python3 gitlab-ci.py --signal=package --event "${BUILD_PACKAGE_EVENT}" --build-directory "${BUILD_DIR}" --project-id "${CI_PROJECT_ID}" --pipeline-id "${CI_PIPELINE_ID}" "$(echo "${BUILD_PACKAGE_JSON}" | base64 -d)"
    - python3 gitlab-ci.py --signal=notify_success --build-directory "${BUILD_DIR}" --project-id "${CI_PROJECT_ID}" --pipeline-id "${CI_PIPELINE_ID}"
    - rm -f ".result/${CI_PROJECT_ID}-${CI_PIPELINE_ID}.json"
  rules:
    - if: '$CI_PIPELINE_SOURCE == "trigger"'
  tags:
fuyanbin's avatar
fuyanbin committed
35
    - android-build-runner
fuyanbin's avatar
fuyanbin committed
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
  cache:
    key: ${CI_COMMIT_REF_SLUG}
    paths:
      - .result/

failure_notify_job:
  script:
    - python3 gitlab-ci.py --signal=notify_failure --project-id "${CI_PROJECT_ID}" --pipeline-id "${CI_PIPELINE_ID}"
  stage: notify_failure
  rules:
    - if: '$CI_PIPELINE_SOURCE == "trigger"'
      when: on_failure
  cache:
    key: ${CI_COMMIT_REF_SLUG}
    paths:
      - .result/