Skip to content

Commit a1960ad

Browse files
committed
Refactor the upgrade workflow to abstract the handling of dependencies upgrade
Refactor the upgrade workflow to abstract the handling of dependencies upgrade specific to distro and st2 version. Each distro will have a separate upgrade script. The script itself will contain the commands for handling the dependency upgrade if needed.
1 parent a2cb4df commit a1960ad

13 files changed

+255
-6
lines changed

actions/st2_pkg_upgrade_deb.meta.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@ parameters:
1818
type: string
1919
default: ''
2020
description: "Version to upgrade to"
21+
distro:
22+
type: string
23+
required: true
24+
enum:
25+
- UBUNTU14
26+
- UBUNTU16
27+
enterprise:
28+
type: boolean
29+
default: false
2130
workflow:
2231
default: st2ci.st2_pkg_upgrade_deb.main
2332
immutable: true
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
name: st2_pkg_upgrade_deps_el6
3+
pack: st2ci
4+
description: Upgrade dependencies on el6
5+
enabled: true
6+
runner_type: remote-shell-script
7+
entry_point: st2_pkg_upgrade_deps_el6.sh
8+
parameters:
9+
version:
10+
type: string
11+
default: ''
12+
description: Version to upgrade to
13+
position: 0
14+
enterprise:
15+
type: boolean
16+
default: false
17+
position: 1
18+
dir:
19+
immutable: true
20+
default: /home/stanley/
21+
sudo:
22+
immutable: true
23+
default: false
24+
cmd:
25+
immutable: true
26+
default: ""
27+
kwarg_op:
28+
immutable: true
29+
default: "--"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
set -e
3+
4+
VERSION=$1
5+
ENTERPRISE=$2
6+
SHORT_VERSION=`echo ${VERSION} | cut -d "." -f1-2`
7+
8+
if [ ${SHORT_VERSION} = "2.4" ] && [ ${ENTERPRISE} -eq 0 ]; then
9+
echo "Upgrading dependencies for 2.4 community"
10+
curl -sL https://rpm.nodesource.com/setup_6.x | sudo -E bash -
11+
sudo yum clean all
12+
sudo yum update -y nodejs
13+
exit 0
14+
fi
15+
16+
if [ ${SHORT_VERSION} = "2.4" ] && [ ${ENTERPRISE} -eq 1 ]; then
17+
echo "Upgrading dependencies for 2.4 enterprise"
18+
sudo /opt/stackstorm/st2/bin/pip install \
19+
--find-links /opt/stackstorm/share/wheels --no-index --quiet \
20+
--upgrade st2-enterprise-auth-backend-ldap
21+
exit 0
22+
fi
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
name: st2_pkg_upgrade_deps_el7
3+
pack: st2ci
4+
description: Upgrade dependencies on el7
5+
enabled: true
6+
runner_type: remote-shell-script
7+
entry_point: st2_pkg_upgrade_deps_el7.sh
8+
parameters:
9+
version:
10+
type: string
11+
default: ''
12+
description: Version to upgrade to
13+
position: 0
14+
enterprise:
15+
type: boolean
16+
default: false
17+
position: 1
18+
dir:
19+
immutable: true
20+
default: /home/stanley/
21+
sudo:
22+
immutable: true
23+
default: false
24+
cmd:
25+
immutable: true
26+
default: ""
27+
kwarg_op:
28+
immutable: true
29+
default: "--"
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
set -e
3+
4+
VERSION=$1
5+
ENTERPRISE=$2
6+
SHORT_VERSION=`echo ${VERSION} | cut -d "." -f1-2`
7+
8+
if [ ${SHORT_VERSION} = "2.4" ] && [ ${ENTERPRISE} -eq 0 ]; then
9+
echo "Upgrading dependencies for 2.4 community"
10+
curl -sL https://rpm.nodesource.com/setup_6.x | sudo -E bash -
11+
sudo yum clean all
12+
sudo rpm -e --nodeps npm
13+
sudo yum update -y nodejs
14+
exit 0
15+
fi
16+
17+
if [ ${SHORT_VERSION} = "2.4" ] && [ ${ENTERPRISE} -eq 1 ]; then
18+
echo "Upgrading dependencies for 2.4 enterprise"
19+
sudo /opt/stackstorm/st2/bin/pip install \
20+
--find-links /opt/stackstorm/share/wheels --no-index --quiet \
21+
--upgrade st2-enterprise-auth-backend-ldap
22+
exit 0
23+
fi
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
name: st2_pkg_upgrade_deps_u14
3+
pack: st2ci
4+
description: Upgrade dependencies on u14
5+
enabled: true
6+
runner_type: remote-shell-script
7+
entry_point: st2_pkg_upgrade_deps_u14.sh
8+
parameters:
9+
version:
10+
type: string
11+
default: ''
12+
description: Version to upgrade to
13+
position: 0
14+
enterprise:
15+
type: boolean
16+
default: false
17+
position: 1
18+
dir:
19+
immutable: true
20+
default: /home/stanley/
21+
sudo:
22+
immutable: true
23+
default: false
24+
cmd:
25+
immutable: true
26+
default: ""
27+
kwarg_op:
28+
immutable: true
29+
default: "--"
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
set -e
3+
4+
VERSION=$1
5+
ENTERPRISE=$2
6+
SHORT_VERSION=`echo ${VERSION} | cut -d "." -f1-2`
7+
8+
if [ ${SHORT_VERSION} = "2.4" ] && [ ${ENTERPRISE} -eq 0 ]; then
9+
echo "Upgrading dependencies for 2.4 community"
10+
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
11+
exit 0
12+
fi
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
name: st2_pkg_upgrade_deps_u16
3+
pack: st2ci
4+
description: Upgrade dependencies on u16
5+
enabled: true
6+
runner_type: remote-shell-script
7+
entry_point: st2_pkg_upgrade_deps_u16.sh
8+
parameters:
9+
version:
10+
type: string
11+
default: ''
12+
description: Version to upgrade to
13+
position: 0
14+
enterprise:
15+
type: boolean
16+
default: false
17+
position: 1
18+
dir:
19+
immutable: true
20+
default: /home/stanley/
21+
sudo:
22+
immutable: true
23+
default: false
24+
cmd:
25+
immutable: true
26+
default: ""
27+
kwarg_op:
28+
immutable: true
29+
default: "--"
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
set -e
3+
4+
VERSION=$1
5+
ENTERPRISE=$2
6+
SHORT_VERSION=`echo ${VERSION} | cut -d "." -f1-2`
7+
8+
if [ ${SHORT_VERSION} = "2.4" ] && [ ${ENTERPRISE} -eq 0 ]; then
9+
echo "Upgrading dependencies for 2.4 community"
10+
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
11+
exit 0
12+
fi

actions/st2_pkg_upgrade_rpm.meta.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@ parameters:
1818
type: string
1919
default: ''
2020
description: "Version to upgrade to"
21+
distro:
22+
type: string
23+
required: true
24+
enum:
25+
- CENTOS6
26+
- CENTOS7
27+
- RHEL6
28+
- RHEL7
29+
enterprise:
30+
type: boolean
31+
default: false
2132
workflow:
2233
default: st2ci.st2_pkg_upgrade_rpm.main
2334
immutable: true

0 commit comments

Comments
 (0)