Skip to content

Commit ff4f3ac

Browse files
feat(docs): Add minimum configuration for CLI docs PoC (#4136)
Co-authored-by: Jonathan R. <[email protected]>
1 parent a59cd36 commit ff4f3ac

File tree

6 files changed

+348
-0
lines changed

6 files changed

+348
-0
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Build and push CLI doc to S3
2+
on:
3+
release:
4+
types:
5+
- published # Triggered only when a new release is published
6+
branches:
7+
- master
8+
permissions:
9+
contents: write
10+
jobs:
11+
deploy:
12+
runs-on: ubuntu-latest
13+
environment: actions # Is this necessary if we use the "env:" context below ?
14+
steps:
15+
- name: Check out the release tag
16+
uses: actions/checkout@v4
17+
with:
18+
ref: ${{ github.event.release.tag_name }}
19+
- name: Verify release commit
20+
run: | # Commit hash to compare with the commit returned by actions/checkout@v4 - Tag to compare with the latest releas
21+
echo "Checked out commit: $(git rev-parse HEAD)"
22+
echo "Expected tag: ${{ github.event.release.tag_name }}"
23+
- name: prepare temporary folder for build
24+
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
25+
cd docs
26+
mkdir docs
27+
cp commands/* docs/
28+
cp -r static_files/* docs/
29+
- name: Pull Material for MKdocs image and build doc
30+
run: |
31+
docker pull squidfunk/mkdocs-material
32+
docker run --rm -i -v ${PWD}/docs:/docs squidfunk/mkdocs-material build
33+
- name: Download and set up AWS CLI
34+
run: |
35+
sudo apt-get update
36+
sudo apt-get install -y awscli
37+
38+
- name: Sety up AWS credentials
39+
env:
40+
CLI_DOC_ACCESS_KEY: ${{ secrets.CLI_DOC_ACCESS_KEY }}
41+
CLI_DOC_SECRET_KEY: ${{ secrets.CLI_DOC_SECRET_KEY }}
42+
run: | # AWS region "fr-par" is a placeholder as the CLI_DOC_S3_ENDPOINT variable overrides it
43+
aws configure set aws_access_key_id $CLI_DOC_ACCESS_KEY
44+
aws configure set aws_secret_access_key $CLI_DOC_SECRET_KEY
45+
aws configure set region fr-par
46+
47+
- name: Upload file to Scaleway Object Storage
48+
env:
49+
CLI_DOC_BUCKET_NAME: ${{ secrets.CLI_DOC_BUCKET_NAME }}
50+
CLI_DOC_S3_ENDPOINT: ${{ secrets.CLI_DOC_S3_ENDPOINT }}
51+
run: |
52+
aws s3 cp --recursive ./docs/site/ s3://$CLI_DOC_BUCKET_NAME --endpoint-url $CLI_DOC_S3_ENDPOINT
53+
- name: Delete temporary folder
54+
run: rm -rf docs/docs/

docs/commands/index.md

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
<!-- This file was created manually and acts as the landing page for the CLI documentation website. Removing it will break the documentation build. -->
2+
3+
# Scaleway CLI v2 Documentation
4+
5+
<p align="center"><img width="50%" src="assets/cli-artwork.png" /></p>
6+
7+
<p align="center">
8+
<a href="https://circleci.com/gh/scaleway/scaleway-cli/tree/v2"><img src="https://circleci.com/gh/scaleway/scaleway-cli/tree/v2.svg?style=shield" alt="CircleCI" /></a>
9+
<a href="https://goreportcard.com/report/github.com/scaleway/scaleway-cli"><img src="https://goreportcard.com/badge/scaleway/scaleway-cli" alt="GoReportCard" /></a> <!-- GoReportCard do not support branches. -->
10+
</p>
11+
12+
Scaleway CLI is a tool to help you pilot your Scaleway infrastructure directly from your terminal.
13+
14+
!!! warning
15+
16+
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.
17+
18+
## Installation
19+
20+
### With a Package Manager (Recommended)
21+
22+
A package manager installs and upgrades the Scaleway CLI with a single command.
23+
We recommend this installation mode for more simplicity and reliability:
24+
25+
#### Homebrew
26+
27+
Install the [latest stable release](https://formulae.brew.sh/formula/scw) on macOS/Linux using [Homebrew](http://brew.sh):
28+
29+
```sh
30+
brew install scw
31+
```
32+
33+
#### Arch Linux
34+
35+
Install the latest stable release on Arch Linux from [official repositories](https://archlinux.org/packages/extra/x86_64/scaleway-cli/).
36+
For instance with `pacman`:
37+
38+
```sh
39+
pacman -S scaleway-cli
40+
```
41+
42+
#### Chocolatey
43+
44+
Install the latest stable release on Windows using [Chocolatey](https://chocolatey.org/) ([Package](https://chocolatey.org/packages/scaleway-cli)):
45+
46+
```powershell
47+
choco install scaleway-cli
48+
```
49+
50+
### Manually
51+
52+
#### Released Binaries
53+
54+
We provide [static-compiled binaries](https://github.com/scaleway/scaleway-cli/releases/latest) for darwin (macOS), GNU/Linux, and Windows platforms.
55+
You just have to download the binary compatible with your platform to a directory available in your `PATH`:
56+
57+
##### Linux
58+
59+
```bash
60+
curl -s https://raw.githubusercontent.com/scaleway/scaleway-cli/master/scripts/get.sh | sh
61+
```
62+
63+
##### Windows
64+
65+
You can download the last release here: <https://github.com/scaleway/scaleway-cli/releases><br/>
66+
[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`.
67+
68+
### Docker Image
69+
70+
You can use the CLI as you would run any Docker image:
71+
72+
```sh
73+
docker run -i --rm scaleway/cli:latest
74+
```
75+
76+
See more in-depth information about running the CLI in Docker [here](./docs/docker.md)
77+
78+
# Getting Started
79+
80+
## Setup your configuration
81+
82+
After you [installed](#Installation) the latest release just run the initialization command and let yourself be guided! :dancer:
83+
84+
```bash
85+
scw init
86+
```
87+
88+
It will set up your profile, the authentication, and the auto-completion.
89+
90+
## Basic commands
91+
92+
```
93+
# Create an instance server
94+
scw instance server create type=DEV1-S image=ubuntu_focal zone=fr-par-1 tags.0="scw-cli"
95+
96+
# List your servers
97+
scw instance server list
98+
99+
# 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
100+
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
101+
```
102+
103+
## Environment
104+
105+
You can configure your config or enable functionalities with environment variables.
106+
107+
Variables to override config are describe in [config documentation](docs/commands/config.md).
108+
To enable beta features, you can set `SCW_ENABLE_BETA=1` in your environment.
109+
110+
## Build it yourself
111+
112+
### Build Locally
113+
114+
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).
115+
Note that this development version could include bugs, use [tagged releases](https://github.com/scaleway/scaleway-cli/releases/latest) if you need stability.
116+
117+
```bash
118+
go install github.com/scaleway/scaleway-cli/v2/cmd/scw@latest
119+
```
120+
121+
Dependencies: We only use go [Modules](https://github.com/golang/go/wiki/Modules) with vendoring.
122+
123+
### Build with Docker
124+
125+
You can build the `scw` CLI with Docker. If you have Docker installed, you can run:
126+
127+
```sh
128+
docker build -t scaleway/cli .
129+
```
130+
131+
Once built, you can then use the CLI as you would run any image:
132+
133+
```sh
134+
docker run -i --rm scaleway/cli
135+
```
136+
137+
See more in-depth information about running the CLI in Docker [here](./docs/docker.md)
138+
139+
# Development
140+
141+
This repository is at its early stage and is still in active development.
142+
If you are looking for a way to contribute please read [CONTRIBUTING.md](./.github/CONTRIBUTING.md).
143+
144+
# Reach Us
145+
146+
We love feedback.
147+
Don't hesitate to open a [Github issue](https://github.com/scaleway/scaleway-cli/issues/new) or
148+
feel free to reach us on [Scaleway Slack community](https://slack.scaleway.com/),
149+
we are waiting for you on [#opensource](https://scaleway-community.slack.com/app_redirect?channel=opensource).

docs/mkdocs.yml

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
site_name: Scaleway Command Line Interface Documentation
2+
site_url: https://mydomain.org/scaleway-cli-documentation
3+
extra_css:
4+
- stylesheets/extra.css
5+
extra:
6+
version:
7+
provider: mike
8+
9+
# Analytics and feedback system (placeholders)
10+
analytics:
11+
provider: google
12+
property: G-XXXXXXXXXX
13+
feedback:
14+
title: Was this page helpful?
15+
ratings:
16+
- icon: material/emoticon-happy-outline
17+
name: This page was helpful
18+
data: 1
19+
note: >-
20+
Thanks for your feedback!
21+
- icon: material/emoticon-sad-outline
22+
name: This page could be improved
23+
data: 0
24+
note: >-
25+
Thanks for your feedback! Help us improve this page by
26+
referring to the <a href="/scaleway-cli-documentation/feedback/" target="_blank" rel="noopener">feedback page</a>.
27+
28+
# GitHub integration configuration
29+
repo_url: https://github.com/scaleway/scaleway-cli
30+
repo_name: scaleway/scaleway-cli
31+
edit_uri: edit/master/docs/commands/
32+
33+
34+
# Theme configuration
35+
theme:
36+
icon:
37+
repo: fontawesome/brands/github
38+
name: material
39+
logo: assets/logo.svg
40+
font:
41+
text: Inter
42+
palette:
43+
# Palette toggle for light mode
44+
- scheme: slate
45+
primary: deep purple
46+
accent: deep purple
47+
toggle:
48+
icon: material/toggle-switch
49+
name: Switch to dark mode
50+
51+
# Palette toggle for dark mode
52+
- scheme: default
53+
primary: deep purple
54+
accent: deep purple
55+
toggle:
56+
icon: material/toggle-switch-off-outline
57+
name: Switch to light mode
58+
features:
59+
- navigation.sections # Creates sections in left menu (default is collapsible block)
60+
- content.code.copy # Enable Copy button on code blocks
61+
- content.action.edit # Enable "Edit content" button on page
62+
- content.action.view # Enable "View source" button on page
63+
- navigation.top # Enables back to top button
64+
- navigation.tracking # Automatically adds anchors to URL
65+
- search.suggest # Add suggestions to search
66+
67+
68+
markdown_extensions:
69+
- admonition
70+
- pymdownx.details
71+
- pymdownx.superfences
72+
73+
nav:
74+
- Platform:
75+
- Account: account.md
76+
- Billing: billing.md
77+
- IAM: iam.md
78+
- Secret Manager: secret.md
79+
- Marketplace: marketplace.md
80+
- AI & Data:
81+
- Managed Inference: inference.md
82+
- Bare Metal:
83+
- Elastic Metal: baremetal.md
84+
- Apple Silicon: apple-silicon.md
85+
- Flexible IP: fip.md
86+
- Compute:
87+
- Instances: instance.md
88+
- Containers:
89+
- Container Registry: registry.md
90+
- Kubernetes: k8s.md
91+
- Labs:
92+
- IPFS Pinning: ipfs.md
93+
- IPFS Naming: ipns.md
94+
- Managed Databases:
95+
- PostgreSQL and MySQL: rdb.md
96+
- Redis™: redis.md
97+
- Document Databases: document-db.md
98+
- Managed Services:
99+
- IOT Hub: iot.md
100+
- Transactional Email: tem.md
101+
- Web Hosting: webhosting.md
102+
- Network:
103+
- VPC: vpc.md
104+
- Puvblic Gateway: vpc-gw.md
105+
- IPAM: ipam.md
106+
- Load Balancer: lb.md
107+
- Domains and DNS: dns.md
108+
- Observability:
109+
- Cockpit: cockpit.md
110+
- Serverless:
111+
- Functions: function.md
112+
- Containers: container.md
113+
- Jobs: jobs.md
114+
- SQL Databases: sdb-sql.md
115+
- Messaging and Queuing: mnq.md
116+
- Storage:
117+
- BLock Storage: block.md
118+
- Object Storage: object.md
119+
- CLI configuration:
120+
- Alias: alias.md
121+
- Autocompletion: autocomplete.md
122+
- Configuration: config.md
123+
- Feedback: feedback.md
124+
- Help: help.md
125+
- Info: info.md
126+
- Initialization: init.md
127+
- Shell: shell.md
128+
- Version: version.md
99.9 KB
Loading

docs/static_files/assets/logo.svg

Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:[email protected]&display=swap');
2+
3+
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');
4+
5+
body {
6+
font-family: "Inter", sans-serif;
7+
}
8+
9+
li.md-nav__item{
10+
margin-left: .5rem;
11+
}
12+
13+
.md-typeset h1, h2, h3, h4, h5, h6{
14+
font-family: "Space Grotesk", sans-serif;
15+
}
16+

0 commit comments

Comments
 (0)