Browse Source

Update 'update-rebrandly-link' action (#12)

pull/13/head v1.0.0
Vince Grassia 4 years ago committed by GitHub
parent
commit
a4305ca7f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      .github/workflows/update-links.yml
  2. 11
      bitwarden.ps1
  3. 7
      bitwarden.sh

16
.github/workflows/update-links.yml

@ -37,33 +37,33 @@ jobs:
fi fi
- name: Update Bitwarden Script PowerShell Link - name: Update Bitwarden Script PowerShell Link
uses: bitwarden/gh-actions/update-rebrandly-link@664c8899c95490c65dac0df11519d24ed8419c85 uses: bitwarden/gh-actions/update-rebrandly-link@340a677ffb0c53e50ca67cd2c12044cd7f7fc725
with: with:
apikey: ${{ steps.retrieve-secrets.outputs.rebrandly-apikey }} apikey: ${{ steps.retrieve-secrets.outputs.rebrandly-apikey }}
domain: "go.btwrdn.co" domain: "go.btwrdn.co"
slashtag: "bw-ps" slashtag: "bw-ps"
destination: "https://github.org/bitwarden/self-host/releases/download/${{ steps.tag-name.outputs.value }}/bitwarden.ps1" destination: "https://github.com/bitwarden/self-host/releases/download/${{ steps.tag-name.outputs.value }}/bitwarden.ps1"
- name: Update Run Script PowerShell Link - name: Update Run Script PowerShell Link
uses: bitwarden/gh-actions/update-rebrandly-link@664c8899c95490c65dac0df11519d24ed8419c85 uses: bitwarden/gh-actions/update-rebrandly-link@340a677ffb0c53e50ca67cd2c12044cd7f7fc725
with: with:
apikey: ${{ steps.retrieve-secrets.outputs.rebrandly-apikey }} apikey: ${{ steps.retrieve-secrets.outputs.rebrandly-apikey }}
domain: "go.btwrdn.co" domain: "go.btwrdn.co"
slashtag: "bw-ps-run" slashtag: "bw-ps-run"
destination: "https://github.org/bitwarden/self-host/releases/download/${{ steps.tag-name.outputs.value }}/run.ps1" destination: "https://github.com/bitwarden/self-host/releases/download/${{ steps.tag-name.outputs.value }}/run.ps1"
- name: Update Bitwarden Script Shell Link - name: Update Bitwarden Script Shell Link
uses: bitwarden/gh-actions/update-rebrandly-link@664c8899c95490c65dac0df11519d24ed8419c85 uses: bitwarden/gh-actions/update-rebrandly-link@340a677ffb0c53e50ca67cd2c12044cd7f7fc725
with: with:
apikey: ${{ steps.retrieve-secrets.outputs.rebrandly-apikey }} apikey: ${{ steps.retrieve-secrets.outputs.rebrandly-apikey }}
domain: "go.btwrdn.co" domain: "go.btwrdn.co"
slashtag: "bw-sh" slashtag: "bw-sh"
destination: "https://github.org/bitwarden/self-host/releases/download/${{ steps.tag-name.outputs.value }}/bitwarden.sh" destination: "https://github.com/bitwarden/self-host/releases/download/${{ steps.tag-name.outputs.value }}/bitwarden.sh"
- name: Update Run Script Shell Link - name: Update Run Script Shell Link
uses: bitwarden/gh-actions/update-rebrandly-link@664c8899c95490c65dac0df11519d24ed8419c85 uses: bitwarden/gh-actions/update-rebrandly-link@340a677ffb0c53e50ca67cd2c12044cd7f7fc725
with: with:
apikey: ${{ steps.retrieve-secrets.outputs.rebrandly-apikey }} apikey: ${{ steps.retrieve-secrets.outputs.rebrandly-apikey }}
domain: "go.btwrdn.co" domain: "go.btwrdn.co"
slashtag: "bw-sh-run" slashtag: "bw-sh-run"
destination: "https://github.org/bitwarden/self-host/releases/download/${{ steps.tag-name.outputs.value }}/run.sh" destination: "https://github.com/bitwarden/self-host/releases/download/${{ steps.tag-name.outputs.value }}/run.sh"

11
bitwarden.ps1

@ -24,7 +24,8 @@ if ($output -eq "") {
} }
$scriptsDir = "${output}\scripts" $scriptsDir = "${output}\scripts"
$githubBaseUrl = "https://raw.githubusercontent.com/bitwarden/server/master" $bitwardenScriptUrl = "https://go.btwrdn.co/bw-ps"
$runScriptUrl = "https://go.btwrdn.co/bw-ps-run"
# Please do not create pull requests modifying the version numbers. # Please do not create pull requests modifying the version numbers.
$coreVersion = "1.46.2" $coreVersion = "1.46.2"
@ -34,14 +35,14 @@ $keyConnectorVersion = "1.0.1"
# Functions # Functions
function Get-Self { function Get-Self {
Invoke-RestMethod -OutFile $scriptPath -Uri "${githubBaseUrl}/scripts/bitwarden.ps1" Invoke-RestMethod -OutFile $scriptPath -Uri $bitwardenScriptUrl
} }
function Get-Run-File { function Get-Run-File {
if (!(Test-Path -Path $scriptsDir)) { if (!(Test-Path -Path $scriptsDir)) {
New-Item -ItemType directory -Path $scriptsDir | Out-Null New-Item -ItemType directory -Path $scriptsDir | Out-Null
} }
Invoke-RestMethod -OutFile $scriptsDir\run.ps1 -Uri "${githubBaseUrl}/scripts/run.ps1" Invoke-RestMethod -OutFile $scriptsDir\run.ps1 -Uri $runScriptUrl
} }
function Test-Output-Dir-Exists { function Test-Output-Dir-Exists {
@ -79,7 +80,7 @@ See more at https://bitwarden.com/help/article/install-on-premise/#script-comman
} }
function Write-Line($str) { function Write-Line($str) {
if($env:BITWARDEN_QUIET -ne "true") { if ($env:BITWARDEN_QUIET -ne "true") {
Write-Host $str Write-Host $str
} }
} }
@ -104,7 +105,7 @@ https://bitwarden.com, https://github.com/bitwarden
=================================================== ===================================================
" "
if($env:BITWARDEN_QUIET -ne "true") { if ($env:BITWARDEN_QUIET -ne "true") {
Write-Line "bitwarden.ps1 version ${coreVersion}" Write-Line "bitwarden.ps1 version ${coreVersion}"
docker --version docker --version
docker-compose --version docker-compose --version

7
bitwarden.sh

@ -37,7 +37,8 @@ else
fi fi
SCRIPTS_DIR="$OUTPUT/scripts" SCRIPTS_DIR="$OUTPUT/scripts"
GITHUB_BASE_URL="https://raw.githubusercontent.com/bitwarden/server/master" BITWARDEN_SCRIPT_URL="https://go.btwrdn.co/bw-sh"
RUN_SCRIPT_URL="https://go.btwrdn.co/bw-sh-run"
# Please do not create pull requests modifying the version numbers. # Please do not create pull requests modifying the version numbers.
COREVERSION="1.46.2" COREVERSION="1.46.2"
@ -57,7 +58,7 @@ echo ""
# Functions # Functions
function downloadSelf() { function downloadSelf() {
if curl -s -w "http_code %{http_code}" -o $SCRIPT_PATH.1 $GITHUB_BASE_URL/scripts/bitwarden.sh | grep -q "^http_code 20[0-9]" if curl -L -s -w "http_code %{http_code}" -o $SCRIPT_PATH.1 $BITWARDEN_SCRIPT_URL | grep -q "^http_code 20[0-9]"
then then
mv $SCRIPT_PATH.1 $SCRIPT_PATH mv $SCRIPT_PATH.1 $SCRIPT_PATH
chmod u+x $SCRIPT_PATH chmod u+x $SCRIPT_PATH
@ -71,7 +72,7 @@ function downloadRunFile() {
then then
mkdir $SCRIPTS_DIR mkdir $SCRIPTS_DIR
fi fi
curl -s -o $SCRIPTS_DIR/run.sh $GITHUB_BASE_URL/scripts/run.sh curl -L -s -o $SCRIPTS_DIR/run.sh $RUN_SCRIPT_URL
chmod u+x $SCRIPTS_DIR/run.sh chmod u+x $SCRIPTS_DIR/run.sh
rm -f $SCRIPTS_DIR/install.sh rm -f $SCRIPTS_DIR/install.sh
} }

Loading…
Cancel
Save