mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-14 13:56:47 +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 {
|
function Get-PostgreSqlVersion {
|
||||||
$postgreSQLVersion = psql --version | Take-OutputPart -Part 2
|
$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 {
|
function Get-MongoDbVersion {
|
||||||
$mongoDBVersion = mongod --version | Select-Object -First 1 | Take-OutputPart -Part 2 -Delimiter "v"
|
$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 {
|
function Get-SqliteVersion {
|
||||||
|
|||||||
@@ -103,3 +103,10 @@ function Get-CachedToolInstances
|
|||||||
return $toolInstances
|
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
|
# 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"
|
invoke_tests "Tools" "Heroku"
|
||||||
@@ -7,11 +7,17 @@
|
|||||||
# Source the helpers
|
# Source the helpers
|
||||||
source $HELPER_SCRIPTS/os.sh
|
source $HELPER_SCRIPTS/os.sh
|
||||||
|
|
||||||
|
REPO_URL="https://repo.mongodb.org/apt/ubuntu"
|
||||||
|
|
||||||
# Install Mongo DB
|
# Install Mongo DB
|
||||||
wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -
|
wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -
|
||||||
version=$(getOSVersionLabel)
|
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 update
|
||||||
sudo apt-get install -y mongodb-org
|
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"
|
invoke_tests "Databases" "MongoDB"
|
||||||
|
|||||||
@@ -4,9 +4,11 @@
|
|||||||
## Desc: Installs Postgresql
|
## Desc: Installs Postgresql
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
REPO_URL="https://apt.postgresql.org/pub/repos/apt/"
|
||||||
|
|
||||||
#Preparing repo for PostgreSQL 12.
|
#Preparing repo for PostgreSQL 12.
|
||||||
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
|
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"
|
echo "Install PostgreSQL"
|
||||||
apt update
|
apt update
|
||||||
@@ -19,4 +21,8 @@ apt-get install libpq-dev
|
|||||||
systemctl is-active --quiet postgresql.service && systemctl stop postgresql.service
|
systemctl is-active --quiet postgresql.service && systemctl stop postgresql.service
|
||||||
systemctl disable 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"
|
invoke_tests "Databases" "PostgreSQL"
|
||||||
|
|||||||
Reference in New Issue
Block a user