Skip to content

Commit 17a77b2

Browse files
committed
docs: python flask gitops use case with tools
Signed-off-by: Tiexin Guo <[email protected]>
1 parent 7d81b25 commit 17a77b2

File tree

2 files changed

+88
-2
lines changed

2 files changed

+88
-2
lines changed

docs/use-cases/gitops-python-flask/2-github-dtm-apps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ config:
2222

2323
vars:
2424
GITHUB_USER: YOUR_GITHUB_USER
25-
DOCKERHUB_USER: YOUR_DOCKERHUB_USER
25+
DOCKERHUB_USER: YOUR_DOCKERHUB_USER
2626

2727
tools:
2828
- name: helm-installer
Lines changed: 87 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,89 @@
11
# GitHub + GitHub Actions with DTM Tools
22

3-
TODO
3+
DevStream has two abstractions: [Tools](../../core-concepts/tools.md) and [Apps](../../core-concepts/apps.md).
4+
5+
[The previous use case](./2-github-dtm-apps.md) uses "Apps". We can also achieve the same result with "Tools", and here's how:
6+
7+
---
8+
9+
## Config File
10+
11+
```yaml
12+
config:
13+
state:
14+
backend: local
15+
options:
16+
stateFile: devstream.state
17+
18+
vars:
19+
GITHUB_USER: YOUR_GITHUB_USER
20+
DOCKERHUB_USER: YOUR_DOCKERHUB_USER
21+
22+
tools:
23+
- name: repo-scaffolding
24+
instanceID: myapp1
25+
options:
26+
destinationRepo:
27+
owner: [[ GITHUB_USER ]]
28+
name: myapp1
29+
branch: main
30+
scmType: github
31+
sourceRepo:
32+
org: devstream-io
33+
name: dtm-repo-scaffolding-python-flask
34+
scmType: github
35+
- name: github-actions
36+
instanceID: flask
37+
dependsOn: [ repo-scaffolding.myapp1 ]
38+
options:
39+
scm:
40+
owner: [[ GITHUB_USER ]]
41+
name: myapp1
42+
scmType: github
43+
pipeline:
44+
configLocation: https://raw.githubusercontent.com/devstream-io/dtm-pipeline-templates/main/github-actions/workflows/main.yml
45+
language:
46+
name: python
47+
framework: flask
48+
imageRepo:
49+
user: [[ DOCKERHUB_USER ]]
50+
- name: helm-installer
51+
instanceID: argocd
52+
- name: argocdapp
53+
instanceID: default
54+
dependsOn: [ "helm-installer.argocd", "github-actions.flask" ]
55+
options:
56+
app:
57+
name: myapp1
58+
namespace: argocd
59+
destination:
60+
server: https://kubernetes.default.svc
61+
namespace: default
62+
source:
63+
valuefile: values.yaml
64+
path: helm/myapp1
65+
repoURL: ${{repo-scaffolding.myapp1.outputs.repoURL}}
66+
imageRepo:
67+
user: [[ DOCKERHUB_USER ]]
68+
```
69+
70+
Update the "YOUR_GITHUB_USER" and "YOUR_DOCKERHUB_USER" in the above file accordingly.
71+
72+
---
73+
74+
## Run
75+
76+
First, initialize:
77+
78+
```bash
79+
# this downloads the required plugins, according to the config file, automatically.
80+
dtm init -f config.yaml
81+
```
82+
83+
Then we apply it by running:
84+
85+
```bash
86+
dtm apply -f config.yaml -y
87+
```
88+
89+
(Screenshot/video omitted.)

0 commit comments

Comments
 (0)