Skip to content

Commit ff05603

Browse files
authored
Merge pull request swiftlang#43 from apple/createrepo
Add support to create repodata
2 parents f768de7 + 15c46df commit ff05603

File tree

7 files changed

+50
-3
lines changed

7 files changed

+50
-3
lines changed

platforms/Linux/amazonlinux/2/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ LABEL PURPOSE="This image is configured to build Swift for the version of Amazon
1212
RUN yum -y update
1313

1414
# RPM and yum development tools
15-
RUN yum install -y rpmdevtools yum-utils
15+
RUN yum install -y rpmdevtools yum-utils createrepo
1616

1717
# Configure epel
1818
RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

platforms/Linux/amazonlinux/2/docker-compose.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ services:
3838
<<: *common
3939
command: /bin/bash -cl "./build_rpm.sh"
4040

41+
createrepo:
42+
<<: *common
43+
command: /bin/bash -cl "../shared/createrepo_rpm.sh"
44+
4145
shell:
4246
<<: *common
4347
entrypoint: /bin/bash -l

platforms/Linux/centos/7/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ LABEL PURPOSE="This image is configured to build Swift for the version of CentOS
1212
RUN yum -y update
1313

1414
# RPM and yum development tools
15-
RUN yum install -y rpmdevtools yum-utils
15+
RUN yum install -y rpmdevtools yum-utils createrepo
1616

1717
# Configure epel
1818
RUN yum install -y epel-release centos-release-scl

platforms/Linux/centos/7/docker-compose.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ services:
4141
<<: *common
4242
command: /bin/bash -cl "./build_rpm.sh"
4343

44+
createrepo:
45+
<<: *common
46+
command: /bin/bash -cl "../shared/createrepo_rpm.sh"
47+
4448
shell:
4549
<<: *common
4650
entrypoint: /bin/bash -l

platforms/Linux/centos/8/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ LABEL PURPOSE="This image is configured to build Swift for the version of CentOS
1212
RUN yum -y update
1313

1414
# RPM and yum development tools
15-
RUN yum install -y rpmdevtools yum-utils
15+
RUN yum install -y rpmdevtools yum-utils createrepo
1616

1717
# Configure epel and powertools
1818
RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

platforms/Linux/centos/8/docker-compose.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ services:
4141
<<: *common
4242
command: /bin/bash -cl "./build_rpm.sh"
4343

44+
createrepo:
45+
<<: *common
46+
command: /bin/bash -cl "../shared/createrepo_rpm.sh"
47+
4448
shell:
4549
<<: *common
4650
entrypoint: /bin/bash -l
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# This source file is part of the Swift.org open source project
2+
#
3+
# Copyright (c) 2021 Apple Inc. and the Swift project authors
4+
# Licensed under Apache License v2.0 with Runtime Library Exception
5+
#
6+
# See http://swift.org/LICENSE.txt for license information
7+
# See http://swift.org/CONTRIBUTORS.txt for Swift project authors
8+
9+
#!/usr/bin/env bash
10+
11+
set -eux
12+
13+
output_dir=/output
14+
if [[ ! -d "$output_dir" ]]; then
15+
echo "$output_dir does not exist, so no place to copy the artifacts!"
16+
exit 1
17+
fi
18+
19+
# always make sure we're up to date
20+
yum update -y
21+
22+
# prepare direcoties
23+
mkdir -p "$HOME/createrepo"
24+
25+
# Copy rpm file
26+
cp "$output_dir"/*.rpm "$HOME/createrepo/"
27+
28+
# Create the repodata
29+
createrepo "$HOME/createrepo/" 2>&1 | tee "$HOME/createrepo-output.txt"
30+
31+
32+
# Include the createrepo log which can be used to determine what went
33+
# wrong if there are no artifacts
34+
cp "$HOME/createrepo-output.txt" "$output_dir"
35+
cp -r "$HOME/createrepo/repodata" "$output_dir/repodata"

0 commit comments

Comments
 (0)