From a4d9120062ac6be5e3e06f7d8b4b57dc740ce711 Mon Sep 17 00:00:00 2001 From: Ralph Hightower <32745442+RalphHightower@users.noreply.github.com> Date: Tue, 7 Jan 2025 20:28:57 -0500 Subject: [PATCH] [cleanup](build): cleanup: pandoc.yml does the job of the individual files (#115) * [cleanup](build): pandoc.yml does the job of individual workflows * Pending changes exported from your codespace --- .github/ci.yaml | 30 - .github/codeql.yml | 73 -- .github/dependency-review.yml | 22 - .github/jekyll.yml | 66 -- .github/permission_advisor.yml | 27 - .github/readme-checker.yml | 19 - .github/release-please.yml | 25 - .github/release.yml | 33 - .github/scorecard.yml | 36 - .github/semantic-release.yml | 124 --- .github/test.yml | 86 -- .github/workflows.md | 23 - .github/workflows/Accounts.yml | 32 - .github/workflows/Assets.yml | 32 - .../workflows/BeagleIdentificationPhotos.yml | 31 - .github/workflows/Beagles.yml | 31 - .github/workflows/ComputerSettings.yml | 32 - .github/workflows/EquipmentDistrbution.yml | 34 - .github/workflows/NetworkSettings.yml | 36 - .github/workflows/Obituary.yml | 43 - .github/workflows/SongsForService.yml | 32 - .github/workflows/{ci.yaml => ci.yml} | 0 .github/workflows/dependabot.txt | 46 -- get-docker.sh | 753 ++++++++++++++++++ 24 files changed, 753 insertions(+), 913 deletions(-) delete mode 100644 .github/ci.yaml delete mode 100644 .github/codeql.yml delete mode 100644 .github/dependency-review.yml delete mode 100644 .github/jekyll.yml delete mode 100644 .github/permission_advisor.yml delete mode 100644 .github/readme-checker.yml delete mode 100644 .github/release-please.yml delete mode 100644 .github/release.yml delete mode 100644 .github/scorecard.yml delete mode 100644 .github/semantic-release.yml delete mode 100644 .github/test.yml delete mode 100644 .github/workflows.md delete mode 100644 .github/workflows/Accounts.yml delete mode 100644 .github/workflows/Assets.yml delete mode 100644 .github/workflows/BeagleIdentificationPhotos.yml delete mode 100644 .github/workflows/Beagles.yml delete mode 100644 .github/workflows/ComputerSettings.yml delete mode 100644 .github/workflows/EquipmentDistrbution.yml delete mode 100644 .github/workflows/NetworkSettings.yml delete mode 100644 .github/workflows/Obituary.yml delete mode 100644 .github/workflows/SongsForService.yml rename .github/workflows/{ci.yaml => ci.yml} (100%) delete mode 100644 .github/workflows/dependabot.txt create mode 100644 get-docker.sh diff --git a/.github/ci.yaml b/.github/ci.yaml deleted file mode 100644 index 78e77e6c..00000000 --- a/.github/ci.yaml +++ /dev/null @@ -1,30 +0,0 @@ -name: ci.yml – Continuous Integration -on: - push: - branches: - - main - pull_request: - branches: - - main -permissions: - contents: read - -jobs: - build: - name: "Test with Jekyll ${{ matrix.jekyll }}" - runs-on: "ubuntu-latest" - strategy: - matrix: - jekyll: ["~> 4.3.4"] - env: - JEKYLL_VERSION: ${{ matrix.jekyll }} - steps: - - name: Checkout Repository - uses: actions/checkout@v4.2.2 - - name: Set Up Ruby 3.3.6 - uses: ruby/setup-ruby@v1.203.0 - with: - ruby-version: 3.3.6 - bundler-cache: true - - name: Run tests - run: script/cibuild diff --git a/.github/codeql.yml b/.github/codeql.yml deleted file mode 100644 index e7cd3e37..00000000 --- a/.github/codeql.yml +++ /dev/null @@ -1,73 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: ["main"] - pull_request: - # The branches below must be a subset of the branches above - branches: ["main"] - schedule: - - cron: "0 0 * * 1" - -permissions: - contents: read - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: ["ruby"] - # CodeQL supports [ $supported-codeql-languages ] - # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support - - steps: - - name: Checkout repository - uses: actions/checkout@v4.2.2 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/autobuild@v2.19.4 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v3.27.4 - - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - - # If the Autobuild fails above, remove it and uncomment the following three lines. - # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. - - # - run: | - # echo "Run, Build Application using script" - # ./location_of_script_within_repo/buildscript.sh - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2.19.3 - with: - category: "/language:${{matrix.language}}" diff --git a/.github/dependency-review.yml b/.github/dependency-review.yml deleted file mode 100644 index 287f5838..00000000 --- a/.github/dependency-review.yml +++ /dev/null @@ -1,22 +0,0 @@ -# Dependency Review Action -# -# This Action will scan dependency manifest files that change as part of a Pull Request, -# surfacing known-vulnerable versions of the packages declared or updated in the PR. -# Once installed, if the workflow run is marked as required, -# PRs introducing known-vulnerable packages will be blocked from merging. -# -# Source repository: https://github.com/actions/dependency-review-action -name: 'dependency – Dependency Review' -on: [pull_request] - -permissions: - contents: read - -jobs: - dependency-review: - runs-on: ubuntu-latest - steps: - - name: 'Checkout Repository' - uses: actions/checkout@v4.2.2 - - name: 'Dependency Review' - uses: actions/dependency-review-action@v4.5.0 diff --git a/.github/jekyll.yml b/.github/jekyll.yml deleted file mode 100644 index baa6c2e5..00000000 --- a/.github/jekyll.yml +++ /dev/null @@ -1,66 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -# Sample workflow for building and deploying a Jekyll site to GitHub Pages -name: jekyll.yml – Deploy Jekyll site to Pages - -on: - # Runs on pushes targeting the default branch - push: - branches: ["main", "_staging", "next"] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages -permissions: - contents: read - pages: write - id-token: write - -# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. -# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. -concurrency: - group: "pages" - cancel-in-progress: false - -jobs: - # Build job - build: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4.2.2 - - name: Setup Ruby - uses: ruby/setup-ruby@v1.203.0 - with: - ruby-version: '3.3.6' # Not needed with a .ruby-version file - bundler-cache: true # runs 'bundle install' and caches installed gems automatically - cache-version: 1 # Increment this number if you need to re-download cached gems - - name: Setup Pages - id: pages - uses: actions/configure-pages@v5.0.0 - - name: Build with Jekyll - # Outputs to the './_site' directory by default - run: bundle exec jekyll build --trace --incremental --baseurl "${{ steps.pages.outputs.base_path }}" - env: - JEKYLL_ENV: production - JEKYLL_GITHUB_TOKEN: ${{secrets.JEKYLL_METADATA_TOKEN}} - LOG_LEVEL: debug - - name: Upload artifact - # Automatically uploads an artifact from the './_site' directory by default - uses: actions/upload-pages-artifact@v3.0.1 - - # Deployment job - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - needs: build - steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4.0.5 diff --git a/.github/permission_advisor.yml b/.github/permission_advisor.yml deleted file mode 100644 index 9c00c37b..00000000 --- a/.github/permission_advisor.yml +++ /dev/null @@ -1,27 +0,0 @@ -# Sample workflow to run the action -name: permission_advisor.yml — Permissions Advisor - -permissions: - actions: read - -on: - workflow_dispatch: - inputs: - name: - description: 'The name of the workflow file to analyze' - required: true - type: string - count: - description: 'How many last runs to analyze' - required: false - type: number - default: 10 - -jobs: - advisor: - runs-on: ubuntu-latest - steps: - - uses: GitHubSecurityLab/actions-permissions/advisor@v1.0.2-beta4 - with: - name: ${{ inputs.name }} - count: ${{ inputs.count }} diff --git a/.github/readme-checker.yml b/.github/readme-checker.yml deleted file mode 100644 index 9f426c8a..00000000 --- a/.github/readme-checker.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: readme-checker.yml – Checks for suggested markdown -on: [push, pull_request] - -permissions: - contents: read - -jobs: - lint: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4.2.2 - - name: Checking markdown - uses: DavidAnson/markdownlint-cli2-action@v18.0.0 - with: - globs: | - *.md - **/*.md - !test/*.md diff --git a/.github/release-please.yml b/.github/release-please.yml deleted file mode 100644 index dd5295ef..00000000 --- a/.github/release-please.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: release-please.yml – Automate releases with Conventional Commit Messages. -on: - push: - branches: - - main - -permissions: - pull-requests: write - -name: release-please - -jobs: - release-please: - runs-on: ubuntu-latest - steps: - - uses: googleapis/release-please-action@4.1.3 - with: - contents: write - # this assumes that you have created a personal access token - # (PAT) and configured it as a GitHub action secret named - # `MY_RELEASE_PLEASE_TOKEN` (this secret name is not important). - token: ${{ secrets.GITHUB_TOKEN }} - # this is a built-in strategy in release-please, see "Action Inputs" - # for more options - release-type: simple diff --git a/.github/release.yml b/.github/release.yml deleted file mode 100644 index ffc83673..00000000 --- a/.github/release.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: release.yml – Release -on: - push: - branches: - - main - - next - - beta - - "*.x" -permissions: - contents: read # for checkout -jobs: - release: - permissions: - contents: write # to be able to publish a GitHub release - issues: write # to be able to comment on released issues - pull-requests: write # to be able to comment on released pull requests - id-token: write # to enable use of OIDC for npm provenance - name: release - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4.2.2 - - uses: actions/setup-node@v4.1.0 - with: - cache: npm - node-version: lts/* - - run: npm clean-install - - run: corepack npm audit signatures - # pinned version updated automatically by Renovate. - # details at https://semantic-release.gitbook.io/semantic-release/usage/installation#global-installation - - run: npx semantic-release@v24.2.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.SEMANTIC_RELEASE_BOT_NPM_TOKEN }} diff --git a/.github/scorecard.yml b/.github/scorecard.yml deleted file mode 100644 index 37a8c3ed..00000000 --- a/.github/scorecard.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: scorecard.yml — OpenSSF Scorecard -"on": - schedule: - - cron: 31 2 * * 1 - push: - branches: - - main -permissions: read-all -jobs: - analysis: - name: Scorecard analysis - runs-on: ubuntu-latest - permissions: - security-events: write - id-token: write - steps: - - name: Checkout code - uses: actions/checkout@v4.2.2 - with: - persist-credentials: false - - name: Run analysis - uses: ossf/scorecard-action@v2.4.0 - with: - results_file: results.sarif - results_format: sarif - publish_results: true - - name: Upload artifact - uses: actions/upload-artifact@v4.4.3 - with: - name: SARIF file - path: results.sarif - retention-days: 5 - - name: Upload to code-scanning - uses: github/codeql-action/upload-sarif@v2.19.4 - with: - sarif_file: results.sarif \ No newline at end of file diff --git a/.github/semantic-release.yml b/.github/semantic-release.yml deleted file mode 100644 index bb5c52e2..00000000 --- a/.github/semantic-release.yml +++ /dev/null @@ -1,124 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -name: systematic-release.yml – Pull Request - -on: - pull_request: - types: - - opened - - reopened - - edited - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.number }} - cancel-in-progress: true - -permissions: - contents: read - # contents: write # to be able to publish a GitHub release - issues: write # to be able to comment on released issues - pull-requests: write # to be able to comment on released pull requests - id-token: write # to enable use of OIDC for npm provenance name: Check pull request title - -jobs: - main: - runs-on: ubuntu-latest - steps: - name: semantic release - uses: amannn/action-semantic-pull-request@v5.5.3 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - # Type abbreviation comments: - # feat -> feature - # blog, info (2023-08-07 RalphHightower) - types: | - blog - cleanup - docs - feat - fix - improve - info - refactor - revert - # Scope abbreviation comments: - # biz -> business layer (2023-08-07 RalphHightower) - # cli -> command line interface - # data -> data access layer (2023-08-07 RalphHightower) - # fn -> Pulsar Functions - # grammar -> Language corrections: grammar, spelling (RalphHightower 202308-06) - # io -> Pulsar Connectors - # md -> Markdown (2023-07-30 RalphHightower) - # offload -> tiered storage - # sec -> security - # sql -> Pulsar Trino Plugin - # trans -> transaction (2023-08-07 RalphHightower) - # txn -> transaction - # ws -> websocket - # ml -> managed ledger - # zk -> zookeeper - # bk -> bookkeeper - # ui -> user interface (2023-08-07 RalphHightower) - scopes: | - admin - biz - bk - broker - build - ci - cli - client - config - data - doc - docs - fn - grammar - io - md - meta - misc - ml - monitor - offload - proxy - schema - sec - site - sql - scss - storage - test - trans - txn - ws - ui - yml - zk - pip - # The pull request's title should be fulfilled the following pattern: - # - # [][] - # - # ... where valid types and scopes can be found above; for example: - # - # [fix][test] flaky test V1_ProxyAuthenticationTest.anonymousSocketTest - headerPattern: '^\[(\w*?)\](?:\[(.*?)\])?(?:\s*)(.*)$' - headerPatternCorrespondence: type, scope, subject diff --git a/.github/test.yml b/.github/test.yml deleted file mode 100644 index d1cf2618..00000000 --- a/.github/test.yml +++ /dev/null @@ -1,86 +0,0 @@ -name: test.yml — Test - -on: - push: - branches: - - main - # renovate/** branches are generated by https://github.com/apps/renovate - - renovate/** - - pull_request: - types: - - opened - - synchronize - -permissions: - contents: read # to fetch code (actions/checkout) - -env: - FORCE_COLOR: 1 - NPM_CONFIG_COLOR: always - -jobs: - # verify against ranges defined as supported in engines.node - test_matrix: - strategy: - matrix: - node-version: - - 20.8.1 - - 20 - - 21 - - runs-on: ubuntu-latest - timeout-minutes: 5 - - steps: - - name: Harden Runner - uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 - with: - egress-policy: audit - - - uses: actions/checkout@v4.2.2 - - run: git config --global user.name github-actions - - run: git config --global user.email github-actions@github.com - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4.1.0 - with: - node-version: ${{ matrix.node-version }} - cache: npm - - run: npm clean-install - - run: corepack npm audit signatures - - run: npm test - - # verify against the node version defined for development in the .nvmrc - test_dev: - runs-on: ubuntu-latest - timeout-minutes: 5 - - steps: - - name: Test - - uses: actions/checkout@v4.2.2 - - run: git config --global user.name github-actions - - run: git config --global user.email github-actions@github.com - - name: Use Node.js from .nvmrc - uses: actions/setup-node@v4.1.0 - with: - node-version-file: .nvmrc - cache: npm - - run: npm clean-install - - run: corepack npm audit signatures - - run: npm test - - # separate job to set as required in branch protection, - # as the build names above change each time Node versions change - test: - runs-on: ubuntu-latest - needs: - - test_dev - - test_matrix - if: ${{ !cancelled() }} - steps: - - name: All matrix versions passed - if: ${{ !(contains(needs.*.result, 'failure')) }} - run: exit 0 - - name: Some matrix version failed - if: ${{ contains(needs.*.result, 'failure') }} - run: exit 1 diff --git a/.github/workflows.md b/.github/workflows.md deleted file mode 100644 index 4f5f310f..00000000 --- a/.github/workflows.md +++ /dev/null @@ -1,23 +0,0 @@ -| action | date | github | -|---|---|---| -| DavidAnson/markdownlint-cli2-action@v18.0.0 | Nov 14, 2024 |[DavidAnson/markdownlint-cli2-action: A GitHub Action to run the markdownlint-cli2 tool for linting Markdown/CommonMark files with the markdownlint library](https://github.com/DavidAnson/markdownlint-cli2-action) | -| GitHubSecurityLab/actions-permissions/advisor@v1.0.2-beta4 | Nov 22, 2024 | [GitHubSecurityLab/actions-permissions: GitHub token permissions Monitor and Advisor actions](https://github.com/GitHubSecurityLab/actions-permissions) | -| actions/checkout@v4.2.2 | Oct 23, 2024 | [actions/checkout: Action for checking out a repo](https://github.com/actions/checkout) | -| actions/configure-pages@v5.0.0 | Mar 29, 2024 | [actions/configure-pages: An action to enable Pages and extract various metadata about a site. It can also be used to configure various static site generators we support as starter workflows.](https://github.com/actions/configure-pages) | -| actions/dependency-review-action@v4.5.0 | Nov 20, 2024 | [actions/dependency-review-action: A GitHub Action for detecting vulnerable dependencies and invalid licenses in your PRs](https://github.com/actions/dependency-review-action) | -| actions/deploy-pages@4.0.5 | Mar 18, 2024 | [actions/deploy-pages: GitHub Action to publish artifacts to GitHub Pages for deployments](https://github.com/actions/deploy-pages) | -| actions/jekyll-build-pages@v1.0.13 | Aug 6, 2024 | [actions/jekyll-build-pages: A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages.](https://github.com/actions/jekyll-build-pages) | -| actions/setup-node@v4.1.0 | Oct 24, 2024 | [actions/setup-node: Set up your GitHub Actions workflow with a specific version of node.js](https://github.com/actions/setup-node) | -| actions/upload-artifact@v4.4.3 | Oct 9, 2024 14 | [actions/upload-artifact](https://github.com/actions/upload-artifact) | -| actions/upload-pages-artifact@v3.0.1 | Feb 7, 2024 | [actions/upload-pages-artifact: A composite action for packaging and uploading an artifact that can be deployed to GitHub Pages.](https://github.com/actions/upload-pages-artifact) | -| amannn/action-semantic-pull-request@v5.5.3 | Jun 28, 2024 | [amannn/action-semantic-pull-request: A GitHub Action that ensures that your PR title matches the Conventional Commits spec](https://github.com/amannn/action-semantic-pull-request) | -| github/codeql-action/analyze@v2.19.4 | Dec 2, 2024 | [github/codeql-action: Actions for running CodeQL analysis](https://github.com/github/codeql-action) | -| github/codeql-action/autobuild@v2.19.4 | Dec 2, 2024 | [github/codeql-action: Actions for running CodeQL analysis](https://github.com/github/codeql-action) | -| github/codeql-action/init@v2.19.4 | Dec 2, 2024 | [github/codeql-action: Actions for running CodeQL analysis](https://github.com/github/codeql-action) | -| github/codeql-action/upload-sarif@v2.19.4 | Dec 2, 2024 | [github/codeql-action: Actions for running CodeQL analysis](https://github.com/github/codeql-action) | -| googleapis/release-please-action@4.1.3 | Jun 10, 2024 | [googleapis/release-please-action: automated releases based on conventional commits](https://github.com/googleapis/release-please-action) -| googleapis/release-please@v16.15.0 | Dec 2, 2024 | [googleapis/release-please: generate release PRs based on the conventionalcommits.org spec](https://github.com/googleapis/release-please) | -| lowlighter/metrics@3.34 | Sep 12, 2023 | [lowlighter/metrics: 📊 An infographics generator with 30+ plugins and 300+ options to display stats about your GitHub account and render them as SVG, Markdown, PDF or JSON!](https://github.com/lowlighter/metrics) | -| ossf/scorecard-action@v2.4.0 | Jul 26, 2024 | [ossf/scorecard-action: Official GitHub Action for OpenSSF Scorecard.](https://github.com/ossf/scorecard-action) | -| ruby/setup-ruby@v1.203.0 | Dec 6, 2024 | [ruby/setup-ruby: An action to download a prebuilt Ruby and add it to the PATH in 5 seconds](https://github.com/ruby/setup-ruby) | -| step-security/harden-runner@v2.10.2 | Nov 18, 2024 | [step-security/harden-runner: Network egress filtering and runtime security for GitHub-hosted and self-hosted runners](https://github.com/step-security/harden-runner) | diff --git a/.github/workflows/Accounts.yml b/.github/workflows/Accounts.yml deleted file mode 100644 index 1c2f5d28..00000000 --- a/.github/workflows/Accounts.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Convert markdown to Word (Accounts) -on: - push: - branches: - ["main"] - pull_request: - branches: - ["main"] - -jobs: - convert_via_pandoc: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - #node-version: 'node16' - ref: ${{ github.event.push.head.ref }} - - uses: docker://pandoc/core:3.6.1 - with: - args: >- # allows you to break string into multiple lines - --standalone - --output=Accounts.docx - Accounts.md - - name: ⤴ Commit updated version - run: | - git pull 'https://${{secrets.GITHUB_TOKEN}}@github.com/RalphHightower/EOL-RalphHightower.git' - git config remote.origin.url 'https://${{secrets.GITHUB_TOKEN}}@github.com/RalphHightower/EOL-RalphHightower.git' - git config user.name RalphHightower - git config user.email ralph.hightower@gmail.com - git add . - git commit -am "Update Document for Accounts" - git push diff --git a/.github/workflows/Assets.yml b/.github/workflows/Assets.yml deleted file mode 100644 index a12a2784..00000000 --- a/.github/workflows/Assets.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Convert markdown to Word (Assets) -on: - push: - branches: - ["main"] - pull_request: - branches: - ["main"] - -jobs: - convert_via_pandoc: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - #node-version: 'node16' - ref: ${{ github.event.push.head.ref }} - - uses: docker://pandoc/core:3.6.1 - with: - args: >- # allows you to break string into multiple lines - --standalone - --output=Assets.docx - Assets.md - - name: ⤴ Commit updated version - run: | - git pull 'https://${{secrets.GITHUB_TOKEN}}@github.com/RalphHightower/EOL-RalphHightower.git' - git config remote.origin.url 'https://${{secrets.GITHUB_TOKEN}}@github.com/RalphHightower/EOL-RalphHightower.git' - git config user.name RalphHightower - git config user.email ralph.hightower@gmail.com - git add . - git commit -am "Update Document for Assets" - git push diff --git a/.github/workflows/BeagleIdentificationPhotos.yml b/.github/workflows/BeagleIdentificationPhotos.yml deleted file mode 100644 index f9df9b74..00000000 --- a/.github/workflows/BeagleIdentificationPhotos.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Convert markdown to Word (Beagle Identification Photos) -on: - push: - branches: - ["main"] - pull_request: - branches: - ["main"] -jobs: - convert_via_pandoc: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - #node-version: 'node16' - ref: ${{ github.event.push.head.ref }} - - uses: docker://pandoc/core:3.6.1 - with: - args: >- # allows you to break string into multiple lines - --standalone - --output=BeagleIdentificationPhotos.docx - BeagleIdentificationPhotos.md - - name: ⤴ Commit updated version - run: | - git pull 'https://${{secrets.GITHUB_TOKEN}}@github.com/RalphHightower/EOL-RalphHightower.git' - git config remote.origin.url 'https://${{secrets.GITHUB_TOKEN}}@github.com/RalphHightower/EOL-RalphHightower.git' - git config user.name RalphHightower - git config user.email ralph.hightower@gmail.com - git add . - git commit -am "Update Document for Beagles" - git push diff --git a/.github/workflows/Beagles.yml b/.github/workflows/Beagles.yml deleted file mode 100644 index 90f98b63..00000000 --- a/.github/workflows/Beagles.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Convert markdown to Word (Beagles) -on: - push: - branches: - ["main"] - pull_request: - branches: - ["main"] -jobs: - convert_via_pandoc: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - #node-version: 'node16' - ref: ${{ github.event.push.head.ref }} - - uses: docker://pandoc/core:3.6.1 - with: - args: >- # allows you to break string into multiple lines - --standalone - --output=Beagles.docx - Beagles.md - - name: ⤴ Commit updated version - run: | - git pull 'https://${{secrets.GITHUB_TOKEN}}@github.com/RalphHightower/EOL-RalphHightower.git' - git config remote.origin.url 'https://${{secrets.GITHUB_TOKEN}}@github.com/RalphHightower/EOL-RalphHightower.git' - git config user.name RalphHightower - git config user.email ralph.hightower@gmail.com - git add . - git commit -am "Update Document for Beagles" - git push diff --git a/.github/workflows/ComputerSettings.yml b/.github/workflows/ComputerSettings.yml deleted file mode 100644 index cbcf64f5..00000000 --- a/.github/workflows/ComputerSettings.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Convert markdown to Word (ComputerSettings) -on: - push: - branches: - ["main"] - pull_request: - branches: - ["main"] - -jobs: - convert_via_pandoc: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - #node-version: 'node16' - ref: ${{ github.event.push.head.ref }} - - uses: docker://pandoc/core:3.6.1 - with: - args: >- # allows you to break string into multiple lines - --standalone - --output=ComputerSettings.docx - ComputerSettings.md - - name: ⤴ Commit updated version - run: | - git pull 'https://${{secrets.GITHUB_TOKEN}}@github.com/RalphHightower/EOL-RalphHightower.git' - git config remote.origin.url 'https://${{secrets.GITHUB_TOKEN}}@github.com/RalphHightower/EOL-RalphHightower.git' - git config user.name RalphHightower - git config user.email ralph.hightower@gmail.com - git add . - git commit -am "Update Document for ComputerSettings" - git push diff --git a/.github/workflows/EquipmentDistrbution.yml b/.github/workflows/EquipmentDistrbution.yml deleted file mode 100644 index b49de52b..00000000 --- a/.github/workflows/EquipmentDistrbution.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Convert markdown to Word (EquipmentDistrbution) -on: - push: - branches: - ["main"] - pull_request: - branches: - ["main"] - -jobs: - convert_via_pandoc: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - #node-version: 'node16' - ref: ${{ github.event.push.head.ref }} - - uses: docker://pandoc/core:3.6.1 - with: - args: >- # allows you to break string into multiple lines - --standalone - --output=EquipmentDisposition.docx - EquipmentDisposition.md - - name: ⤴ Commit updated version - run: | - git pull 'https://${{secrets.GITHUB_TOKEN}}@github.com/RalphHightower/EOL-RalphHightower.git' - git config remote.origin.url 'https://${{secrets.GITHUB_TOKEN}}@github.com/RalphHightower/EOL-RalphHightower.git' - git config user.name RalphHightower - git config user.email ralph.hightower@gmail.com - git add . - git commit -am "Update Document for EquipmentDistrbution" - git push - - diff --git a/.github/workflows/NetworkSettings.yml b/.github/workflows/NetworkSettings.yml deleted file mode 100644 index dc9d3c85..00000000 --- a/.github/workflows/NetworkSettings.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Convert markdown to Word (NetworkSettings) -on: - push: - branches: - ["main"] - pull_request: - branches: - ["main"] - -env: - CELLPHONE: ${{ secrets.CELLPHONE }} - BIRTHDATE: ${{ secrets.BIRTHDATE }} - -jobs: - convert_via_pandoc: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - #node-version: 'node16' - ref: ${{ github.event.push.head.ref }} - - uses: docker://pandoc/core:3.6.1 - with: - args: >- # allows you to break string into multiple lines - --standalone - --output=NetworkSettings.docx - NetworkSettings.md - - name: ⤴ Commit updated version - run: | - git pull 'https://${{secrets.GITHUB_TOKEN}}@github.com/RalphHightower/EOL-RalphHightower.git' - git config remote.origin.url 'https://${{secrets.GITHUB_TOKEN}}@github.com/RalphHightower/EOL-RalphHightower.git' - git config user.name RalphHightower - git config user.email ralph.hightower@gmail.com - git add . - git commit -am "Update Document for NetworkSettings" - git push diff --git a/.github/workflows/Obituary.yml b/.github/workflows/Obituary.yml deleted file mode 100644 index 726abb00..00000000 --- a/.github/workflows/Obituary.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Convert markdown to Word (Obituary) -on: - push: - branches: - ["main"] - pull_request: - branches: - ["main"] -jobs: - convert_via_pandoc: - #env: - # birthdate: ${{ secrets BIRTHDATE }} - # cellphone: ${{ secrets.CELLPHONE }} - - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - #node-version: 'node16' - ref: ${{ github.event.push.head.ref }} - #node-version: 'node16' - - uses: docker://pandoc/core:3.6.1 - with: - args: >- # allows you to break string into multiple lines - cellphone: ${{secrets.CELL_PHONE}} - birthdate: ${{secrets.BIRTH_DATE}} - --standalone - --output=Obituary.docx - Obituary.md - - name: ⤴ Commit updated version - run: | - env: - cellphone: ${{secrets.CELLPHONE}} - birthdate: ${{secrets.BIRTHDATE}} - git pull 'https://${{secrets.GITHUB_TOKEN}}@github.com/RalphHightower/EOL-RalphHightower.git' - git config remote.origin.url 'https://${{secrets.GITHUB_TOKEN}}@github.com/RalphHightower/EOL-RalphHightower.git' - git config user.name RalphHightower - git config user.email ralph.hightower@gmail.com - git add . - git commit -am "Update Document for Obituary" - git push - -####### diff --git a/.github/workflows/SongsForService.yml b/.github/workflows/SongsForService.yml deleted file mode 100644 index eb785b87..00000000 --- a/.github/workflows/SongsForService.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Convert markdown to Word (SongsForService) -on: - push: - branches: - ["main"] - pull_request: - branches: - ["main"] - -jobs: - convert_via_pandoc: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - #node-version: 'node16' - ref: ${{ github.event.push.head.ref }} - - uses: docker://pandoc/core:3.6.1 - with: - args: >- # allows you to break string into multiple lines - --standalone - --output=SongsForService.docx - SongsForService.md - - name: ⤴ Commit updated version - run: | - git pull 'https://${{secrets.GITHUB_TOKEN}}@github.com/RalphHightower/EOL-RalphHightower.git' - git config remote.origin.url 'https://${{secrets.GITHUB_TOKEN}}@github.com/RalphHightower/EOL-RalphHightower.git' - git config user.name RalphHightower - git config user.email ralph.hightower@gmail.com - git add . - git commit -am "Update Document for SongsForService" - git push diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yml similarity index 100% rename from .github/workflows/ci.yaml rename to .github/workflows/ci.yml diff --git a/.github/workflows/dependabot.txt b/.github/workflows/dependabot.txt deleted file mode 100644 index 35221670..00000000 --- a/.github/workflows/dependabot.txt +++ /dev/null @@ -1,46 +0,0 @@ -# Basic `dependabot.yml` file with -# minimum configuration for two package managers - -version: 2 -updates: - # Enable version updates for npm - - package-ecosystem: "npm" - # Look for `package.json` and `lock` files in the `root` directory - directory: "/" - # Check the npm registry for updates every day (weekdays) - schedule: - interval: "daily" - commit-message: - prefix: "[info](sec) npm: " - - # Enable version updates for Docker - - package-ecosystem: "docker" - # Look for a `Dockerfile` in the `root` directory - directory: "/" - # Check for updates once a week - schedule: - interval: "weekly" - commit-message: - prefix: "[info](sec) docker: " - - # Enable version updates for GitHub Actions - - package-ecosystem: "github-actions" - # Workflow files stored in the default location of `.github/workflows` - # You don't need to specify `/.github/workflows` for `directory`. You can use `directory: "/"`. - directory: "/" - schedule: - interval: "weekly" - commit-message: - prefix: "[info](sec) gh-action: " - - # Enable version updates for Ruby - - package-ecosystem: "bundler" - # Look for `Ruby Gems` in the following directories - # directories: - # - "/" - # - "_plugins" - # Check for updates once a week - schedule: - interval: "weekly" - commit-message: - prefix: "[info](sec) bundler: " diff --git a/get-docker.sh b/get-docker.sh new file mode 100644 index 00000000..bf99f428 --- /dev/null +++ b/get-docker.sh @@ -0,0 +1,753 @@ +#!/bin/sh +set -e +# Docker Engine for Linux installation script. +# +# This script is intended as a convenient way to configure docker's package +# repositories and to install Docker Engine, This script is not recommended +# for production environments. Before running this script, make yourself familiar +# with potential risks and limitations, and refer to the installation manual +# at https://docs.docker.com/engine/install/ for alternative installation methods. +# +# The script: +# +# - Requires `root` or `sudo` privileges to run. +# - Attempts to detect your Linux distribution and version and configure your +# package management system for you. +# - Doesn't allow you to customize most installation parameters. +# - Installs dependencies and recommendations without asking for confirmation. +# - Installs the latest stable release (by default) of Docker CLI, Docker Engine, +# Docker Buildx, Docker Compose, containerd, and runc. When using this script +# to provision a machine, this may result in unexpected major version upgrades +# of these packages. Always test upgrades in a test environment before +# deploying to your production systems. +# - Isn't designed to upgrade an existing Docker installation. When using the +# script to update an existing installation, dependencies may not be updated +# to the expected version, resulting in outdated versions. +# +# Source code is available at https://github.com/docker/docker-install/ +# +# Usage +# ============================================================================== +# +# To install the latest stable versions of Docker CLI, Docker Engine, and their +# dependencies: +# +# 1. download the script +# +# $ curl -fsSL https://get.docker.com -o install-docker.sh +# +# 2. verify the script's content +# +# $ cat install-docker.sh +# +# 3. run the script with --dry-run to verify the steps it executes +# +# $ sh install-docker.sh --dry-run +# +# 4. run the script either as root, or using sudo to perform the installation. +# +# $ sudo sh install-docker.sh +# +# Command-line options +# ============================================================================== +# +# --version +# Use the --version option to install a specific version, for example: +# +# $ sudo sh install-docker.sh --version 23.0 +# +# --channel +# +# Use the --channel option to install from an alternative installation channel. +# The following example installs the latest versions from the "test" channel, +# which includes pre-releases (alpha, beta, rc): +# +# $ sudo sh install-docker.sh --channel test +# +# Alternatively, use the script at https://test.docker.com, which uses the test +# channel as default. +# +# --mirror +# +# Use the --mirror option to install from a mirror supported by this script. +# Available mirrors are "Aliyun" (https://mirrors.aliyun.com/docker-ce), and +# "AzureChinaCloud" (https://mirror.azure.cn/docker-ce), for example: +# +# $ sudo sh install-docker.sh --mirror AzureChinaCloud +# +# ============================================================================== + + +# Git commit from https://github.com/docker/docker-install when +# the script was uploaded (Should only be modified by upload job): +SCRIPT_COMMIT_SHA="4c94a56999e10efcf48c5b8e3f6afea464f9108e" + +# strip "v" prefix if present +VERSION="${VERSION#v}" + +# The channel to install from: +# * stable +# * test +DEFAULT_CHANNEL_VALUE="stable" +if [ -z "$CHANNEL" ]; then + CHANNEL=$DEFAULT_CHANNEL_VALUE +fi + +DEFAULT_DOWNLOAD_URL="https://download.docker.com" +if [ -z "$DOWNLOAD_URL" ]; then + DOWNLOAD_URL=$DEFAULT_DOWNLOAD_URL +fi + +DEFAULT_REPO_FILE="docker-ce.repo" +if [ -z "$REPO_FILE" ]; then + REPO_FILE="$DEFAULT_REPO_FILE" +fi + +mirror='' +DRY_RUN=${DRY_RUN:-} +while [ $# -gt 0 ]; do + case "$1" in + --channel) + CHANNEL="$2" + shift + ;; + --dry-run) + DRY_RUN=1 + ;; + --mirror) + mirror="$2" + shift + ;; + --version) + VERSION="${2#v}" + shift + ;; + --*) + echo "Illegal option $1" + ;; + esac + shift $(( $# > 0 ? 1 : 0 )) +done + +case "$mirror" in + Aliyun) + DOWNLOAD_URL="https://mirrors.aliyun.com/docker-ce" + ;; + AzureChinaCloud) + DOWNLOAD_URL="https://mirror.azure.cn/docker-ce" + ;; + "") + ;; + *) + >&2 echo "unknown mirror '$mirror': use either 'Aliyun', or 'AzureChinaCloud'." + exit 1 + ;; +esac + +case "$CHANNEL" in + stable|test) + ;; + *) + >&2 echo "unknown CHANNEL '$CHANNEL': use either stable or test." + exit 1 + ;; +esac + +command_exists() { + command -v "$@" > /dev/null 2>&1 +} + +# version_gte checks if the version specified in $VERSION is at least the given +# SemVer (Maj.Minor[.Patch]), or CalVer (YY.MM) version.It returns 0 (success) +# if $VERSION is either unset (=latest) or newer or equal than the specified +# version, or returns 1 (fail) otherwise. +# +# examples: +# +# VERSION=23.0 +# version_gte 23.0 // 0 (success) +# version_gte 20.10 // 0 (success) +# version_gte 19.03 // 0 (success) +# version_gte 26.1 // 1 (fail) +version_gte() { + if [ -z "$VERSION" ]; then + return 0 + fi + version_compare "$VERSION" "$1" +} + +# version_compare compares two version strings (either SemVer (Major.Minor.Path), +# or CalVer (YY.MM) version strings. It returns 0 (success) if version A is newer +# or equal than version B, or 1 (fail) otherwise. Patch releases and pre-release +# (-alpha/-beta) are not taken into account +# +# examples: +# +# version_compare 23.0.0 20.10 // 0 (success) +# version_compare 23.0 20.10 // 0 (success) +# version_compare 20.10 19.03 // 0 (success) +# version_compare 20.10 20.10 // 0 (success) +# version_compare 19.03 20.10 // 1 (fail) +version_compare() ( + set +x + + yy_a="$(echo "$1" | cut -d'.' -f1)" + yy_b="$(echo "$2" | cut -d'.' -f1)" + if [ "$yy_a" -lt "$yy_b" ]; then + return 1 + fi + if [ "$yy_a" -gt "$yy_b" ]; then + return 0 + fi + mm_a="$(echo "$1" | cut -d'.' -f2)" + mm_b="$(echo "$2" | cut -d'.' -f2)" + + # trim leading zeros to accommodate CalVer + mm_a="${mm_a#0}" + mm_b="${mm_b#0}" + + if [ "${mm_a:-0}" -lt "${mm_b:-0}" ]; then + return 1 + fi + + return 0 +) + +is_dry_run() { + if [ -z "$DRY_RUN" ]; then + return 1 + else + return 0 + fi +} + +is_wsl() { + case "$(uname -r)" in + *microsoft* ) true ;; # WSL 2 + *Microsoft* ) true ;; # WSL 1 + * ) false;; + esac +} + +is_darwin() { + case "$(uname -s)" in + *darwin* ) true ;; + *Darwin* ) true ;; + * ) false;; + esac +} + +deprecation_notice() { + distro=$1 + distro_version=$2 + echo + printf "\033[91;1mDEPRECATION WARNING\033[0m\n" + printf " This Linux distribution (\033[1m%s %s\033[0m) reached end-of-life and is no longer supported by this script.\n" "$distro" "$distro_version" + echo " No updates or security fixes will be released for this distribution, and users are recommended" + echo " to upgrade to a currently maintained version of $distro." + echo + printf "Press \033[1mCtrl+C\033[0m now to abort this script, or wait for the installation to continue." + echo + sleep 10 +} + +get_distribution() { + lsb_dist="" + # Every system that we officially support has /etc/os-release + if [ -r /etc/os-release ]; then + lsb_dist="$(. /etc/os-release && echo "$ID")" + fi + # Returning an empty string here should be alright since the + # case statements don't act unless you provide an actual value + echo "$lsb_dist" +} + +echo_docker_as_nonroot() { + if is_dry_run; then + return + fi + if command_exists docker && [ -e /var/run/docker.sock ]; then + ( + set -x + $sh_c 'docker version' + ) || true + fi + + # intentionally mixed spaces and tabs here -- tabs are stripped by "<<-EOF", spaces are kept in the output + echo + echo "================================================================================" + echo + if version_gte "20.10"; then + echo "To run Docker as a non-privileged user, consider setting up the" + echo "Docker daemon in rootless mode for your user:" + echo + echo " dockerd-rootless-setuptool.sh install" + echo + echo "Visit https://docs.docker.com/go/rootless/ to learn about rootless mode." + echo + fi + echo + echo "To run the Docker daemon as a fully privileged service, but granting non-root" + echo "users access, refer to https://docs.docker.com/go/daemon-access/" + echo + echo "WARNING: Access to the remote API on a privileged Docker daemon is equivalent" + echo " to root access on the host. Refer to the 'Docker daemon attack surface'" + echo " documentation for details: https://docs.docker.com/go/attack-surface/" + echo + echo "================================================================================" + echo +} + +# Check if this is a forked Linux distro +check_forked() { + + # Check for lsb_release command existence, it usually exists in forked distros + if command_exists lsb_release; then + # Check if the `-u` option is supported + set +e + lsb_release -a -u > /dev/null 2>&1 + lsb_release_exit_code=$? + set -e + + # Check if the command has exited successfully, it means we're in a forked distro + if [ "$lsb_release_exit_code" = "0" ]; then + # Print info about current distro + cat <<-EOF + You're using '$lsb_dist' version '$dist_version'. + EOF + + # Get the upstream release info + lsb_dist=$(lsb_release -a -u 2>&1 | tr '[:upper:]' '[:lower:]' | grep -E 'id' | cut -d ':' -f 2 | tr -d '[:space:]') + dist_version=$(lsb_release -a -u 2>&1 | tr '[:upper:]' '[:lower:]' | grep -E 'codename' | cut -d ':' -f 2 | tr -d '[:space:]') + + # Print info about upstream distro + cat <<-EOF + Upstream release is '$lsb_dist' version '$dist_version'. + EOF + else + if [ -r /etc/debian_version ] && [ "$lsb_dist" != "ubuntu" ] && [ "$lsb_dist" != "raspbian" ]; then + if [ "$lsb_dist" = "osmc" ]; then + # OSMC runs Raspbian + lsb_dist=raspbian + else + # We're Debian and don't even know it! + lsb_dist=debian + fi + dist_version="$(sed 's/\/.*//' /etc/debian_version | sed 's/\..*//')" + case "$dist_version" in + 12) + dist_version="bookworm" + ;; + 11) + dist_version="bullseye" + ;; + 10) + dist_version="buster" + ;; + 9) + dist_version="stretch" + ;; + 8) + dist_version="jessie" + ;; + esac + fi + fi + fi +} + +do_install() { + echo "# Executing docker install script, commit: $SCRIPT_COMMIT_SHA" + + if command_exists docker; then + cat >&2 <<-'EOF' + Warning: the "docker" command appears to already exist on this system. + + If you already have Docker installed, this script can cause trouble, which is + why we're displaying this warning and provide the opportunity to cancel the + installation. + + If you installed the current Docker package using this script and are using it + again to update Docker, you can ignore this message, but be aware that the + script resets any custom changes in the deb and rpm repo configuration + files to match the parameters passed to the script. + + You may press Ctrl+C now to abort this script. + EOF + ( set -x; sleep 20 ) + fi + + user="$(id -un 2>/dev/null || true)" + + sh_c='sh -c' + if [ "$user" != 'root' ]; then + if command_exists sudo; then + sh_c='sudo -E sh -c' + elif command_exists su; then + sh_c='su -c' + else + cat >&2 <<-'EOF' + Error: this installer needs the ability to run commands as root. + We are unable to find either "sudo" or "su" available to make this happen. + EOF + exit 1 + fi + fi + + if is_dry_run; then + sh_c="echo" + fi + + # perform some very rudimentary platform detection + lsb_dist=$( get_distribution ) + lsb_dist="$(echo "$lsb_dist" | tr '[:upper:]' '[:lower:]')" + + if is_wsl; then + echo + echo "WSL DETECTED: We recommend using Docker Desktop for Windows." + echo "Please get Docker Desktop from https://www.docker.com/products/docker-desktop/" + echo + cat >&2 <<-'EOF' + + You may press Ctrl+C now to abort this script. + EOF + ( set -x; sleep 20 ) + fi + + case "$lsb_dist" in + + ubuntu) + if command_exists lsb_release; then + dist_version="$(lsb_release --codename | cut -f2)" + fi + if [ -z "$dist_version" ] && [ -r /etc/lsb-release ]; then + dist_version="$(. /etc/lsb-release && echo "$DISTRIB_CODENAME")" + fi + ;; + + debian|raspbian) + dist_version="$(sed 's/\/.*//' /etc/debian_version | sed 's/\..*//')" + case "$dist_version" in + 12) + dist_version="bookworm" + ;; + 11) + dist_version="bullseye" + ;; + 10) + dist_version="buster" + ;; + 9) + dist_version="stretch" + ;; + 8) + dist_version="jessie" + ;; + esac + ;; + + centos|rhel) + if [ -z "$dist_version" ] && [ -r /etc/os-release ]; then + dist_version="$(. /etc/os-release && echo "$VERSION_ID")" + fi + ;; + + *) + if command_exists lsb_release; then + dist_version="$(lsb_release --release | cut -f2)" + fi + if [ -z "$dist_version" ] && [ -r /etc/os-release ]; then + dist_version="$(. /etc/os-release && echo "$VERSION_ID")" + fi + ;; + + esac + + # Check if this is a forked Linux distro + check_forked + + # Print deprecation warnings for distro versions that recently reached EOL, + # but may still be commonly used (especially LTS versions). + case "$lsb_dist.$dist_version" in + centos.8|centos.7|rhel.7) + deprecation_notice "$lsb_dist" "$dist_version" + ;; + debian.buster|debian.stretch|debian.jessie) + deprecation_notice "$lsb_dist" "$dist_version" + ;; + raspbian.buster|raspbian.stretch|raspbian.jessie) + deprecation_notice "$lsb_dist" "$dist_version" + ;; + ubuntu.bionic|ubuntu.xenial|ubuntu.trusty) + deprecation_notice "$lsb_dist" "$dist_version" + ;; + ubuntu.mantic|ubuntu.lunar|ubuntu.kinetic|ubuntu.impish|ubuntu.hirsute|ubuntu.groovy|ubuntu.eoan|ubuntu.disco|ubuntu.cosmic) + deprecation_notice "$lsb_dist" "$dist_version" + ;; + fedora.*) + if [ "$dist_version" -lt 40 ]; then + deprecation_notice "$lsb_dist" "$dist_version" + fi + ;; + esac + + # Run setup for each distro accordingly + case "$lsb_dist" in + ubuntu|debian|raspbian) + pre_reqs="ca-certificates curl" + apt_repo="deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] $DOWNLOAD_URL/linux/$lsb_dist $dist_version $CHANNEL" + ( + if ! is_dry_run; then + set -x + fi + $sh_c 'apt-get -qq update >/dev/null' + $sh_c "DEBIAN_FRONTEND=noninteractive apt-get -y -qq install $pre_reqs >/dev/null" + $sh_c 'install -m 0755 -d /etc/apt/keyrings' + $sh_c "curl -fsSL \"$DOWNLOAD_URL/linux/$lsb_dist/gpg\" -o /etc/apt/keyrings/docker.asc" + $sh_c "chmod a+r /etc/apt/keyrings/docker.asc" + $sh_c "echo \"$apt_repo\" > /etc/apt/sources.list.d/docker.list" + $sh_c 'apt-get -qq update >/dev/null' + ) + pkg_version="" + if [ -n "$VERSION" ]; then + if is_dry_run; then + echo "# WARNING: VERSION pinning is not supported in DRY_RUN" + else + # Will work for incomplete versions IE (17.12), but may not actually grab the "latest" if in the test channel + pkg_pattern="$(echo "$VERSION" | sed 's/-ce-/~ce~.*/g' | sed 's/-/.*/g')" + search_command="apt-cache madison docker-ce | grep '$pkg_pattern' | head -1 | awk '{\$1=\$1};1' | cut -d' ' -f 3" + pkg_version="$($sh_c "$search_command")" + echo "INFO: Searching repository for VERSION '$VERSION'" + echo "INFO: $search_command" + if [ -z "$pkg_version" ]; then + echo + echo "ERROR: '$VERSION' not found amongst apt-cache madison results" + echo + exit 1 + fi + if version_gte "18.09"; then + search_command="apt-cache madison docker-ce-cli | grep '$pkg_pattern' | head -1 | awk '{\$1=\$1};1' | cut -d' ' -f 3" + echo "INFO: $search_command" + cli_pkg_version="=$($sh_c "$search_command")" + fi + pkg_version="=$pkg_version" + fi + fi + ( + pkgs="docker-ce${pkg_version%=}" + if version_gte "18.09"; then + # older versions didn't ship the cli and containerd as separate packages + pkgs="$pkgs docker-ce-cli${cli_pkg_version%=} containerd.io" + fi + if version_gte "20.10"; then + pkgs="$pkgs docker-compose-plugin docker-ce-rootless-extras$pkg_version" + fi + if version_gte "23.0"; then + pkgs="$pkgs docker-buildx-plugin" + fi + if ! is_dry_run; then + set -x + fi + $sh_c "DEBIAN_FRONTEND=noninteractive apt-get -y -qq install $pkgs >/dev/null" + ) + echo_docker_as_nonroot + exit 0 + ;; + centos|fedora|rhel) + repo_file_url="$DOWNLOAD_URL/linux/$lsb_dist/$REPO_FILE" + ( + if ! is_dry_run; then + set -x + fi + if command_exists dnf5; then + $sh_c "dnf -y -q --setopt=install_weak_deps=False install dnf-plugins-core" + $sh_c "dnf5 config-manager addrepo --overwrite --save-filename=docker-ce.repo --from-repofile='$repo_file_url'" + + if [ "$CHANNEL" != "stable" ]; then + $sh_c "dnf5 config-manager setopt \"docker-ce-*.enabled=0\"" + $sh_c "dnf5 config-manager setopt \"docker-ce-$CHANNEL.enabled=1\"" + fi + $sh_c "dnf makecache" + elif command_exists dnf; then + $sh_c "dnf -y -q --setopt=install_weak_deps=False install dnf-plugins-core" + $sh_c "rm -f /etc/yum.repos.d/docker-ce.repo /etc/yum.repos.d/docker-ce-staging.repo" + $sh_c "dnf config-manager --add-repo $repo_file_url" + + if [ "$CHANNEL" != "stable" ]; then + $sh_c "dnf config-manager --set-disabled \"docker-ce-*\"" + $sh_c "dnf config-manager --set-enabled \"docker-ce-$CHANNEL\"" + fi + $sh_c "dnf makecache" + else + $sh_c "yum -y -q install yum-utils" + $sh_c "rm -f /etc/yum.repos.d/docker-ce.repo /etc/yum.repos.d/docker-ce-staging.repo" + $sh_c "yum-config-manager --add-repo $repo_file_url" + + if [ "$CHANNEL" != "stable" ]; then + $sh_c "yum-config-manager --disable \"docker-ce-*\"" + $sh_c "yum-config-manager --enable \"docker-ce-$CHANNEL\"" + fi + $sh_c "yum makecache" + fi + ) + pkg_version="" + if command_exists dnf; then + pkg_manager="dnf" + pkg_manager_flags="-y -q --best" + else + pkg_manager="yum" + pkg_manager_flags="-y -q" + fi + if [ -n "$VERSION" ]; then + if is_dry_run; then + echo "# WARNING: VERSION pinning is not supported in DRY_RUN" + else + if [ "$lsb_dist" = "fedora" ]; then + pkg_suffix="fc$dist_version" + else + pkg_suffix="el" + fi + pkg_pattern="$(echo "$VERSION" | sed 's/-ce-/\\\\.ce.*/g' | sed 's/-/.*/g').*$pkg_suffix" + search_command="$pkg_manager list --showduplicates docker-ce | grep '$pkg_pattern' | tail -1 | awk '{print \$2}'" + pkg_version="$($sh_c "$search_command")" + echo "INFO: Searching repository for VERSION '$VERSION'" + echo "INFO: $search_command" + if [ -z "$pkg_version" ]; then + echo + echo "ERROR: '$VERSION' not found amongst $pkg_manager list results" + echo + exit 1 + fi + if version_gte "18.09"; then + # older versions don't support a cli package + search_command="$pkg_manager list --showduplicates docker-ce-cli | grep '$pkg_pattern' | tail -1 | awk '{print \$2}'" + cli_pkg_version="$($sh_c "$search_command" | cut -d':' -f 2)" + fi + # Cut out the epoch and prefix with a '-' + pkg_version="-$(echo "$pkg_version" | cut -d':' -f 2)" + fi + fi + ( + pkgs="docker-ce$pkg_version" + if version_gte "18.09"; then + # older versions didn't ship the cli and containerd as separate packages + if [ -n "$cli_pkg_version" ]; then + pkgs="$pkgs docker-ce-cli-$cli_pkg_version containerd.io" + else + pkgs="$pkgs docker-ce-cli containerd.io" + fi + fi + if version_gte "20.10"; then + pkgs="$pkgs docker-compose-plugin docker-ce-rootless-extras$pkg_version" + fi + if version_gte "23.0"; then + pkgs="$pkgs docker-buildx-plugin" + fi + if ! is_dry_run; then + set -x + fi + $sh_c "$pkg_manager $pkg_manager_flags install $pkgs" + ) + echo_docker_as_nonroot + exit 0 + ;; + sles) + if [ "$(uname -m)" != "s390x" ]; then + echo "Packages for SLES are currently only available for s390x" + exit 1 + fi + repo_file_url="$DOWNLOAD_URL/linux/$lsb_dist/$REPO_FILE" + pre_reqs="ca-certificates curl libseccomp2 awk" + ( + if ! is_dry_run; then + set -x + fi + $sh_c "zypper install -y $pre_reqs" + $sh_c "rm -f /etc/zypp/repos.d/docker-ce-*.repo" + $sh_c "zypper addrepo $repo_file_url" + + opensuse_factory_url="https://download.opensuse.org/repositories/security:/SELinux/openSUSE_Factory/" + if ! zypper lr -d | grep -q "${opensuse_factory_url}"; then + opensuse_repo="${opensuse_factory_url}security:SELinux.repo" + if ! is_dry_run; then + cat >&2 <<- EOF + WARNING!! + openSUSE repository ($opensuse_repo) will be enabled now. + Do you wish to continue? + You may press Ctrl+C now to abort this script. + EOF + ( set -x; sleep 20 ) + fi + $sh_c "zypper addrepo $opensuse_repo" + fi + $sh_c "zypper --gpg-auto-import-keys refresh" + $sh_c "zypper lr -d" + ) + pkg_version="" + if [ -n "$VERSION" ]; then + if is_dry_run; then + echo "# WARNING: VERSION pinning is not supported in DRY_RUN" + else + pkg_pattern="$(echo "$VERSION" | sed 's/-ce-/\\\\.ce.*/g' | sed 's/-/.*/g')" + search_command="zypper search -s --match-exact 'docker-ce' | grep '$pkg_pattern' | tail -1 | awk '{print \$6}'" + pkg_version="$($sh_c "$search_command")" + echo "INFO: Searching repository for VERSION '$VERSION'" + echo "INFO: $search_command" + if [ -z "$pkg_version" ]; then + echo + echo "ERROR: '$VERSION' not found amongst zypper list results" + echo + exit 1 + fi + search_command="zypper search -s --match-exact 'docker-ce-cli' | grep '$pkg_pattern' | tail -1 | awk '{print \$6}'" + # It's okay for cli_pkg_version to be blank, since older versions don't support a cli package + cli_pkg_version="$($sh_c "$search_command")" + pkg_version="-$pkg_version" + fi + fi + ( + pkgs="docker-ce$pkg_version" + if version_gte "18.09"; then + if [ -n "$cli_pkg_version" ]; then + # older versions didn't ship the cli and containerd as separate packages + pkgs="$pkgs docker-ce-cli-$cli_pkg_version containerd.io" + else + pkgs="$pkgs docker-ce-cli containerd.io" + fi + fi + if version_gte "20.10"; then + pkgs="$pkgs docker-compose-plugin docker-ce-rootless-extras$pkg_version" + fi + if version_gte "23.0"; then + pkgs="$pkgs docker-buildx-plugin" + fi + if ! is_dry_run; then + set -x + fi + $sh_c "zypper -q install -y $pkgs" + ) + echo_docker_as_nonroot + exit 0 + ;; + *) + if [ -z "$lsb_dist" ]; then + if is_darwin; then + echo + echo "ERROR: Unsupported operating system 'macOS'" + echo "Please get Docker Desktop from https://www.docker.com/products/docker-desktop" + echo + exit 1 + fi + fi + echo + echo "ERROR: Unsupported distribution '$lsb_dist'" + echo + exit 1 + ;; + esac + exit 1 +} + +# wrapped up in a function so that we have some protection against only getting +# half the file during "curl | sh" +do_install