diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml new file mode 100644 index 0000000000..92bfc758f8 --- /dev/null +++ b/.github/workflows/deploy-docs.yml @@ -0,0 +1,54 @@ +name: Build and push CLI doc to S3 +on: + release: + types: + - published # Triggered only when a new release is published + branches: + - master +permissions: + contents: write +jobs: + deploy: + runs-on: ubuntu-latest + environment: actions # Is this necessary if we use the "env:" context below ? + steps: + - name: Check out the release tag + uses: actions/checkout@v4 + with: + ref: ${{ github.event.release.tag_name }} + - name: Verify release commit + run: | # Commit hash to compare with the commit returned by actions/checkout@v4 - Tag to compare with the latest releas + echo "Checked out commit: $(git rev-parse HEAD)" + echo "Expected tag: ${{ github.event.release.tag_name }}" + - name: prepare temporary folder for build + run: | # Creates a temporary "docs" folder within the existing "docs" folder because the mkdocs.yml must be in the parent folder of the markdown pages + cd docs + mkdir docs + cp commands/* docs/ + cp -r static_files/* docs/ + - name: Pull Material for MKdocs image and build doc + run: | + docker pull squidfunk/mkdocs-material + docker run --rm -i -v ${PWD}/docs:/docs squidfunk/mkdocs-material build + - name: Download and set up AWS CLI + run: | + sudo apt-get update + sudo apt-get install -y awscli + + - name: Sety up AWS credentials + env: + CLI_DOC_ACCESS_KEY: ${{ secrets.CLI_DOC_ACCESS_KEY }} + CLI_DOC_SECRET_KEY: ${{ secrets.CLI_DOC_SECRET_KEY }} + run: | # AWS region "fr-par" is a placeholder as the CLI_DOC_S3_ENDPOINT variable overrides it + aws configure set aws_access_key_id $CLI_DOC_ACCESS_KEY + aws configure set aws_secret_access_key $CLI_DOC_SECRET_KEY + aws configure set region fr-par + + - name: Upload file to Scaleway Object Storage + env: + CLI_DOC_BUCKET_NAME: ${{ secrets.CLI_DOC_BUCKET_NAME }} + CLI_DOC_S3_ENDPOINT: ${{ secrets.CLI_DOC_S3_ENDPOINT }} + run: | + aws s3 cp --recursive ./docs/site/ s3://$CLI_DOC_BUCKET_NAME --endpoint-url $CLI_DOC_S3_ENDPOINT + - name: Delete temporary folder + run: rm -rf docs/docs/ diff --git a/docs/commands/index.md b/docs/commands/index.md new file mode 100644 index 0000000000..1cb72e0cdb --- /dev/null +++ b/docs/commands/index.md @@ -0,0 +1,149 @@ + + +# Scaleway CLI v2 Documentation + +

+ +

+ CircleCI + GoReportCard +

