.git folder is not transferred to Azure
- 主要言語
- TypeScript
- スター
- 338
- フォーク
- 234
- 平均マージ
- 53分
- マージ済み PR(30日)
- 3
説明
In order to use some versioning data from the .git folder during the app runtime, I want to be able to transfer (some parts of) the .git folder with the deployment, so that those files are available in the running container on Azure.
I've spent some time trying to debug this issue, and I can confirm the required .git directory and files are all present in the build container on GitHub, while the action is running. But at some point when the webapps-deploy@v2 action is running, these files do not appear to be transferred.
I've googled this extensively and looked through the documentation and I can's see any options that would allow me to explicitly include or exclude some files. It's possible that some stage of the Oryx build is removing the files, but I can't see any way to further debug this. On the deployed server I can SSH in and see the source code in /home/site/repository as well as in the /tmp/ folder which is default when opening the Azure webSSH client. Both have folders such as .github present, but neither have .git.
We are using a Python 3.10 runtime in a Linux container. The GitHub workflow is as follows.
```
on:
push:
branches:
- development
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment:
name: 'development'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
steps:
- uses: actions/checkout@v3
with:
clean: false
- name: List all files
run: ls -al
- name: Set up Python version
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install PostGIS dependencies
run: sudo apt-get install -y binutils libproj-dev gdal-bin libgdal-dev python3-gdal
- name: Create and start virtual environment
run: |
python -m venv venv
source venv/bin/activate
# python dependencies
- name: Install dependencies
run: pip install -r requirements.txt
- name: collect static files
run: python manage.py collectstatic --noinput
# Deploy to Azure
- name: 'Deploy to Azure Web App'
uses: azure/webapps-deploy@v2
id: deploy-to-webapp
with:
app-name: 'epilepsy12-development'
slot-name: 'Production'
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_XXXXXXXX }}
package: .
```
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
まず azure/webapps-deploy@v2 アクションと、ワークフローの package: . 入力の処理を確認し、次にデプロイされたサーバー上の /home/site/repository および /tmp/ とビルドコンテナーの内容を比較します。要求された .git ファイルが転送されて実行時に利用可能になるか、またはそれらを含められない理由をアクションが文書化すれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- azure, github-actions, python
- 領域
- cloud, devops
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 28/100