Azure / Azure/webapps-deploy

.git folder is not transferred to Azure

Aperta
#331 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub
idle waiting-for-customer
Lingua principale
TypeScript
Stelle
338
Fork
234
Merge medio
53m
PR unite (30g)
3

Descrizione

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: .
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Inizia con l’action azure/webapps-deploy@v2 e con la gestione dell’input package: . del workflow, quindi confronta il contenuto del container di build con /home/site/repository e /tmp/ sul server distribuito. Il lavoro è completato quando i file .git richiesti vengono trasferiti e sono disponibili a runtime, oppure quando l’action documenta perché non possono essere inclusi.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
azure, github-actions, python
Ambito
cloud, devops
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
28/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.