+ +Scaleway CLI is a tool to help you pilot your Scaleway infrastructure directly from your terminal. + +!!! warning + + This website is under construction and may contain out-of-date information. Refer to the [Scaleway CLI repository](https://github.com/scaleway/scaleway-cli) for the latest release. + +## Installation + +### With a Package Manager (Recommended) + +A package manager installs and upgrades the Scaleway CLI with a single command. +We recommend this installation mode for more simplicity and reliability: + +#### Homebrew + +Install the [latest stable release](https://formulae.brew.sh/formula/scw) on macOS/Linux using [Homebrew](http://brew.sh): + +```sh +brew install scw +``` + +#### Arch Linux + +Install the latest stable release on Arch Linux from [official repositories](https://archlinux.org/packages/extra/x86_64/scaleway-cli/). +For instance with `pacman`: + +```sh +pacman -S scaleway-cli +``` + +#### Chocolatey + +Install the latest stable release on Windows using [Chocolatey](https://chocolatey.org/) ([Package](https://chocolatey.org/packages/scaleway-cli)): + +```powershell +choco install scaleway-cli +``` + +### Manually + +#### Released Binaries + +We provide [static-compiled binaries](https://github.com/scaleway/scaleway-cli/releases/latest) for darwin (macOS), GNU/Linux, and Windows platforms. +You just have to download the binary compatible with your platform to a directory available in your `PATH`: + +##### Linux + +```bash +curl -s https://raw.githubusercontent.com/scaleway/scaleway-cli/master/scripts/get.sh | sh +``` + +##### Windows + +You can download the last release here:
+[This official guide](https://docs.microsoft.com/en-us/previous-versions/office/developer/sharepoint-2010/ee537574%28v%3Doffice.14%29) explains how to add tools to your `PATH`. + +### Docker Image + +You can use the CLI as you would run any Docker image: + +```sh +docker run -i --rm scaleway/cli:latest +``` + +See more in-depth information about running the CLI in Docker [here](./docs/docker.md) + +# Getting Started + +## Setup your configuration + +After you [installed](#Installation) the latest release just run the initialization command and let yourself be guided! :dancer: + +```bash +scw init +``` + +It will set up your profile, the authentication, and the auto-completion. + +## Basic commands + +``` +# Create an instance server +scw instance server create type=DEV1-S image=ubuntu_focal zone=fr-par-1 tags.0="scw-cli" + +# List your servers +scw instance server list + +# Create a Kubernetes cluster named foo with cilium as CNI, in version 1.17.4 and with a pool named default composed of 3 DEV1-M and with 2 tags +scw k8s cluster create name=foo version=1.17.4 pools.0.size=3 pools.0.node-type=DEV1-M pools.0.name=default tags.0=tag1 tags.1=tag2 +``` + +## Environment + +You can configure your config or enable functionalities with environment variables. + +Variables to override config are describe in [config documentation](docs/commands/config.md). +To enable beta features, you can set `SCW_ENABLE_BETA=1` in your environment. + +## Build it yourself + +### Build Locally + +If you have a >= Go 1.13 environment, you can install the `HEAD` version to test the latest features or to [contribute](./.github/CONTRIBUTING.md). +Note that this development version could include bugs, use [tagged releases](https://github.com/scaleway/scaleway-cli/releases/latest) if you need stability. + +```bash +go install github.com/scaleway/scaleway-cli/v2/cmd/scw@latest +``` + +Dependencies: We only use go [Modules](https://github.com/golang/go/wiki/Modules) with vendoring. + +### Build with Docker + +You can build the `scw` CLI with Docker. If you have Docker installed, you can run: + +```sh +docker build -t scaleway/cli . +``` + +Once built, you can then use the CLI as you would run any image: + +```sh +docker run -i --rm scaleway/cli +``` + +See more in-depth information about running the CLI in Docker [here](./docs/docker.md) + +# Development + +This repository is at its early stage and is still in active development. +If you are looking for a way to contribute please read [CONTRIBUTING.md](./.github/CONTRIBUTING.md). + +# Reach Us + +We love feedback. +Don't hesitate to open a [Github issue](https://github.com/scaleway/scaleway-cli/issues/new) or +feel free to reach us on [Scaleway Slack community](https://slack.scaleway.com/), +we are waiting for you on [#opensource](https://scaleway-community.slack.com/app_redirect?channel=opensource). diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml new file mode 100644 index 0000000000..7465eb5872 --- /dev/null +++ b/docs/mkdocs.yml @@ -0,0 +1,128 @@ +site_name: Scaleway Command Line Interface Documentation +site_url: https://mydomain.org/scaleway-cli-documentation +extra_css: + - stylesheets/extra.css +extra: + version: + provider: mike + + # Analytics and feedback system (placeholders) + analytics: + provider: google + property: G-XXXXXXXXXX + feedback: + title: Was this page helpful? + ratings: + - icon: material/emoticon-happy-outline + name: This page was helpful + data: 1 + note: >- + Thanks for your feedback! + - icon: material/emoticon-sad-outline + name: This page could be improved + data: 0 + note: >- + Thanks for your feedback! Help us improve this page by + referring to the feedback page. + +# GitHub integration configuration +repo_url: https://github.com/scaleway/scaleway-cli +repo_name: scaleway/scaleway-cli +edit_uri: edit/master/docs/commands/ + + +# Theme configuration +theme: + icon: + repo: fontawesome/brands/github + name: material + logo: assets/logo.svg + font: + text: Inter + palette: + # Palette toggle for light mode + - scheme: slate + primary: deep purple + accent: deep purple + toggle: + icon: material/toggle-switch + name: Switch to dark mode + + # Palette toggle for dark mode + - scheme: default + primary: deep purple + accent: deep purple + toggle: + icon: material/toggle-switch-off-outline + name: Switch to light mode + features: + - navigation.sections # Creates sections in left menu (default is collapsible block) + - content.code.copy # Enable Copy button on code blocks + - content.action.edit # Enable "Edit content" button on page + - content.action.view # Enable "View source" button on page + - navigation.top # Enables back to top button + - navigation.tracking # Automatically adds anchors to URL + - search.suggest # Add suggestions to search + + +markdown_extensions: + - admonition + - pymdownx.details + - pymdownx.superfences + +nav: + - Platform: + - Account: account.md + - Billing: billing.md + - IAM: iam.md + - Secret Manager: secret.md + - Marketplace: marketplace.md + - AI & Data: + - Managed Inference: inference.md + - Bare Metal: + - Elastic Metal: baremetal.md + - Apple Silicon: apple-silicon.md + - Flexible IP: fip.md + - Compute: + - Instances: instance.md + - Containers: + - Container Registry: registry.md + - Kubernetes: k8s.md + - Labs: + - IPFS Pinning: ipfs.md + - IPFS Naming: ipns.md + - Managed Databases: + - PostgreSQL and MySQL: rdb.md + - Redis™: redis.md + - Document Databases: document-db.md + - Managed Services: + - IOT Hub: iot.md + - Transactional Email: tem.md + - Web Hosting: webhosting.md + - Network: + - VPC: vpc.md + - Puvblic Gateway: vpc-gw.md + - IPAM: ipam.md + - Load Balancer: lb.md + - Domains and DNS: dns.md + - Observability: + - Cockpit: cockpit.md + - Serverless: + - Functions: function.md + - Containers: container.md + - Jobs: jobs.md + - SQL Databases: sdb-sql.md + - Messaging and Queuing: mnq.md + - Storage: + - BLock Storage: block.md + - Object Storage: object.md + - CLI configuration: + - Alias: alias.md + - Autocompletion: autocomplete.md + - Configuration: config.md + - Feedback: feedback.md + - Help: help.md + - Info: info.md + - Initialization: init.md + - Shell: shell.md + - Version: version.md diff --git a/docs/static_files/assets/cli-artwork.png b/docs/static_files/assets/cli-artwork.png new file mode 100644 index 0000000000..7f7e5a6fe1 Binary files /dev/null and b/docs/static_files/assets/cli-artwork.png differ diff --git a/docs/static_files/assets/logo.svg b/docs/static_files/assets/logo.svg new file mode 100644 index 0000000000..e027bb9052 --- /dev/null +++ b/docs/static_files/assets/logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/static_files/stylesheets/extra.css b/docs/static_files/stylesheets/extra.css new file mode 100644 index 0000000000..17e99161ed --- /dev/null +++ b/docs/static_files/stylesheets/extra.css @@ -0,0 +1,16 @@ +@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300..700&display=swap'); + +@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap'); + +body { + font-family: "Inter", sans-serif; +} + +li.md-nav__item{ + margin-left: .5rem; +} + +.md-typeset h1, h2, h3, h4, h5, h6{ + font-family: "Space Grotesk", sans-serif; +} +