-
Notifications
You must be signed in to change notification settings - Fork 26
/
branch-foreman
executable file
·32 lines (21 loc) · 1.34 KB
/
branch-foreman
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
#!/bin/bash
FOREMAN_VERSION=$1
KATELLO_VERSION=$2
if [[ -z $FOREMAN_VERSION ]] || [[ -z $KATELLO_VERSION ]] ; then
echo "Usage: $0 FOREMAN_VERSION KATELLO_VERSION"
exit 1
fi
sed "/foreman_version/ s/nightly/${FOREMAN_VERSION}/ ; /git_branch/ s/develop/\${foreman_version}-stable/" \
theforeman.org/pipelines/vars/foreman/nightly.groovy > theforeman.org/pipelines/vars/foreman/${FOREMAN_VERSION}.groovy
sed -e "/foreman_version/ s/nightly/${FOREMAN_VERSION}/" \
-e "/katello_version/ s/nightly/${KATELLO_VERSION}/" \
theforeman.org/pipelines/vars/katello/nightly.groovy > theforeman.org/pipelines/vars/katello/$KATELLO_VERSION.groovy
sed -i "/nightly/i \ \ \ \ \ \ - '${FOREMAN_VERSION}'" centos.org/jobs/foreman-pipelines.yml
sed -i "/nightly/i \ \ \ \ \ \ - '${KATELLO_VERSION}'" centos.org/jobs/katello-pipelines.yml
echo "- '${FOREMAN_VERSION}'" >> theforeman.org/yaml/includes/foreman_versions.yaml.inc
echo "- '${FOREMAN_VERSION}'" >> theforeman.org/yaml/includes/foreman_versions_copr.yaml.inc
echo " - '${KATELLO_VERSION}'" >> theforeman.org/yaml/jobs/pipeline/katello-rpm-pipeline.yaml
# TODO This should be a templated pipeline
echo "Create theforeman.org/yaml/jobs/test_${FOREMAN_VERSION/./_}_stable.yaml"
# TODO This is a non-trivial addition to script
echo "Add ${FOREMAN_VERSION%*.} as a minor to theforeman.org/yaml/views/release.yml"