mirror of
https://gitea.com/mcereda/oam.git
synced 2026-02-08 21:34:25 +00:00
chore: quickly revise commands
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
# Dagger
|
||||
|
||||
> TODO
|
||||
Open-source runtime for composable workflows.<br/>
|
||||
Intended for systems with many moving parts and strong needs for repeatability, modularity, observability and
|
||||
cross-platform support, which makes it good for AI agents and CI/CD workflows.
|
||||
|
||||
Programmable tool aiming to replace scripts with a modern API and cross-language scripting engine.
|
||||
|
||||
<!-- Remove this line to uncomment if used
|
||||
## Table of contents <!-- omit in toc -->
|
||||
Tries to replace software projects' artisanal scripts with a modern API and cross-language scripting engine.<br/>
|
||||
Helps to create consistent and reliable local development and testing environments that can do whatever one's CI can.
|
||||
|
||||
1. [TL;DR](#tldr)
|
||||
1. [Further readings](#further-readings)
|
||||
@@ -13,15 +13,14 @@ Programmable tool aiming to replace scripts with a modern API and cross-language
|
||||
|
||||
## TL;DR
|
||||
|
||||
<!-- Uncomment if used
|
||||
<details>
|
||||
<summary>Setup</summary>
|
||||
|
||||
```sh
|
||||
brew install 'dagger/tap/dagger'
|
||||
```
|
||||
|
||||
</details>
|
||||
-->
|
||||
|
||||
<!-- Uncomment if used
|
||||
<details>
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
#!/usr/bin/env fish
|
||||
|
||||
# If not configured, the CLI tool needs to have those specified
|
||||
dblab --url 'http://dblab.example.org:1234/' --token "$(gopass show -o 'dblab')" …
|
||||
|
||||
# Check logs
|
||||
docker logs --since '5m' -f 'dblab_server'
|
||||
|
||||
@@ -8,8 +11,8 @@ docker exec -it 'dblab_server' kill -SIGHUP '1'
|
||||
|
||||
# Check the running container's version
|
||||
# Used to check the instance is up and running
|
||||
dblab instance version
|
||||
curl 'http://127.0.0.1:2345/healthz'
|
||||
dblab --url 'http://dblab.example.org:1234/' --token "$(gopass show -o 'dblab')" instance version
|
||||
|
||||
# Initialize the CLI client
|
||||
dblab init
|
||||
@@ -42,20 +45,21 @@ open 'https://dblab.example.org:1234/api/'
|
||||
open 'http://dblab.example.org:1234/'
|
||||
|
||||
# Get instance status, instance info, and list of clones
|
||||
dblab instance status
|
||||
curl 'https://dblab.example.org:2345/status' -H "Verification-Token: $(gopass show -o 'dblab')"
|
||||
curl 'https://dblab.example.org:1234/api/status' -H "Verification-Token: $(gopass show -o 'dblab')"
|
||||
dblab instance status
|
||||
|
||||
# Show data refresh status
|
||||
curl 'https://dblab.example.org:2345/instance/retrieval' -H "Verification-Token: $(gopass show -o 'dblab')"
|
||||
curl 'https://dblab.example.org:1234/api/instance/retrieval' -H "Verification-Token: $(gopass show -o 'dblab')"
|
||||
|
||||
# List snapshots
|
||||
dblab snapshot list
|
||||
curl 'https://dblab.example.org:2345/snapshots' -H "Verification-Token: $(gopass show -o 'dblab')"
|
||||
curl 'https://dblab.example.org:1234/api/snapshots' -H "Verification-Token: $(gopass show -o 'dblab')"
|
||||
dblab snapshot list
|
||||
|
||||
# Create clones
|
||||
dblab clone create --id 'some-clone' --protected --username 'geppetto' --password 'pinocchio' --db-name 'puppetshop'
|
||||
curl -X 'POST' 'https://dblab.example.org:1234/api/clone' -H "Verification-Token: $(gopass show -o 'dblab')" \
|
||||
-H 'accept: application/json' -H 'content-type: application/json' \
|
||||
-d '{
|
||||
@@ -64,19 +68,23 @@ curl -X 'POST' 'https://dblab.example.org:1234/api/clone' -H "Verification-Token
|
||||
"db": {
|
||||
"username": "geppetto",
|
||||
"password": "pinocchio",
|
||||
"db_name": "puppets-workshop"
|
||||
"db_name": "puppetshop"
|
||||
}
|
||||
}'
|
||||
|
||||
# List clones
|
||||
dblab clone list
|
||||
curl 'https://dblab.example.org:2345/status' -H "Verification-Token: $(gopass show -o 'dblab')" | jq '.' -
|
||||
curl 'https://dblab.example.org:1234/api/status' -H "Verification-Token: $(gopass show -o 'dblab')"
|
||||
dblab clone list
|
||||
|
||||
# Get clones' information
|
||||
dblab clone status 'some-clone'
|
||||
curl 'https://dblab.example.org:1234/clone/some-clone' -H "Verification-Token: $(gopass show -o 'dblab')"
|
||||
curl 'https://dblab.example.org:1234/api/clone/some-clone' -H "Verification-Token: $(gopass show -o 'dblab')"
|
||||
dblab clone status 'some-clone'
|
||||
|
||||
# Restart clones
|
||||
# Only doable from the instance
|
||||
docker restart 'dblab_clone_6000'
|
||||
|
||||
# Reset clones
|
||||
# Only available via the '/api' endpoints, no direct ones
|
||||
@@ -95,15 +103,15 @@ curl --url 'https://dblab.example.org:2345/status' --header 'verification-token:
|
||||
--data '{ "latest": true }'
|
||||
|
||||
# Unprotect clones
|
||||
dblab clone update --protected='false' 'some-clone'
|
||||
curl -X 'PATCH' 'https://dblab.example.org:1234/api/clone/some-clone' \
|
||||
-H "Verification-Token: $(gopass show -o 'dblab')" \
|
||||
-H 'accept: application/json' -H 'content-type: application/json' \
|
||||
-d '{ "protected": false }'
|
||||
dblab clone update --protected='false' 'some-clone'
|
||||
|
||||
# Delete clones
|
||||
curl -X 'DELETE' 'https://dblab.example.org:1234/api/clone/some-clone' -H "Verification-Token: $(gopass show -o 'dblab')"
|
||||
dblab clone destroy 'some-clone'
|
||||
curl -X 'DELETE' 'https://dblab.example.org:1234/api/clone/some-clone' -H "Verification-Token: $(gopass show -o 'dblab')"
|
||||
|
||||
# Get admin config in YAML format
|
||||
curl 'https://dblab.example.org:1234/api/admin/config.yaml' -H "Verification-Token: $(gopass show -o 'dblab')"
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#!/usr/bin/env fish
|
||||
|
||||
# Connect to PeerDB server in SQL mode
|
||||
psql 'port=9900 host=localhost password=peerdb'
|
||||
psql 'host=localhost port=9900 password=peerdb'
|
||||
|
||||
# List peers
|
||||
psql "host=localhost port=9900 password=$(gopass show -o 'peerdb/instance')" \
|
||||
-c "SELECT id, name, type FROM peers;"
|
||||
curl -fsS --url 'http://localhost:3000/api/v1/peers/list' \
|
||||
-H "Authorization: Basic $(gopass show -o 'peerdb/instance' | xargs printf '%s' ':' | base64)"
|
||||
psql 'port=9900 host=localhost password=peerdb' \
|
||||
-c "SELECT id, name, type FROM peers;"
|
||||
|
||||
# Create peers
|
||||
# postgres: peer.type=3|'POSTGRES' + postgres_config={…}
|
||||
@@ -29,7 +29,7 @@ curl -fsS --url 'http://localhost:3000/api/v1/peers/create' -X 'POST' \
|
||||
}
|
||||
}
|
||||
}"
|
||||
psql 'port=9900 host=localhost password=peerdb' \
|
||||
psql "host=localhost port=9900 password=$(gopass show -o 'peerdb/instance')" \
|
||||
-c "CREATE PEER some_pg_peer FROM POSTGRES WITH (
|
||||
host = 'localhost',
|
||||
port = '5432',
|
||||
|
||||
@@ -94,6 +94,7 @@ jq '.dependencies."@pulumi/aws" |= "6.66.2"' 'package.json' | sponge 'package.js
|
||||
# Could use `--suppress-outputs --generate-code='false' --protect=false` for some
|
||||
pulumi import 'aws:alb/listener:Listener' 'pihole' 'arn:aws:elasticloadbalancing:us-west-2:012345678901:listener/app/pihole/0123456789abcdef/0123456789abcdef'
|
||||
pulumi import 'aws:chatbot/slackChannelConfiguration:SlackChannelConfiguration' 'alarms' 'arn:aws:chatbot::012345678901:chat-configuration/slack-channel/alarms'
|
||||
pulumi import 'aws:cloudfront/distribution:Distribution' 'someWebsite' 'E74FTE3EXAMPLE'
|
||||
pulumi import 'aws:cloudwatch/logGroup:LogGroup' 'vulcan' 'vulcan'
|
||||
pulumi import 'aws:cloudwatch/metricAlarm:MetricAlarm' 'prometheus-ec2-CPUUtilization' 'prometheus-ec2-CPUUtilization-drc5644'
|
||||
pulumi import 'aws:codedeploy/application:Application' 'my-app-prod' 'my-application-production'
|
||||
@@ -105,5 +106,7 @@ pulumi import 'aws:ecs/service:Service' 'pihole' 'experiments/pihole'
|
||||
pulumi import 'aws:ecs/taskDefinition:TaskDefinition' 'pihole' 'arn:aws:ecs:eu-west-1:012345678901:task-definition/pihole:27'
|
||||
pulumi import 'aws:iam/instanceProfile:InstanceProfile' 'prometheus-instance-profile' 'PrometheusRole'
|
||||
pulumi import 'aws:iam/user:User' 'jimmy' 'jimmy'
|
||||
pulumi import 'aws:imagebuilder/component:Component' 'requiredPackages' 'arn:aws:imagebuilder:us-east-1:123456789012:component/project-alpha-required-packages/1.0.0/1'
|
||||
pulumi import 'aws:imagebuilder/imagePipeline:ImagePipeline' 'serverBase' 'arn:aws:imagebuilder:us-east-1:123456789012:image-pipeline/server-base'
|
||||
pulumi import 'aws:rds/instance:Instance' 'staging' 'odoo-staging-replica'
|
||||
pulumi import 'aws:route53/record:Record' 'hoppscotch' 'ZGG4442BC3E8M_hoppscotch.example.org_A'
|
||||
|
||||
Reference in New Issue
Block a user