necessary renaming and deployment prevention

This commit is contained in:
ryanfkeepers 2024-02-07 12:22:07 -07:00
parent 8081ae7349
commit ef6ca8583a
20 changed files with 134 additions and 98 deletions

View File

@ -59,7 +59,7 @@ runs:
CATEGORY_SUFFIX="" CATEGORY_SUFFIX=""
[[ -n "${{ inputs.category }}" ]] && CATEGORY_SUFFIX="-${{ inputs.category }}" [[ -n "${{ inputs.category }}" ]] && CATEGORY_SUFFIX="-${{ inputs.category }}"
CORSO_LOG_FILE=${{ inputs.log-dir }}/gotest-${{ inputs.service }}${CATEGORY_SUFFIX}-backup-${{inputs.kind }}.log CORSO_LOG_FILE=${{ inputs.log-dir }}/gotest-${{ inputs.service }}${CATEGORY_SUFFIX}-backup-${{inputs.kind }}.log
./corso backup create '${{ inputs.service }}' \ ./canario backup create '${{ inputs.service }}' \
--no-stats --hide-progress --json \ --no-stats --hide-progress --json \
${{ inputs.backup-args }} | ${{ inputs.backup-args }} |
tee /dev/stderr | # for printing logs tee /dev/stderr | # for printing logs
@ -80,7 +80,7 @@ runs:
CATEGORY_SUFFIX="" CATEGORY_SUFFIX=""
[[ -n "${{ inputs.category }}" ]] && CATEGORY_SUFFIX="-${{ inputs.category }}" [[ -n "${{ inputs.category }}" ]] && CATEGORY_SUFFIX="-${{ inputs.category }}"
CORSO_LOG_FILE=${{ inputs.log-dir }}/gotest-${{ inputs.service }}${CATEGORY_SUFFIX}-restore-${{inputs.kind }}.log CORSO_LOG_FILE=${{ inputs.log-dir }}/gotest-${{ inputs.service }}${CATEGORY_SUFFIX}-restore-${{inputs.kind }}.log
./corso restore '${{ inputs.service }}' \ ./canario restore '${{ inputs.service }}' \
--no-stats \ --no-stats \
--hide-progress \ --hide-progress \
--collisions ${{ inputs.on-collision }} \ --collisions ${{ inputs.on-collision }} \
@ -128,7 +128,7 @@ runs:
CATEGORY_SUFFIX="" CATEGORY_SUFFIX=""
[[ -n "${{ inputs.category }}" ]] && CATEGORY_SUFFIX="-${{ inputs.category }}" [[ -n "${{ inputs.category }}" ]] && CATEGORY_SUFFIX="-${{ inputs.category }}"
CORSO_LOG_FILE=${{ inputs.log-dir }}/gotest-${{ inputs.service }}${CATEGORY_SUFFIX}-restore-${{inputs.kind }}.log CORSO_LOG_FILE=${{ inputs.log-dir }}/gotest-${{ inputs.service }}${CATEGORY_SUFFIX}-restore-${{inputs.kind }}.log
./corso export '${{ inputs.service }}' \ ./canario export '${{ inputs.service }}' \
/tmp/export-${{ inputs.service }}${CATEGORY_SUFFIX}-${{inputs.kind }} \ /tmp/export-${{ inputs.service }}${CATEGORY_SUFFIX}-${{inputs.kind }} \
--no-stats \ --no-stats \
--hide-progress \ --hide-progress \
@ -170,7 +170,7 @@ runs:
CATEGORY_SUFFIX="" CATEGORY_SUFFIX=""
[[ -n "${{ inputs.category }}" ]] && CATEGORY_SUFFIX="-${{ inputs.category }}" [[ -n "${{ inputs.category }}" ]] && CATEGORY_SUFFIX="-${{ inputs.category }}"
CORSO_LOG_FILE=${{ inputs.log-dir }}/gotest-${{ inputs.service }}${CATEGORY_SUFFIX}-restore-${{inputs.kind }}.log CORSO_LOG_FILE=${{ inputs.log-dir }}/gotest-${{ inputs.service }}${CATEGORY_SUFFIX}-restore-${{inputs.kind }}.log
./corso export '${{ inputs.service }}' \ ./canario export '${{ inputs.service }}' \
/tmp/export-${{ inputs.service }}${CATEGORY_SUFFIX}-${{inputs.kind }}-archive \ /tmp/export-${{ inputs.service }}${CATEGORY_SUFFIX}-${{inputs.kind }}-archive \
--no-stats \ --no-stats \
--hide-progress \ --hide-progress \
@ -213,7 +213,7 @@ runs:
CATEGORY_SUFFIX="" CATEGORY_SUFFIX=""
[[ -n "${{ inputs.category }}" ]] && CATEGORY_SUFFIX="-${{ inputs.category }}" [[ -n "${{ inputs.category }}" ]] && CATEGORY_SUFFIX="-${{ inputs.category }}"
CORSO_LOG_FILE=${{ inputs.log-dir }}/gotest-backup-${{ inputs.service }}${CATEGORY_SUFFIX}-list-${{inputs.kind }}.log CORSO_LOG_FILE=${{ inputs.log-dir }}/gotest-backup-${{ inputs.service }}${CATEGORY_SUFFIX}-list-${{inputs.kind }}.log
./corso backup list ${{ inputs.service }} \ ./canario backup list ${{ inputs.service }} \
--no-stats \ --no-stats \
--hide-progress \ --hide-progress \
2>&1 | 2>&1 |
@ -237,7 +237,7 @@ runs:
CATEGORY_SUFFIX="" CATEGORY_SUFFIX=""
[[ -n "${{ inputs.category }}" ]] && CATEGORY_SUFFIX="-${{ inputs.category }}" [[ -n "${{ inputs.category }}" ]] && CATEGORY_SUFFIX="-${{ inputs.category }}"
CORSO_LOG_FILE=${{ inputs.log-dir }}/gotest-backup-list-${{ inputs.service }}${CATEGORY_SUFFIX}-single-${{inputs.kind }}.log CORSO_LOG_FILE=${{ inputs.log-dir }}/gotest-backup-list-${{ inputs.service }}${CATEGORY_SUFFIX}-single-${{inputs.kind }}.log
./corso backup list ${{ inputs.service }} \ ./canario backup list ${{ inputs.service }} \
--no-stats \ --no-stats \
--hide-progress \ --hide-progress \
--backup "${{ steps.backup.outputs.result }}" \ --backup "${{ steps.backup.outputs.result }}" \

