.git folder is not transferred to Azure
- Lenguaje dominante
- TypeScript
- Estrellas
- 338
- Forks
- 234
- Merge medio
- 53 min
- PR fusionados (30 d)
- 3
Descripción
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: .
```
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Comienza con la action azure/webapps-deploy@v2 y el manejo que hace del input package: . del workflow; después, compara el contenido del contenedor de compilación con /home/site/repository y /tmp/ en el servidor desplegado. Se considera terminado cuando los archivos .git solicitados se transfieren y están disponibles en tiempo de ejecución, o cuando la action documenta por qué no se pueden incluir.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- azure, github-actions, python
- Área
- cloud, devops
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 28/100