-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.gitlab-ci.yml
120 lines (111 loc) · 2.49 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
111
112
113
114
115
116
117
118
119
120
#//
#// 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:
- PLCnextBuild
- 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: false
#################################################
#################################################
#################################################
######PLCnext Building###########################
BuildJson:
stage: PLCnextBuild
extends: .RunnerRequirements
script:
- tools/prepare-json.sh
- tools/build-json.sh -t "${SDK_PATH}" -a "${TARGET_VERSION}" -n "${TARGET_NAME}"
cache:
key: prepareJson
paths:
- external/
artifacts:
expire_in: 10 min
paths:
- deploy/
BuildValiJson:
stage: PLCnextBuild
extends: .RunnerRequirements
script:
- tools/prepare-valijson.sh
- tools/build-valijson.sh -t "${SDK_PATH}" -a "${TARGET_VERSION}" -n "${TARGET_NAME}"
cache:
key: prepareValiJson
paths:
- external/
artifacts:
expire_in: 10 min
paths:
- deploy/
BuildMqttClient:
stage: PLCnextBuild
extends: .RunnerRequirements
script:
- tools/prepare-mqtt-client.sh
- tools/build-mqtt-client.sh -t "${SDK_PATH}" -a "${TARGET_VERSION}" -n "${TARGET_NAME}"
cache:
key: prepareMqttClient
paths:
- external/
artifacts:
expire_in: 10 min
paths:
- deploy/
BuildComponent:
stage: PLCnextBuildLibrary
extends: .RunnerRequirements
dependencies:
- BuildJson
- BuildValiJson
- BuildMqttClient
script:
- tools/build-component.sh -t "${SDK_PATH}" -a "${TARGET_VERSION}" -n "${TARGET_NAME}"
artifacts:
name: "$CI_COMMIT_REF_SLUG"
when: always
expire_in: 1 hour
paths:
- deploy/
BuildAll:
stage: PLCnextBuildAll
extends: .RunnerRequirements
script:
- tools/build-automatic-all.sh
artifacts:
name: "$CI_COMMIT_REF_SLUG"
when: on_success
paths:
- deploy/