Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add purl binary for handling file replacements #473

Merged
merged 1 commit into from Apr 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 10 additions & 2 deletions .github/workflows/ci.yml
Expand Up @@ -40,15 +40,23 @@ jobs:
echo "php_changes_detected=true" >> $GITHUB_OUTPUT
fi

- name: Download purl
run: |
curl -sL https://github.com/catatsuy/purl/releases/latest/download/purl-linux-amd64.tar.gz | tar xz -C /tmp

- name: Move files to /usr/local/bin for purl
run: |
sudo mv /tmp/purl /usr/local/bin/

- name: Update compose.yml if changes are detected
if: steps.check-changes.outputs.go_changes_detected == 'true'
run: |
sed -i 's|build: ruby/|build: golang/|' ./webapp/docker-compose.yml
purl -overwrite -replace '@build: ruby/@build: golang/@' ./webapp/docker-compose.yml

- name: Update compose.yml if changes are detected
if: steps.check-changes.outputs.php_changes_detected == 'true'
run: |
perl -i -pe 's@build: (ruby|golang)/@build: php/@g' ./webapp/docker-compose.yml
purl -overwrite -replace '@build: (ruby|golang)/@build: php/@' ./webapp/docker-compose.yml
mv webapp/etc/nginx/conf.d/default.conf webapp/etc/nginx/conf.d/default.conf.org
mv webapp/etc/nginx/conf.d/php.conf.org webapp/etc/nginx/conf.d/php.conf

Expand Down