View File

@ -1,5 +1,14 @@
name: Publish Binary name: Publish Binary
###################################
# notice:
# This file has undergone major
# renaming for the canario fork.
# In case of re-incorporation back
# to corso, this refactoring will
# need to be undone.
###################################
inputs: inputs:
version: version:
description: Corso version to use for publishing description: Corso version to use for publishing
@ -40,36 +49,36 @@ runs:
workdir: src workdir: src
env: env:
GITHUB_TOKEN: ${{ inputs.github_token }} GITHUB_TOKEN: ${{ inputs.github_token }}
RUDDERSTACK_CORSO_WRITE_KEY: ${{ inputs.rudderstack_write_key }} RUDDERSTACK_CANARIO_WRITE_KEY: ${{ inputs.rudderstack_write_key }}
RUDDERSTACK_CORSO_DATA_PLANE_URL: ${{ inputs.rudderstack_data_plane_url }} RUDDERSTACK_CANARIO_DATA_PLANE_URL: ${{ inputs.rudderstack_data_plane_url }}
CORSO_VERSION: ${{ inputs.version }} CANARIO_VERSION: ${{ inputs.version }}
- name: Upload darwin arm64 - name: Upload darwin arm64
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: corso_Darwin_arm64 name: canario_Darwin_arm64
path: src/dist/corso_darwin_arm64/corso path: src/dist/canario_darwin_arm64/canario
- name: Upload linux arm64 - name: Upload linux arm64
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: corso_Linux_arm64 name: canario_Linux_arm64
path: src/dist/corso_linux_arm64/corso path: src/dist/canario_linux_arm64/canario
- name: Upload darwin amd64 - name: Upload darwin amd64
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: corso_Darwin_amd64 name: canario_Darwin_amd64
path: src/dist/corso_darwin_amd64_v1/corso path: src/dist/canario_darwin_amd64_v1/canario
- name: Upload linux amd64 - name: Upload linux amd64
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: corso_Linux_amd64 name: canario_Linux_amd64
path: src/dist/corso_linux_amd64_v1/corso path: src/dist/canario_linux_amd64_v1/canario
- name: Upload windows amd64 - name: Upload windows amd64
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: corso_Windows_amd64 name: canario_Windows_amd64
path: src/dist/corso_windows_amd64_v1/corso.exe path: src/dist/canario_windows_amd64_v1/canario.exe

View File

@ -29,6 +29,8 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Publish Binary - name: Publish Binary
# canario should never publish
if: false
uses: ./.github/actions/publish-binary uses: ./.github/actions/publish-binary
with: with:
version: ${{ needs.SetEnv.outputs.version }} version: ${{ needs.SetEnv.outputs.version }}

View File

