-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathsuse_rpm.yml
145 lines (138 loc) · 7.56 KB
/
suse_rpm.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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
---
.if_version_6: &if_version_6
if: $RELEASE_VERSION_6 != ""
.if_version_7: &if_version_7
if: $RELEASE_VERSION_7 != ""
.retrieve_linux_go_deps: &retrieve_linux_go_deps |
mkdir -p /gomodcache && tar xzf modcache.tar.gz -C /gomodcache
rm -f modcache.tar.gz
.agent_build_common_suse_rpm:
script:
- echo "About to build for $RELEASE_VERSION"
- *retrieve_linux_go_deps
# remove artifacts from previous pipelines that may come from the cache
- rm -rf $OMNIBUS_PACKAGE_DIR_SUSE/*
# Artifacts and cache must live within project directory but we run omnibus in a neutral directory.
# Thus, we move the artifacts at the end in a gitlab-friendly dir.
- set +x
- RPM_GPG_KEY=$(aws ssm get-parameter --region us-east-1 --name $RPM_GPG_KEY_SSM_NAME --with-decryption --query "Parameter.Value" --out text)
- printf -- "$RPM_GPG_KEY" | gpg --import --batch
- export RPM_SIGNING_PASSPHRASE=$(aws ssm get-parameter --region us-east-1 --name $RPM_SIGNING_PASSPHRASE_SSM_NAME --with-decryption --query "Parameter.Value" --out text)
- set -x
- mkdir -p /tmp/system-probe
- $S3_CP_CMD $S3_ARTIFACTS_URI/system-probe.${PACKAGE_ARCH} /tmp/system-probe/system-probe
- $S3_CP_CMD $S3_ARTIFACTS_URI/tracer.o.${PACKAGE_ARCH} /tmp/system-probe/tracer.o
- $S3_CP_CMD $S3_ARTIFACTS_URI/tracer-debug.o.${PACKAGE_ARCH} /tmp/system-probe/tracer-debug.o
- $S3_CP_CMD $S3_ARTIFACTS_URI/offset-guess.o.${PACKAGE_ARCH} /tmp/system-probe/offset-guess.o
- $S3_CP_CMD $S3_ARTIFACTS_URI/offset-guess-debug.o.${PACKAGE_ARCH} /tmp/system-probe/offset-guess-debug.o
- $S3_CP_CMD $S3_ARTIFACTS_URI/runtime-security.o.${PACKAGE_ARCH} /tmp/system-probe/runtime-security.o
- $S3_CP_CMD $S3_ARTIFACTS_URI/runtime-security-syscall-wrapper.o.${PACKAGE_ARCH} /tmp/system-probe/runtime-security-syscall-wrapper.o
- $S3_CP_CMD $S3_ARTIFACTS_URI/tracer.c.${PACKAGE_ARCH} /tmp/system-probe/tracer.c
- $S3_CP_CMD $S3_ARTIFACTS_URI/runtime-security.c.${PACKAGE_ARCH} /tmp/system-probe/runtime-security.c
- chmod 755 /tmp/system-probe/system-probe
- $S3_CP_CMD $S3_ARTIFACTS_URI/libbcc-${PACKAGE_ARCH}.tar.xz /tmp/libbcc.tar.xz
# use --skip-deps since the deps are installed by `before_script`
- inv -e agent.omnibus-build --release-version "$RELEASE_VERSION" --major-version "$AGENT_MAJOR_VERSION" --python-runtimes "$PYTHON_RUNTIMES" --base-dir $OMNIBUS_BASE_DIR_SUSE ${USE_S3_CACHING} --skip-deps --system-probe-bin=/tmp/system-probe --libbcc-tarball=/tmp/libbcc.tar.xz
- find $OMNIBUS_BASE_DIR_SUSE/pkg -type f -name '*.rpm' ! -name '*dbg*.rpm' -print0 | xargs -0 -I '{}' zypper in '{}'
- find $OMNIBUS_BASE_DIR_SUSE/pkg -type f -name '*dbg*.rpm' -print0 | xargs -0 -I '{}' zypper in '{}'
- mkdir -p $OMNIBUS_PACKAGE_DIR_SUSE && cp $OMNIBUS_BASE_DIR_SUSE/pkg/*.{rpm,metadata.json} $OMNIBUS_PACKAGE_DIR_SUSE
# FIXME: skip the installation step until we fix the preinst/postinst scripts in the rpm package
# to also work with SUSE11
# - rpm -i $OMNIBUS_PACKAGE_DIR_SUSE/*.rpm
artifacts:
expire_in: 2 weeks
paths:
- $OMNIBUS_PACKAGE_DIR_SUSE
# build Agent package for suse-x64
agent_suse-x64-a6:
extends: .agent_build_common_suse_rpm
rules:
- <<: *if_version_6
stage: package_build
image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-builders/suse_x64:$DATADOG_AGENT_BUILDERS
tags: ["runner:main", "size:2xlarge"]
needs: ["tests_rpm-x64-py2", "tests_rpm-x64-py3", "build_system-probe-x64", "linux_x64_go_deps"]
variables:
AWS_CONTAINER_CREDENTIALS_RELATIVE_URI: /credentials
AGENT_MAJOR_VERSION: 6
PYTHON_RUNTIMES: '2,3'
PACKAGE_ARCH: amd64
before_script:
- export RELEASE_VERSION=$RELEASE_VERSION_6
# build Agent package for suse-x64
agent_suse-x64-a7:
extends: .agent_build_common_suse_rpm
rules:
- <<: *if_version_7
stage: package_build
image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-builders/suse_x64:$DATADOG_AGENT_BUILDERS
tags: ["runner:main", "size:2xlarge"]
needs: ["tests_rpm-x64-py3", "build_system-probe-x64", "linux_x64_go_deps"]
variables:
AWS_CONTAINER_CREDENTIALS_RELATIVE_URI: /credentials
AGENT_MAJOR_VERSION: 7
PYTHON_RUNTIMES: '3'
PACKAGE_ARCH: amd64
before_script:
- export RELEASE_VERSION=$RELEASE_VERSION_7
iot_agent_suse-x64:
rules:
- <<: *if_version_7
stage: package_build
image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-builders/suse_x64:$DATADOG_AGENT_BUILDERS
tags: ["runner:main", "size:2xlarge"]
needs: ["linux_x64_go_deps"]
before_script:
script:
- echo "About to build iot agent for $RELEASE_VERSION_7"
- *retrieve_linux_go_deps
- echo "Detected host architecture $(uname -m)"
# $DD_TARGET_ARCH is only set by Arm build images, so assume amd64 if not present
- echo "Target architecture ${DD_TARGET_ARCH:=amd64}"
# remove artifacts from previous pipelines that may come from the cache
- rm -rf $OMNIBUS_PACKAGE_DIR_SUSE/*
# Artifacts and cache must live within project directory but we run omnibus in a neutral directory.
# Thus, we move the artifacts at the end in a gitlab-friendly dir.
- set +x
- RPM_GPG_KEY=$(aws ssm get-parameter --region us-east-1 --name $RPM_GPG_KEY_SSM_NAME --with-decryption --query "Parameter.Value" --out text)
- printf -- "$RPM_GPG_KEY" | gpg --import --batch
- export RPM_SIGNING_PASSPHRASE=$(aws ssm get-parameter --region us-east-1 --name $RPM_SIGNING_PASSPHRASE_SSM_NAME --with-decryption --query "Parameter.Value" --out text)
- set -x
# Use --skip-deps since the deps are installed by `before_script`.
- inv -e agent.omnibus-build --iot --log-level debug --release-version "$RELEASE_VERSION_7" --major-version 7 --base-dir $OMNIBUS_BASE_DIR --skip-deps
- ls $OMNIBUS_BASE_DIR/pkg/
- mkdir -p $OMNIBUS_PACKAGE_DIR_SUSE && cp $OMNIBUS_BASE_DIR/pkg/*.{rpm,metadata.json} $OMNIBUS_PACKAGE_DIR_SUSE
artifacts:
expire_in: 2 weeks
paths:
- $OMNIBUS_PACKAGE_DIR_SUSE
dogstatsd_suse-x64:
rules:
- <<: *if_version_7
stage: package_build
image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-builders/suse_x64:$DATADOG_AGENT_BUILDERS
tags: ["runner:main", "size:large"]
needs: ["build_dogstatsd-deb_x64", "linux_x64_go_deps"]
variables:
AWS_CONTAINER_CREDENTIALS_RELATIVE_URI: /credentials
before_script:
- *retrieve_linux_go_deps
script:
# remove artifacts from previous pipelines that may come from the cache
- rm -rf $OMNIBUS_PACKAGE_DIR_SUSE/*
# Artifacts and cache must live within project directory but we run omnibus
# from the GOPATH (see above). We then call `invoke` passing --base-dir,
# pointing to a gitlab-friendly location.
- set +x
- RPM_GPG_KEY=$(aws ssm get-parameter --region us-east-1 --name $RPM_GPG_KEY_SSM_NAME --with-decryption --query "Parameter.Value" --out text)
- printf -- "$RPM_GPG_KEY" | gpg --import --batch
- export RPM_SIGNING_PASSPHRASE=$(aws ssm get-parameter --region us-east-1 --name $RPM_SIGNING_PASSPHRASE_SSM_NAME --with-decryption --query "Parameter.Value" --out text)
- set -x
# Use --skip-deps since the deps are installed by `before_script`.
- inv -e dogstatsd.omnibus-build --release-version "$RELEASE_VERSION_7" --major-version 7 --base-dir $OMNIBUS_BASE_DIR_SUSE ${USE_S3_CACHING} --skip-deps
- find $OMNIBUS_BASE_DIR_SUSE/pkg -type f -name '*.rpm' -print0 | sort -z | xargs -0 -I '{}' rpm -i '{}'
- mkdir -p $OMNIBUS_PACKAGE_DIR_SUSE && cp $OMNIBUS_BASE_DIR_SUSE/pkg/*.{rpm,metadata.json} $OMNIBUS_PACKAGE_DIR_SUSE
artifacts:
expire_in: 2 weeks
paths:
- $OMNIBUS_PACKAGE_DIR_SUSE