File: release_rpm.sh

package info (click to toggle)
sysdig 0.35.0%2Brepack-1.1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,600 kB
  • sloc: cpp: 11,020; sh: 1,313; ansic: 999; makefile: 12
file content (28 lines) | stat: -rwxr-xr-x 1,239 bytes parent folder | download | duplicates (3)
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
#!/bin/bash

set -euxo pipefail

# required env variables
echo "REPOSITORY_DIR: $REPOSITORY_DIR" # root repo directory on the local filesystem
echo "RPM_BASEARCH: $RPM_BASEARCH"
echo "REPOSITORY_NAME: $REPOSITORY_NAME"
echo "PACKAGES_DIR: $PACKAGES_DIR"
echo "SCRIPTS_DIR: $SCRIPTS_DIR"
echo "S3_BUCKET: $S3_BUCKET"

mkdir -p $REPOSITORY_DIR/rpm/$RPM_BASEARCH

aws s3 sync s3://$S3_BUCKET/$REPOSITORY_NAME/rpm/$RPM_BASEARCH/ $REPOSITORY_DIR/rpm/$RPM_BASEARCH/ --exact-timestamps --acl public-read # --delete
# ls -1tdr $REPOSITORY_DIR/rpm/$RPM_BASEARCH/*sysdig*.rpm | head -n -5 | xargs -d '\n' rm -f || true

cp $PACKAGES_DIR/*rpm $REPOSITORY_DIR/rpm/$RPM_BASEARCH
createrepo_c $REPOSITORY_DIR/rpm/$RPM_BASEARCH

# create repomd.xml.asc
gpg --local-user $KEY_ID --batch --no-tty --yes --detach-sign --armor $REPOSITORY_DIR/rpm/$RPM_BASEARCH/repodata/repomd.xml

cp $SCRIPTS_DIR/draios.repo $REPOSITORY_DIR/rpm
sed -i s/_REPOSITORY_/$REPOSITORY_NAME/g $REPOSITORY_DIR/rpm/draios.repo

aws s3 cp $REPOSITORY_DIR/rpm/draios.repo s3://$S3_BUCKET/$REPOSITORY_NAME/rpm/ --acl public-read # --delete
aws s3 sync $REPOSITORY_DIR/rpm/$RPM_BASEARCH/ s3://$S3_BUCKET/$REPOSITORY_NAME/rpm/$RPM_BASEARCH/ --exact-timestamps --acl public-read --delete