@ -1,6 +1,6 @@
name: Build/Release Corso name: Build/Release Corso
env: env:
IMAGE_NAME: ghcr.io/alcionai/corso IMAGE_NAME: ghcr.io/alcionai/canario
on: on:
workflow_dispatch: workflow_dispatch:
@ -30,7 +30,7 @@ jobs:
# --- Prechecks and Checkouts ------------------------------------------------------------------------ # --- Prechecks and Checkouts ------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------- # ----------------------------------------------------------------------------------------------------
Precheck: Precheck:
uses: alcionai/corso/.github/workflows/_filechange_checker.yml@main uses: alcionai/canario/.github/workflows/_filechange_checker.yml@main
Checkout: Checkout:
needs: [Precheck] needs: [Precheck]
@ -52,7 +52,7 @@ jobs:
# SetM365App will decide which M365 app to use for this CI run # SetM365App will decide which M365 app to use for this CI run
SetM365App: SetM365App:
uses: alcionai/corso/.github/workflows/accSelector.yaml@main uses: alcionai/canario/.github/workflows/accSelector.yaml@main
SetEnv: SetEnv:
environment: Testing environment: Testing
@ -571,6 +571,8 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Publish Binary - name: Publish Binary
# canario should never publish
if: false
uses: ./.github/actions/publish-binary uses: ./.github/actions/publish-binary
with: with:
version: ${{ needs.SetEnv.outputs.version }} version: ${{ needs.SetEnv.outputs.version }}
@ -582,7 +584,9 @@ jobs:
needs: [Test-Suite-Trusted, Source-Code-Linting, Website-Linting, SetEnv] needs: [Test-Suite-Trusted, Source-Code-Linting, Website-Linting, SetEnv]
environment: ${{ needs.SetEnv.outputs.environment }} environment: ${{ needs.SetEnv.outputs.environment }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/') # canario should never publish
if: false
# if: startsWith(github.ref, 'refs/tags/')
defaults: defaults:
run: run:
working-directory: build working-directory: build
@ -635,7 +639,9 @@ jobs:
needs: [Publish-Binary, Publish-Image, SetEnv] needs: [Publish-Binary, Publish-Image, SetEnv]
environment: Testing environment: Testing
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/') # canario should never publish
if: false
# if: startsWith(github.ref, 'refs/tags/')
env: env:
CORSO_VERSION: ${{ needs.SetEnv.outputs.version }} CORSO_VERSION: ${{ needs.SetEnv.outputs.version }}
steps: steps:
@ -665,7 +671,9 @@ jobs:
needs: [Publish-Binary, Publish-Image, SetEnv] needs: [Publish-Binary, Publish-Image, SetEnv]
environment: Testing environment: Testing
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/') # canario should never publish
if: false
# if: startsWith(github.ref, 'refs/tags/')
env: env:
CORSO_VERSION: ${{ needs.SetEnv.outputs.version }} CORSO_VERSION: ${{ needs.SetEnv.outputs.version }}
steps: steps:
@ -687,7 +695,9 @@ jobs:
needs: [Publish-Binary, Publish-Image, SetEnv] needs: [Publish-Binary, Publish-Image, SetEnv]
environment: Testing environment: Testing
runs-on: macos-latest runs-on: macos-latest
if: startsWith(github.ref, 'refs/tags/') # canario should never publish
if: false
# if: startsWith(github.ref, 'refs/tags/')
env: env:
CORSO_VERSION: ${{ needs.SetEnv.outputs.version }} CORSO_VERSION: ${{ needs.SetEnv.outputs.version }}
steps: steps:
@ -709,7 +719,9 @@ jobs:
needs: [Publish-Binary, Publish-Image, SetEnv] needs: [Publish-Binary, Publish-Image, SetEnv]
environment: Testing environment: Testing
runs-on: windows-latest runs-on: windows-latest
if: startsWith(github.ref, 'refs/tags/') # canario should never publish
if: false
# if: startsWith(github.ref, 'refs/tags/')
env: env:
CORSO_VERSION: ${{ needs.SetEnv.outputs.version }} CORSO_VERSION: ${{ needs.SetEnv.outputs.version }}
steps: steps:
@ -730,6 +742,8 @@ jobs:
- uses: actions/checkout@v4 # need to checkout to make the action available - uses: actions/checkout@v4 # need to checkout to make the action available
- name: Publish website - name: Publish website
# canario should never publish
if: false
uses: ./.github/actions/publish-website uses: ./.github/actions/publish-website
with: with:
aws-iam-role: ${{ secrets.AWS_IAM_ROLE }} aws-iam-role: ${{ secrets.AWS_IAM_ROLE }}
@ -740,12 +754,16 @@ jobs:
needs: [SetEnv, Validate-Linux-Artifacts, Validate-MacOS-Artifacts, Validate-Docker-Artifacts, Validate-Windows-Artifacts] needs: [SetEnv, Validate-Linux-Artifacts, Validate-MacOS-Artifacts, Validate-Docker-Artifacts, Validate-Windows-Artifacts]
environment: ${{ needs.SetEnv.outputs.environment }} environment: ${{ needs.SetEnv.outputs.environment }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/') # canario should never publish
if: false
# if: startsWith(github.ref, 'refs/tags/')
steps: steps:
- uses: actions/checkout@v4 # need to checkout to make the action available - uses: actions/checkout@v4 # need to checkout to make the action available
- name: Publish website - name: Publish website
# canario should never publish
if: false
uses: ./.github/actions/publish-website uses: ./.github/actions/publish-website
with: with:
aws-iam-role: ${{ secrets.AWS_IAM_ROLE }} aws-iam-role: ${{ secrets.AWS_IAM_ROLE }}
@ -756,7 +774,9 @@ jobs:
needs: [Publish-Website-Prod, SetEnv] needs: [Publish-Website-Prod, SetEnv]
environment: Testing environment: Testing
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/') # canario should never publish
if: false
# if: startsWith(github.ref, 'refs/tags/')
env: env:
CORSO_VERSION: ${{ needs.SetEnv.outputs.version }} CORSO_VERSION: ${{ needs.SetEnv.outputs.version }}
steps: steps:

View File

@ -20,7 +20,7 @@ concurrency:
jobs: jobs:
SetM365App: SetM365App:
uses: alcionai/corso/.github/workflows/accSelector.yaml@main uses: alcionai/canario/.github/workflows/accSelector.yaml@main
Longevity-Tests: Longevity-Tests:
needs: [ SetM365App ] needs: [ SetM365App ]
@ -76,7 +76,8 @@ jobs:
git checkout ${{ steps.version.outputs.version }} git checkout ${{ steps.version.outputs.version }}
git checkout ${{ github.ref }} -- .github git checkout ${{ github.ref }} -- .github
- run: go build -o corso - run:
timeout-minutes: 10 timeout-minutes: 10
- run: mkdir ${CORSO_LOG_DIR} - run: mkdir ${CORSO_LOG_DIR}
@ -97,7 +98,7 @@ jobs:
- name: Version Test - name: Version Test
timeout-minutes: 10 timeout-minutes: 10
run: | run: |
./corso --version | grep -c 'Corso version:' ./canario --version | grep -c 'Corso version:'
- name: Repo init test - name: Repo init test
id: repo-init id: repo-init
@ -105,7 +106,7 @@ jobs:
run: | run: |
set -euo pipefail set -euo pipefail
echo -e "\nRepo init test\n" >> ${{ env.CORSO_LOG_FILE }} echo -e "\nRepo init test\n" >> ${{ env.CORSO_LOG_FILE }}
./corso repo init s3 \ ./canario repo init s3 \
--no-stats \ --no-stats \
--hide-progress \ --hide-progress \
--retention-mode $(echo "${{ env.RETENTION_MODE }}" | tr '[:upper:]' '[:lower:]') \ --retention-mode $(echo "${{ env.RETENTION_MODE }}" | tr '[:upper:]' '[:lower:]') \
@ -127,7 +128,7 @@ jobs:
run: | run: |
set -euo pipefail set -euo pipefail
echo -e "\nRepo connect test\n" >> ${{ env.CORSO_LOG_FILE }} echo -e "\nRepo connect test\n" >> ${{ env.CORSO_LOG_FILE }}
./corso repo connect s3 \ ./canario repo connect s3 \
--no-stats \ --no-stats \
--hide-progress \ --hide-progress \
--prefix ${{ env.PREFIX }} \ --prefix ${{ env.PREFIX }} \
@ -148,7 +149,7 @@ jobs:
timeout-minutes: 30 timeout-minutes: 30
run: | run: |
echo -e "\nBackup Exchange test\n" >> ${CORSO_LOG_FILE} echo -e "\nBackup Exchange test\n" >> ${CORSO_LOG_FILE}
./corso backup create exchange \ ./canario backup create exchange \
--no-stats \ --no-stats \
--mailbox "${TEST_USER}" \ --mailbox "${TEST_USER}" \
--hide-progress \ --hide-progress \
@ -174,7 +175,7 @@ jobs:
run: | run: |
set -euo pipefail set -euo pipefail
echo -e "\nBackup OneDrive test\n" >> ${CORSO_LOG_FILE} echo -e "\nBackup OneDrive test\n" >> ${CORSO_LOG_FILE}
./corso backup create onedrive \ ./canario backup create onedrive \
--no-stats \ --no-stats \
--hide-progress \ --hide-progress \
--user "${TEST_USER}" \ --user "${TEST_USER}" \
@ -200,7 +201,7 @@ jobs:
set -euo pipefail set -euo pipefail
echo -e "\nBackup SharePoint test\n" >> ${CORSO_LOG_FILE} echo -e "\nBackup SharePoint test\n" >> ${CORSO_LOG_FILE}
./corso backup create sharepoint \ ./canario backup create sharepoint \
--no-stats \ --no-stats \
--hide-progress \ --hide-progress \
--site "${{ vars.CORSO_M365_TEST_SITE_URL }}" \ --site "${{ vars.CORSO_M365_TEST_SITE_URL }}" \
@ -265,9 +266,9 @@ jobs:
echo -e "\Export OneDrive test\n" >> ${CORSO_LOG_FILE} echo -e "\Export OneDrive test\n" >> ${CORSO_LOG_FILE}
echo -e "\Export OneDrive test - first entry\n" >> ${CORSO_LOG_FILE} echo -e "\Export OneDrive test - first entry\n" >> ${CORSO_LOG_FILE}
./corso backup list onedrive 2>/dev/null | tail -n+2 | head -n1 | awk '{print $1}' | ./canario backup list onedrive 2>/dev/null | tail -n+2 | head -n1 | awk '{print $1}' |
while read -r line; do while read -r line; do
./corso export onedrive \ ./canario export onedrive \
"/tmp/corso-export--$line" \ "/tmp/corso-export--$line" \
--no-stats \ --no-stats \
--backup "$line" \ --backup "$line" \
@ -275,9 +276,9 @@ jobs:
done done
echo -e "\Export OneDrive test - last entry\n" >> ${CORSO_LOG_FILE} echo -e "\Export OneDrive test - last entry\n" >> ${CORSO_LOG_FILE}
./corso backup list onedrive 2>/dev/null | tail -n1 | awk '{print $1}' | ./canario backup list onedrive 2>/dev/null | tail -n1 | awk '{print $1}' |
while read -r line; do while read -r line; do
./corso export onedrive \ ./canario export onedrive \
"/tmp/corso-export--$line" \ "/tmp/corso-export--$line" \
--no-stats \ --no-stats \
--backup "$line" \ --backup "$line" \
@ -293,9 +294,9 @@ jobs:
echo -e "\Export SharePoint test\n" >> ${CORSO_LOG_FILE} echo -e "\Export SharePoint test\n" >> ${CORSO_LOG_FILE}
echo -e "\Export SharePoint test - first entry\n" >> ${CORSO_LOG_FILE} echo -e "\Export SharePoint test - first entry\n" >> ${CORSO_LOG_FILE}
./corso backup list sharepoint 2>/dev/null | tail -n+2 | head -n1 | awk '{print $1}' | ./canario backup list sharepoint 2>/dev/null | tail -n+2 | head -n1 | awk '{print $1}' |
while read -r line; do while read -r line; do
./corso export sharepoint \ ./canario export sharepoint \
"/tmp/corso-export--$line" \ "/tmp/corso-export--$line" \
--no-stats \ --no-stats \
--backup "$line" \ --backup "$line" \
@ -303,9 +304,9 @@ jobs:
done done
echo -e "\Export SharePoint test - last entry\n" >> ${CORSO_LOG_FILE} echo -e "\Export SharePoint test - last entry\n" >> ${CORSO_LOG_FILE}
./corso backup list sharepoint 2>/dev/null | tail -n1 | awk '{print $1}' | ./canario backup list sharepoint 2>/dev/null | tail -n1 | awk '{print $1}' |
while read -r line; do while read -r line; do
./corso export sharepoint \ ./canario export sharepoint \
"/tmp/corso-export--$line" \ "/tmp/corso-export--$line" \
--no-stats \ --no-stats \
--backup "$line" \ --backup "$line" \
@ -324,7 +325,7 @@ jobs:
# Run with the force flag so it doesn't fail if the github runner # Run with the force flag so it doesn't fail if the github runner
# hostname isn't what's expected. This is only safe because we can # hostname isn't what's expected. This is only safe because we can
# guarantee only one runner will be executing maintenance at a time. # guarantee only one runner will be executing maintenance at a time.
./corso repo maintenance --mode metadata \ ./canario repo maintenance --mode metadata \
--no-stats \ --no-stats \
--hide-progress \ --hide-progress \
--force \ --force \
@ -339,7 +340,7 @@ jobs:
set -euo pipefail set -euo pipefail
echo -e "\n Maintenance test Weekly\n" >> ${CORSO_LOG_FILE} echo -e "\n Maintenance test Weekly\n" >> ${CORSO_LOG_FILE}
./corso repo maintenance --mode complete \ ./canario repo maintenance --mode complete \
--no-stats \ --no-stats \
--hide-progress \ --hide-progress \
--force \ --force \

View File

@ -41,7 +41,7 @@ jobs:
# SetM365App will decide which M365 app to use for this CI run # SetM365App will decide which M365 app to use for this CI run
SetM365App: SetM365App:
uses: alcionai/corso/.github/workflows/accSelector.yaml@main uses: alcionai/canario/.github/workflows/accSelector.yaml@main
# ---------------------------------------------------------------------------------------------------- # ----------------------------------------------------------------------------------------------------
# --- Nightly Testing ------------------------------------------------------------------- # --- Nightly Testing -------------------------------------------------------------------

View File

@ -20,7 +20,7 @@ concurrency:
jobs: jobs:
SetM365App: SetM365App:
uses: alcionai/corso/.github/workflows/accSelector.yaml@main uses: alcionai/canario/.github/workflows/accSelector.yaml@main
Sanity-Tests: Sanity-Tests:
needs: [ SetM365App ] needs: [ SetM365App ]
@ -56,7 +56,7 @@ jobs:
with: with:
go-version-file: src/go.mod go-version-file: src/go.mod
- run: go build -o corso - run: go build -o canario
timeout-minutes: 10 timeout-minutes: 10
- run: go build -o sanity-test ./cmd/sanity_test - run: go build -o sanity-test ./cmd/sanity_test
@ -114,7 +114,7 @@ jobs:
- name: Version Test - name: Version Test
timeout-minutes: 10 timeout-minutes: 10
run: | run: |
./corso --version | grep -c 'Corso version:' ./canario --version | grep -c 'Corso version:'
- name: Repo init test - name: Repo init test
timeout-minutes: 10 timeout-minutes: 10
@ -123,7 +123,7 @@ jobs:
set -euo pipefail set -euo pipefail
prefix=$(date +"%Y-%m-%d-%T") prefix=$(date +"%Y-%m-%d-%T")
echo -e "\nRepo init test\n" >> ${{ env.CORSO_LOG_FILE }} echo -e "\nRepo init test\n" >> ${{ env.CORSO_LOG_FILE }}
./corso repo init s3 \ ./canario repo init s3 \
--no-stats \ --no-stats \
--hide-progress \ --hide-progress \
--prefix $prefix \ --prefix $prefix \
@ -143,7 +143,7 @@ jobs:
run: | run: |
set -euo pipefail set -euo pipefail
echo -e "\nRepo connect test\n" >> ${{ env.CORSO_LOG_FILE }} echo -e "\nRepo connect test\n" >> ${{ env.CORSO_LOG_FILE }}
./corso repo connect s3 \ ./canario repo connect s3 \
--no-stats \ --no-stats \
--hide-progress \ --hide-progress \
--prefix ${{ steps.repo-init.outputs.result }} \ --prefix ${{ steps.repo-init.outputs.result }} \
@ -163,7 +163,7 @@ jobs:
run: | run: |
set -euo pipefail set -euo pipefail
echo -e "\nRepo maintenance test\n" >> ${{ env.CORSO_LOG_FILE }} echo -e "\nRepo maintenance test\n" >> ${{ env.CORSO_LOG_FILE }}
./corso repo maintenance \ ./canario repo maintenance \
--no-stats \ --no-stats \
--hide-progress \ --hide-progress \
--mode complete \ --mode complete \

View File

@ -49,6 +49,8 @@ jobs:
Publish-Website: Publish-Website:
needs: [Website-Linting] needs: [Website-Linting]
# canario should never publish
if: false
environment: Production environment: Production
runs-on: ubuntu-latest runs-on: ubuntu-latest
defaults: defaults:
@ -59,6 +61,8 @@ jobs:
- uses: actions/checkout@v4 # need to checkout to make the action available - uses: actions/checkout@v4 # need to checkout to make the action available
- name: Publish website - name: Publish website
# canario should never publish
if: false
uses: ./.github/actions/publish-website uses: ./.github/actions/publish-website
with: with:
aws-iam-role: ${{ secrets.AWS_IAM_ROLE }} aws-iam-role: ${{ secrets.AWS_IAM_ROLE }}

4
.gitignore vendored
View File

@ -19,8 +19,8 @@ testlog/
*.swp *.swp
# Standard configuration file names # Standard configuration file names
.corso_test.toml .canario_test.toml
.corso.toml .canario.toml
# Logging # Logging
*.log *.log

View File

@ -1,7 +1,7 @@
<p align="center"> <p align="center">
<img src="https://github.com/alcionai/corso/blob/main/website/static/img/corso_logo.svg?raw=true" alt="Corso Logo" width="100" /> <img src="https://github.com/alcionai/corso/blob/main/website/static/img/corso_logo.svg?raw=true" alt="Corso Logo" width="100" />
</p> </p>
<h1 align="center">Corso</h1> <h1 align="center">--CANARIO--</h1>
[![Go Report Card](https://goreportcard.com/badge/github.com/alcionai/corso/src)](https://goreportcard.com/report/github.com/alcionai/corso/src) [![Go Report Card](https://goreportcard.com/badge/github.com/alcionai/corso/src)](https://goreportcard.com/report/github.com/alcionai/corso/src)
[![Discord](https://img.shields.io/badge/discuss-discord-blue)](https://discord.gg/63DTTSnuhT) [![Discord](https://img.shields.io/badge/discuss-discord-blue)](https://discord.gg/63DTTSnuhT)

View File

@ -4,21 +4,21 @@ WORKDIR /go/src/app
COPY src . COPY src .
ARG CORSO_BUILD_LDFLAGS="" ARG CORSO_BUILD_LDFLAGS=""
RUN go build -o corso -ldflags "$CORSO_BUILD_LDFLAGS" RUN go build -o canario -ldflags "$CORSO_BUILD_LDFLAGS"
FROM alpine:3 FROM alpine:3
LABEL org.opencontainers.image.title="Corso" LABEL org.opencontainers.image.title="Canario"
LABEL org.opencontainers.image.description="Free, Secure, and Open-Source Backup for Microsoft 365" LABEL org.opencontainers.image.description="Free, Secure, and Open-Source Backup for Microsoft 365"
LABEL org.opencontainers.image.url="https://github.com/alcionai/canario" LABEL org.opencontainers.image.url="https://github.com/alcionai/canario"
LABEL org.opencontainers.image.source="https://github.com/alcionai/canario" LABEL org.opencontainers.image.source="https://github.com/alcionai/canario"
LABEL org.opencontainers.image.vendor="Alcion, Inc." LABEL org.opencontainers.image.vendor="Alcion, Inc."
COPY --from=builder /go/src/app/corso /corso COPY --from=builder /go/src/app/canario /canario
RUN apk add --no-cache ca-certificates RUN apk add --no-cache ca-certificates
ENV CORSO_HOME=/app/corso ENV CORSO_HOME=/app/canario
ENV CORSO_CONFIG_DIR=$CORSO_HOME \ ENV CORSO_CONFIG_DIR=$CORSO_HOME \
KOPIA_CONFIG_PATH=$CORSO_HOME/kopia/config/repository.config \ KOPIA_CONFIG_PATH=$CORSO_HOME/kopia/config/repository.config \
KOPIA_LOG_DIR=$CORSO_HOME/kopia/logs \ KOPIA_LOG_DIR=$CORSO_HOME/kopia/logs \
@ -26,4 +26,4 @@ ENV CORSO_CONFIG_DIR=$CORSO_HOME \
KOPIA_PERSIST_CREDENTIALS_ON_CONNECT=false \ KOPIA_PERSIST_CREDENTIALS_ON_CONNECT=false \
KOPIA_CHECK_FOR_UPDATES=false KOPIA_CHECK_FOR_UPDATES=false
ENTRYPOINT ["/corso"] ENTRYPOINT ["/canario"]

View File

@ -30,7 +30,7 @@ Darwin) GOOS="darwin" ;;
esac esac
PLATFORMS="$GOOS/$GOARCH" # default platform PLATFORMS="$GOOS/$GOARCH" # default platform
TAG="alcionai/corso" # default image tag TAG="alcionai/canario" # default image tag
MODE="binary" MODE="binary"
case "$1" in case "$1" in
@ -68,13 +68,13 @@ if [ "$MODE" == "binary" ]; then
--env GOOS=${GOOS} --env GOARCH=${GOARCH} \ --env GOOS=${GOOS} --env GOARCH=${GOARCH} \
--workdir "/app/src" \ --workdir "/app/src" \
golang:${GOVER} \ golang:${GOVER} \
go build -o corso -ldflags "${CORSO_BUILD_LDFLAGS}" go build -o canario -ldflags "${CORSO_BUILD_LDFLAGS}"
OUTFILE="corso" OUTFILE="canario"
[ "$GOOS" == "windows" ] && OUTFILE="corso.exe" [ "$GOOS" == "windows" ] && OUTFILE="canario.exe"
mkdir -p "${ROOT}/bin/${GOOS}-${GOARCH}" mkdir -p "${ROOT}/bin/${GOOS}-${GOARCH}"
mv "${ROOT}/src/corso" "${ROOT}/bin/${GOOS}-${GOARCH}/${OUTFILE}" mv "${ROOT}/src/canario" "${ROOT}/bin/${GOOS}-${GOARCH}/${OUTFILE}"
echo Corso $platform binary available in "${ROOT}/bin/${GOOS}-${GOARCH}/${OUTFILE}" echo Corso $platform binary available in "${ROOT}/bin/${GOOS}-${GOARCH}/${OUTFILE}"
done done
else else

View File

@ -17,13 +17,13 @@ COPY ./src .
FROM base AS build FROM base AS build
ARG TARGETOS ARG TARGETOS
ARG TARGETARCH ARG TARGETARCH
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o /corso . RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o /canario .
## Deploy ## Deploy
FROM ubuntu:22.10 FROM ubuntu:22.10
COPY --from=build /corso / COPY --from=build /canario /
USER nobody USER nobody
ENTRYPOINT ["/corso"] ENTRYPOINT ["/canario"]

6
src/.gitignore vendored
View File

@ -1,5 +1,5 @@
dist/ dist/
corso canario
# Test binary, built with `go test -c` # Test binary, built with `go test -c`
*.test *.test
@ -14,8 +14,8 @@ testlog/
*.swp *.swp
# Standard configuration file names # Standard configuration file names
.corso_test.toml .canario_test.toml
.corso.toml .canario.toml
# Logging # Logging
*.log *.log

View File

@ -9,7 +9,7 @@ BAD_LINT_MSG := "Missing golangci-lint version $(WANTED_LINT_VERSION). Visit $(I
.PHONY: check-lint check-lint-version lint load-test .PHONY: check-lint check-lint-version lint load-test
build: build:
go build -o corso go build -o canario
lint: check-lint-version lint: check-lint-version
golangci-lint run golangci-lint run

View File

@ -28,9 +28,9 @@ import (
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
// The root-level command. // The root-level command.
// `corso <command> [<subcommand>] [<service>] [<flag>...]` // `canario <command> [<subcommand>] [<service>] [<flag>...]`
var corsoCmd = &cobra.Command{ var canarioCmd = &cobra.Command{
Use: "corso", Use: "canario",
Short: "Free, Secure, Open-Source Backup for M365.", Short: "Free, Secure, Open-Source Backup for M365.",
Long: `Free, Secure, and Open-Source Backup for Microsoft 365.`, Long: `Free, Secure, and Open-Source Backup for Microsoft 365.`,
RunE: handleCorsoCmd, RunE: handleCorsoCmd,
@ -54,7 +54,7 @@ func preRun(cc *cobra.Command, args []string) error {
} }
avoidTheseCommands := []string{ avoidTheseCommands := []string{
"corso", "env", "help", "backup", "details", "list", "restore", "export", "delete", "repo", "init", "connect", "canario", "env", "help", "backup", "details", "list", "restore", "export", "delete", "repo", "init", "connect",
} }
if len(logger.ResolvedLogFile) > 0 && !slices.Contains(avoidTheseCommands, cc.Use) { if len(logger.ResolvedLogFile) > 0 && !slices.Contains(avoidTheseCommands, cc.Use) {
@ -62,7 +62,7 @@ func preRun(cc *cobra.Command, args []string) error {
} }
// handle deprecated user flag in Backup exchange command // handle deprecated user flag in Backup exchange command
if cc.CommandPath() == "corso backup create exchange" { if cc.CommandPath() == "canario backup create exchange" {
handleMailBoxFlag(ctx, cc, flagSl) handleMailBoxFlag(ctx, cc, flagSl)
} }
@ -83,8 +83,8 @@ func handleMailBoxFlag(ctx context.Context, c *cobra.Command, flagNames []string
} }
} }
// Handler for flat calls to `corso`. // Handler for flat calls to `canario`.
// Produces the same output as `corso --help`. // Produces the same output as `canario --help`.
func handleCorsoCmd(cmd *cobra.Command, args []string) error { func handleCorsoCmd(cmd *cobra.Command, args []string) error {
v, _ := cmd.Flags().GetBool("version") v, _ := cmd.Flags().GetBool("version")
if v { if v {
@ -99,7 +99,7 @@ func handleCorsoCmd(cmd *cobra.Command, args []string) error {
// The command tree is built and attached to the returned command. // The command tree is built and attached to the returned command.
func CorsoCommand() *cobra.Command { func CorsoCommand() *cobra.Command {
c := &cobra.Command{} c := &cobra.Command{}
*c = *corsoCmd *c = *canarioCmd
BuildCommandTree(c) BuildCommandTree(c)
return c return c
@ -118,7 +118,7 @@ func BuildCommandTree(cmd *cobra.Command) {
observe.AddProgressBarFlags(cmd) observe.AddProgressBarFlags(cmd)
print.AddOutputFlag(cmd) print.AddOutputFlag(cmd)
flags.AddGlobalOperationFlags(cmd) flags.AddGlobalOperationFlags(cmd)
cmd.SetUsageTemplate(indentExamplesTemplate(corsoCmd.UsageTemplate())) cmd.SetUsageTemplate(indentExamplesTemplate(canarioCmd.UsageTemplate()))
cmd.CompletionOptions.DisableDefaultCmd = true cmd.CompletionOptions.DisableDefaultCmd = true
@ -139,10 +139,10 @@ func Handle() {
//nolint:forbidigo //nolint:forbidigo
ctx := config.Seed(context.Background()) ctx := config.Seed(context.Background())
ctx, log := logger.Seed(ctx, logger.PreloadLoggingFlags(os.Args[1:])) ctx, log := logger.Seed(ctx, logger.PreloadLoggingFlags(os.Args[1:]))
ctx = print.SetRootCmd(ctx, corsoCmd) ctx = print.SetRootCmd(ctx, canarioCmd)
ctx = observe.SeedObserver(ctx, print.StderrWriter(ctx), observe.PreloadFlags()) ctx = observe.SeedObserver(ctx, print.StderrWriter(ctx), observe.PreloadFlags())
BuildCommandTree(corsoCmd) BuildCommandTree(canarioCmd)
defer func() { defer func() {
observe.Flush(ctx) // flush the progress bars observe.Flush(ctx) // flush the progress bars
@ -150,7 +150,7 @@ func Handle() {
_ = log.Sync() // flush all logs in the buffer _ = log.Sync() // flush all logs in the buffer
}() }()
if err := corsoCmd.ExecuteContext(ctx); err != nil { if err := canarioCmd.ExecuteContext(ctx); err != nil {
logger.CtxErr(ctx, err).Error("cli execution") logger.CtxErr(ctx, err).Error("cli execution")
os.Exit(1) os.Exit(1)
} }

View File

@ -22,7 +22,7 @@ import (
func StubRootCmd(args ...string) *cobra.Command { func StubRootCmd(args ...string) *cobra.Command {
id := uuid.NewString() id := uuid.NewString()
now := time.Now().UTC().Format(time.RFC3339Nano) now := time.Now().UTC().Format(time.RFC3339Nano)
cmdArg := "testing-corso" cmdArg := "testing-canario"
c := &cobra.Command{ c := &cobra.Command{
Use: cmdArg, Use: cmdArg,
Short: id, Short: id,

View File

@ -14,7 +14,7 @@ It provides a convenient wrapper and great coverage of the API surface.
Before using the tool you want to build the container that packages it. Before using the tool you want to build the container that packages it.
```sh ```sh
docker build -t corso/graph_pwsh:latest . docker build -t canario/graph_pwsh:latest .
``` ```
A prebuilt image is also available currently available as `gmatev/graph_pwsh`. A prebuilt image is also available currently available as `gmatev/graph_pwsh`.
@ -40,13 +40,13 @@ This is suitable if you would like to issue a number of MS Graph API commands fr
interactive shell in the container. interactive shell in the container.
```sh ```sh
docker run --rm -it -v $(pwd):/usr/pwsh -e AZURE_TENANT_ID -e AZURE_CLIENT_ID -e AZURE_CLIENT_SECRET corso/graph_pwsh pwsh docker run --rm -it -v $(pwd):/usr/pwsh -e AZURE_TENANT_ID -e AZURE_CLIENT_ID -e AZURE_CLIENT_SECRET canario/graph_pwsh pwsh
``` ```
Alternatively you can use an environment variable file `env_names` that has the names of the required environment variables Alternatively you can use an environment variable file `env_names` that has the names of the required environment variables
```sh ```sh
docker run --rm -it -v $(pwd):/usr/pwsh --env-file env_names corso/graph_pwsh pwsh docker run --rm -it -v $(pwd):/usr/pwsh --env-file env_names canario/graph_pwsh pwsh
``` ```
Before you run any command you want to authenticate with Graph using a convenient script Before you run any command you want to authenticate with Graph using a convenient script
@ -64,7 +64,7 @@ Suitable when you want to run just a single command. Essentially running the `Au
before the actual command you want to run. before the actual command you want to run.
```sh ```sh
docker run --rm -it -v $(pwd):/usr/pwsh --env-file env_names corso/graph_pwsh \ docker run --rm -it -v $(pwd):/usr/pwsh --env-file env_names canario/graph_pwsh \
pwsh -c "<your Graph command>" pwsh -c "<your Graph command>"
``` ```
@ -72,7 +72,7 @@ Here is a complete example to get all users
```sh ```sh
# This is the equivalent of GET https://graph.microsoft.com/v1.0/users # This is the equivalent of GET https://graph.microsoft.com/v1.0/users
docker run --rm -it -v $(pwd):/usr/pwsh --env-file env_names corso/graph_pwsh \ docker run --rm -it -v $(pwd):/usr/pwsh --env-file env_names canario/graph_pwsh \
pwsh -c "Get-MgUser -All" pwsh -c "Get-MgUser -All"
``` ```
@ -80,7 +80,7 @@ Another example to retrieve an email message for a given user by ID.
```sh ```sh
# This is the equivalent of GET https://graph.microsoft.com/v1.0/<userID>/messages/<messageId> # This is the equivalent of GET https://graph.microsoft.com/v1.0/<userID>/messages/<messageId>
docker run --rm -it -v $(pwd):/usr/pwsh --env-file env_names corso/graph_pwsh \ docker run --rm -it -v $(pwd):/usr/pwsh --env-file env_names canario/graph_pwsh \
pwsh -c "Get-MgUserMessage -UserId <userID or UPN> -MessageID <messageID>" pwsh -c "Get-MgUserMessage -UserId <userID or UPN> -MessageID <messageID>"
``` ```
@ -95,7 +95,7 @@ and execute the container which will pull it and then execute it. This can be do
`Execute-Script.ps1` command as follows. `Execute-Script.ps1` command as follows.
```sh ```sh
docker run --rm -it -v $(pwd):/usr/pwsh --env-file env_names corso/graph_pwsh \ docker run --rm -it -v $(pwd):/usr/pwsh --env-file env_names canario/graph_pwsh \
pwsh -c "Execute-Script.ps1 -ScriptUrl <script download URL>" pwsh -c "Execute-Script.ps1 -ScriptUrl <script download URL>"
``` ```
@ -106,7 +106,7 @@ similar to the example below.
```sh ```sh
# This is the equivalent of GET https://graph.microsoft.com/v1.0/users # This is the equivalent of GET https://graph.microsoft.com/v1.0/users
docker run --rm -it -v $(pwd):/usr/pwsh --env-file env_names corso/graph_pwsh \ docker run --rm -it -v $(pwd):/usr/pwsh --env-file env_names canario/graph_pwsh \
pwsh -c "Get-MgUser -All -Debug" pwsh -c "Get-MgUser -All -Debug"
``` ```
@ -119,7 +119,7 @@ Alternatively you can do the following:
```sh ```sh
# This is the equivalent of GET https://graph.microsoft.com/v1.0/users # This is the equivalent of GET https://graph.microsoft.com/v1.0/users
docker run --rm -it -v $(pwd):/usr/pwsh --env-file env_names corso/graph_pwsh \ docker run --rm -it -v $(pwd):/usr/pwsh --env-file env_names canario/graph_pwsh \
pwsh -c "Select-MgProfile -Name "beta" && Get-MgUser -All" pwsh -c "Select-MgProfile -Name "beta" && Get-MgUser -All"
``` ```

View File

@ -31,7 +31,7 @@ import (
) )
const ( const (
corsoWrapperAlertNamespace = "corso-kopia-wrapper" corsoWrapperAlertNamespace = "canario-kopia-wrapper"
defaultKopiaConfigDir = "/tmp/" defaultKopiaConfigDir = "/tmp/"
kopiaConfigFileTemplate = "repository-%s.config" kopiaConfigFileTemplate = "repository-%s.config"

View File

@ -9,7 +9,7 @@ if you have Go installed on your system.
```bash ```bash
# run from within `./src` # run from within `./src`
go build -o corso go build -o canario
``` ```
:::info :::info