Skip to content

Commit

Permalink
Fix for env variables.
Browse files Browse the repository at this point in the history
  • Loading branch information
ygerasimov committed Jul 25, 2024
1 parent c4a9915 commit efe8416
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
2 changes: 1 addition & 1 deletion commands/diffy/screenshot
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
export NODE_NO_WARNINGS=1
cd /mnt/ddev_config/diffy-worker-main/ && node diffy-screenshots --url=https://web --screenshot-name=$VIRTUAL_HOST
cd /mnt/ddev_config/diffy-worker-main/ && node diffy-screenshots --url=https://web --screenshot-name=$DDEV_HOSTNAME
2 changes: 1 addition & 1 deletion docker-compose.diffy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ services:
com.ddev.site-name: ${DDEV_SITENAME}
com.ddev.approot: $DDEV_APPROOT
environment:
VIRTUAL_HOST: ${DDEV_HOSTNAME}
- DDEV_HOSTNAME
volumes:
- ".:/mnt/ddev_config"
- "ddev-global-cache:/mnt/ddev-global-cache"
24 changes: 21 additions & 3 deletions install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,28 @@ post_install_actions:
- cd diffy-worker-main && npm install
- |
#ddev-nodisplay
#ddev-description:Create .env file with env variables.
#ddev-description:Create .env file
DIFFY_API_KEY='{{- $foundDiffApiKey := false -}}
{{- range .DdevGlobalConfig.web_environment }}
{{- if not $foundDiffApiKey }}
{{- $keyVal := splitList "=" . }}
{{- if eq (index $keyVal 0) "DIFFY_API_KEY" }}
{{- index $keyVal 1 -}}
{{- $foundDiffApiKey = true -}}
{{- end }}
{{- end }}
{{- end }}'
DIFFY_PROJECT_ID=$(ddev exec 'echo $DIFFY_PROJECT_ID')
DIFFY_API_KEY=$(ddev exec 'echo $DIFFY_API_KEY')
DIFFY_PROJECT_ID='{{- $foundDiffProjectId := false -}}
{{- range .DdevProjectConfig.web_environment }}
{{- if not $foundDiffProjectId }}
{{- $keyVal := splitList "=" . }}
{{- if eq (index $keyVal 0) "DIFFY_PROJECT_ID" }}
{{- index $keyVal 1 -}}
{{- $foundDiffProjectId = true -}}
{{- end }}
{{- end }}
{{- end }}'
cat <<-EOF >diffy-worker-main/.env
# #ddev-generated
Expand Down

0 comments on commit efe8416

Please sign in to comment.