-
Notifications
You must be signed in to change notification settings - Fork 5
/
.gitlab-ci.yml
123 lines (101 loc) · 2.26 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#//
#// Copyright (c) Phoenix Contact GmbH & Co. KG. All rights reserved.
#// Licensed under the MIT. See LICENSE file in the project root for full license information.
#// SPDX-License-Identifier: MIT
#//
stages:
- PLCnextBuildC
- PLCnextBuildCpp
- PLCnextBuildLibrary
- PLCnextBuildAll
- deploy
## Docker Image:
# PLCNCLI
# C/C++ SDK
# PLCNEngineer Library Builder
# CMAKE
image: $SDK_IMAGE
variables:
SDK_PATH: "${SDKPATH}"
TARGET_VERSION: "${TARGETVERSION}"
TARGET_NAME: "${TARGETNAME}"
.RunnerRequirements:
before_script:
- chmod +x tools/*
- which cmake
- cmake --version
- which make
- make --version
- which plcncli
- plcncli --version
- plcncli get sdks
- plcncli get targets
- apt-get update
- apt-get install ninja-build
- echo "SDK_PATH:${SDK_PATH}"
- echo "TARGET_VERSION:${TARGET_VERSION}"
- echo "TARGET_NAME:${TARGET_NAME}"
tags:
- docker
- debian-based
allow_failure: true
#################################################
#################################################
#################################################
######PLCnext Building###########################
BuildPahoC:
stage: PLCnextBuildC
extends: .RunnerRequirements
script:
- tools/build-paho.mqtt.c.sh -t "${SDK_PATH}" -a "${TARGET_VERSION}" -n "${TARGET_NAME}"
cache:
key: buildpahoc
paths:
- external/paho.mqtt.c
artifacts:
expire_in: 10 min
paths:
- deploy
BuildPahoCpp:
stage: PLCnextBuildCpp
extends: .RunnerRequirements
dependencies:
- BuildPahoC
script:
- tools/build-paho.mqtt.cpp.sh -t "${SDK_PATH}" -a "${TARGET_VERSION}" -n "${TARGET_NAME}"
cache:
key: buildpahoc
paths:
- external/paho.mqtt.cpp
artifacts:
expire_in: 10 min
paths:
- deploy
BuildComponent:
stage: PLCnextBuildLibrary
extends: .RunnerRequirements
dependencies:
- BuildPahoCpp
- BuildPahoC
script:
- tools/build-component.sh -t "${SDK_PATH}" -a "${TARGET_VERSION}" -n "${TARGET_NAME}"
cache:
key: buildcomponent
paths:
- build/
artifacts:
name: "$CI_COMMIT_REF_SLUG"
when: always
expire_in: 20 min
paths:
- deploy
BuildAll:
stage: PLCnextBuildAll
extends: .RunnerRequirements
script:
- tools/build-automatic-all.sh
artifacts:
name: "$CI_COMMIT_REF_SLUG"
when: on_success
paths:
- deploy