GitHub + GitHub Actions with DTM Apps

ENV Vars

The following environment variables are required for this to work:

Bash

  1. export GITHUB_TOKEN="YOUR_GITHUB_TOKEN_HERE"
  2. export IMAGE_REPO_PASSWORD="YOUR_DOCKERHUB_TOKEN_HERE"

Config File

YAML

  1. config:
  2. state:
  3. backend: local
  4. options:
  5. stateFile: devstream.state
  6. vars:
  7. GITHUB_USER: YOUR_GITHUB_USER
  8. DOCKERHUB_USER: YOUR_DOCKERHUB_USER
  9. tools:
  10. - name: helm-installer
  11. instanceID: argocd
  12. apps:
  13. - name: myapp1
  14. spec:
  15. language: python
  16. framework: django
  17. repo:
  18. url: github.com/[[ GITHUB_USER ]]/myapp1
  19. token: [[ env GITHUB_TOKEN ]]
  20. repoTemplate:
  21. url: github.com/devstream-io/dtm-repo-scaffolding-python-flask
  22. ci:
  23. - type: github-actions
  24. options:
  25. imageRepo:
  26. user: [[ DOCKERHUB_USER ]]
  27. password: [[ env IMAGE_REPO_PASSWORD ]]
  28. cd:
  29. - type: argocdapp

Update the “YOUR_GITHUB_USER” and “YOUR_DOCKERHUB_USER” in the above file accordingly.


Run

First, initialize:

Bash

  1. # this downloads the required plugins, according to the config file, automatically.
  2. dtm init -f config.yaml

Then we apply it by running:

Bash

  1. dtm apply -f config.yaml -y