mirror of
https://github.com/actions/runner-images.git
synced 2025-12-11 03:27:05 +00:00
[Ubuntu] Remove apt sources for Postgresql, Mongodb, Heroku (#3091)
This commit is contained in:
committed by
GitHub
parent
1a3945d52c
commit
f29cc02bef
@@ -1,11 +1,13 @@
|
||||
function Get-PostgreSqlVersion {
|
||||
$postgreSQLVersion = psql --version | Take-OutputPart -Part 2
|
||||
return "Postgre SQL $postgreSQLVersion"
|
||||
$aptSourceRepo = Get-AptSourceRepository -PackageName "postgresql"
|
||||
return "Postgre SQL $postgreSQLVersion (apt source repository: $aptSourceRepo)"
|
||||
}
|
||||
|
||||
function Get-MongoDbVersion {
|
||||
$mongoDBVersion = mongod --version | Select-Object -First 1 | Take-OutputPart -Part 2 -Delimiter "v"
|
||||
return "MongoDB $mongoDBVersion"
|
||||
$aptSourceRepo = Get-AptSourceRepository -PackageName "mongodb"
|
||||
return "MongoDB $mongoDBVersion (apt source repository: $aptSourceRepo)"
|
||||
}
|
||||
|
||||
function Get-SqliteVersion {
|
||||
|
||||
@@ -103,3 +103,10 @@ function Get-CachedToolInstances
|
||||
return $toolInstances
|
||||
}
|
||||
|
||||
function Get-AptSourceRepository {
|
||||
param([String] $PackageName)
|
||||
|
||||
$sourceUrl = Get-Content "$PSScriptRoot/../helpers/apt-sources.txt" | Select-String -Pattern $PackageName | Take-OutputPart -Part 1
|
||||
return $sourceUrl
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
################################################################################
|
||||
|
||||
# Install Heroku CLI
|
||||
curl https://cli-assets.heroku.com/install-ubuntu.sh | sh
|
||||
curl https://cli-assets.heroku.com/install.sh | sh
|
||||
|
||||
invoke_tests "Tools" "Heroku"
|
||||
@@ -7,11 +7,17 @@
|
||||
# Source the helpers
|
||||
source $HELPER_SCRIPTS/os.sh
|
||||
|
||||
REPO_URL="https://repo.mongodb.org/apt/ubuntu"
|
||||
|
||||
# Install Mongo DB
|
||||
wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -
|
||||
version=$(getOSVersionLabel)
|
||||
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu $version/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
|
||||
echo "deb [ arch=amd64,arm64 ] $REPO_URL $version/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y mongodb-org
|
||||
|
||||
rm /etc/apt/sources.list.d/mongodb-org-4.4.list
|
||||
|
||||
echo "mongodb $REPO_URL" >> $HELPER_SCRIPTS/apt-sources.txt
|
||||
|
||||
invoke_tests "Databases" "MongoDB"
|
||||
|
||||
@@ -4,9 +4,11 @@
|
||||
## Desc: Installs Postgresql
|
||||
################################################################################
|
||||
|
||||
REPO_URL="https://apt.postgresql.org/pub/repos/apt/"
|
||||
|
||||
#Preparing repo for PostgreSQL 12.
|
||||
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
|
||||
echo "deb https://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list
|
||||
echo "deb $REPO_URL `lsb_release -cs`-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list
|
||||
|
||||
echo "Install PostgreSQL"
|
||||
apt update
|
||||
@@ -19,4 +21,8 @@ apt-get install libpq-dev
|
||||
systemctl is-active --quiet postgresql.service && systemctl stop postgresql.service
|
||||
systemctl disable postgresql.service
|
||||
|
||||
rm /etc/apt/sources.list.d/pgdg.list
|
||||
|
||||
echo "postgresql $REPO_URL" >> $HELPER_SCRIPTS/apt-sources.txt
|
||||
|
||||
invoke_tests "Databases" "PostgreSQL"
|
||||
|
||||
Reference in New Issue
Block a user