Skip to content

Commit

Permalink
Copy files to PVC (#142)
Browse files Browse the repository at this point in the history
* Preview to molgenis.org with file copy to PVC

---------

Co-authored-by: DickPostma <(ID)+(username)@users.noreply.github.com>
Co-authored-by: Morris Swertz <[email protected]>
  • Loading branch information
3 people authored Nov 15, 2024
1 parent dbbe918 commit 9b07cf6
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
command: |
bundle exec jekyll doctor
bundle exec jekyll build
- run:
name: prepare azure
command: |
Expand All @@ -53,12 +54,32 @@ jobs:
--set image.repository=nginx \
--set image.pullPolicy=Always \
--debug
- run:
name: Wait for pod to come up
command: |
NAME="preview-molgenis-org-pr-${CIRCLE_PULL_REQUEST##*/}"
POD=`kubectl get pods -n $NAME --no-headers -o custom-columns=":metadata.name"`
kubectl wait --timeout=60s --for=condition=Ready pod/$POD -n $NAME
- run:
name: Copy Files to kubernetes
command: |
NAME="preview-molgenis-org-pr-${CIRCLE_PULL_REQUEST##*/}"
cd _site/
POD=`kubectl get pods -n $NAME --no-headers -o custom-columns=":metadata.name"`
find -maxdepth 1 |grep -v helm | xargs -i{} kubectl cp {} $POD:/usr/share/nginx/html/ -n $NAME
cd
- run:
name: message slack about preview
command: |
curl -d "token=${SLACK_TOKEN}" \
-d "text=*<${CIRCLE_PULL_REQUEST}|Circle-CI » Molgenis » Molgenis-org » PR-${CIRCLE_PULL_REQUEST##*/} #${CIRCLE_BUILD_NUM}>*
PR Preview available on https://preview-molgenis-org-${CIRCLE_PULL_REQUEST##*/}.dev.molgenis.org" \
PR Preview available on https://preview-molgenis-org-pr-${CIRCLE_PULL_REQUEST##*/}.dev.molgenis.org" \
-d "channel=C02AZDG6QQ7" \
-X POST https://slack.com/api/chat.postMessage
workflows:
Expand Down

0 comments on commit 9b07cf6

Please sign in to comment.