Skip to content

Commit 32da104

Browse files
authored
Use chromium instead of a manual chrome download (#178)
* Update chrome.json * use array * use `chromium-browser` on focal and jammy * fix redhat and centos * schema * schema * use version * epel-release for redhat and rocky * Update chrome.json * update pre-install * schema * Update chrome.json * add 24.04 * use `ppa:xtradeb/apps` for jammy & noble * schema
1 parent e57f546 commit 32da104

File tree

1 file changed

+84
-41
lines changed

1 file changed

+84
-41
lines changed

rules/chrome.json

Lines changed: 84 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,133 @@
11
{
2-
"patterns": [
3-
"\\bchrome\\b"
4-
],
2+
"patterns": ["\\bchrome\\b", "\\bchromium\\b"],
53
"dependencies": [
64
{
75
"pre_install": [
8-
{ "command": "[ $(which google-chrome) ] || apt-get install -y gnupg curl" },
9-
{ "command": "[ $(which google-chrome) ] || curl -fsSL -o /tmp/google-chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb" },
10-
{ "command": "[ $(which google-chrome) ] || DEBIAN_FRONTEND='noninteractive' apt-get install -y /tmp/google-chrome.deb" }
11-
],
12-
"packages": [],
13-
"post_install": [
14-
{ "command": "rm -f /tmp/google-chrome.deb" }
6+
{ "command": "apt-get install -y software-properties-common" },
7+
{ "command": "add-apt-repository -y ppa:xtradeb/apps" },
8+
{ "command": "apt-get update" }
159
],
10+
"packages": ["chromium"],
11+
"post_install": [],
1612
"constraints": [
1713
{
1814
"os": "linux",
19-
"distribution": "ubuntu"
20-
},
21-
{
22-
"os": "linux",
23-
"distribution": "debian"
15+
"distribution": "ubuntu",
16+
"versions": ["22.04", "24.04"]
2417
}
2518
]
2619
},
2720
{
2821
"pre_install": [
29-
{ "command": "yum install -y which" },
30-
{ "command": "[ $(which google-chrome) ] || curl -fsSL -o /tmp/google-chrome.rpm https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm" },
31-
{ "command": "[ $(which google-chrome) ] || yum install -y /tmp/google-chrome.rpm" }
22+
{
23+
"command": "[ $(which google-chrome) ] || apt-get install -y gnupg curl"
24+
},
25+
{
26+
"command": "[ $(which google-chrome) ] || curl -fsSL -o /tmp/google-chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb"
27+
},
28+
{
29+
"command": "[ $(which google-chrome) ] || DEBIAN_FRONTEND='noninteractive' apt-get install -y /tmp/google-chrome.deb"
30+
}
3231
],
3332
"packages": [],
34-
"post_install": [
35-
{ "command": "rm -f /tmp/google-chrome.rpm" }
36-
],
33+
"post_install": [{ "command": "rm -f /tmp/google-chrome.deb" }],
3734
"constraints": [
3835
{
3936
"os": "linux",
40-
"distribution": "centos",
41-
"versions": ["8"]
42-
},
37+
"distribution": "ubuntu",
38+
"versions": ["20.04"]
39+
}
40+
]
41+
},
42+
{
43+
"pre_install": [
44+
{ "command": "dnf install -y dnf-plugins-core" },
45+
{ "command": "dnf config-manager --set-enabled crb" },
46+
{ "command": "dnf install -y epel-release" }
47+
],
48+
"packages": ["chromium"],
49+
"post_install": [],
50+
"constraints": [
4351
{
4452
"os": "linux",
4553
"distribution": "rockylinux"
54+
}
55+
]
56+
},
57+
{
58+
"pre_install": [
59+
{
60+
"command": "subscription-manager repos --enable codeready-builder-for-rhel-8-$(arch)-rpms"
4661
},
62+
{
63+
"command": "dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm"
64+
}
65+
],
66+
"packages": ["chromium"],
67+
"post_install": [],
68+
"constraints": [
4769
{
4870
"os": "linux",
4971
"distribution": "redhat",
5072
"versions": ["8"]
73+
}
74+
]
75+
},
76+
{
77+
"pre_install": [
78+
{
79+
"command": "subscription-manager repos --enable codeready-builder-for-rhel-9-$(arch)-rpms"
5180
},
81+
{
82+
"command": "dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm"
83+
}
84+
],
85+
"packages": ["chromium"],
86+
"post_install": [],
87+
"constraints": [
5288
{
5389
"os": "linux",
54-
"distribution": "fedora",
55-
"versions": [ "36", "37" ]
90+
"distribution": "redhat",
91+
"versions": ["9"]
5692
}
5793
]
5894
},
5995
{
60-
"pre_install": [
61-
{ "command": "yum install -y which" },
62-
{ "command": "[ $(which google-chrome) ] || curl -fsSL -o /tmp/google-chrome.rpm https://dl.google.com/linux/chrome/rpm/stable/x86_64/google-chrome-stable-125.0.6422.141-1.x86_64.rpm" },
63-
{ "command": "[ $(which google-chrome) ] || yum install -y /tmp/google-chrome.rpm" }
64-
],
65-
"packages": [],
66-
"post_install": [
67-
{ "command": "rm -f /tmp/google-chrome.rpm" }
68-
],
96+
"pre_install": [],
97+
"packages": ["chromium"],
98+
"post_install": [],
6999
"constraints": [
70100
{
71101
"os": "linux",
72-
"distribution": "centos",
73-
"versions": ["7"]
102+
"distribution": "debian"
74103
},
75104
{
76105
"os": "linux",
77-
"distribution": "redhat",
78-
"versions": ["7"]
106+
"distribution": "fedora"
107+
},
108+
{
109+
"os": "linux",
110+
"distribution": "alpine"
79111
}
80112
]
81113
},
82114
{
83-
"packages": ["chromium"],
115+
"pre_install": [
116+
{ "command": "yum install -y which" },
117+
{
118+
"command": "[ $(which google-chrome) ] || curl -fsSL -o /tmp/google-chrome.rpm https://dl.google.com/linux/chrome/rpm/stable/x86_64/google-chrome-stable-125.0.6422.141-1.x86_64.rpm"
119+
},
120+
{
121+
"command": "[ $(which google-chrome) ] || yum install -y /tmp/google-chrome.rpm"
122+
}
123+
],
124+
"packages": [],
125+
"post_install": [{ "command": "rm -f /tmp/google-chrome.rpm" }],
84126
"constraints": [
85127
{
86128
"os": "linux",
87-
"distribution": "alpine"
129+
"distribution": "centos",
130+
"versions": ["7", "8"]
88131
}
89132
]
90133
}

0 commit comments

Comments
 (0)