#github azure build
184 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @warped gorge! Please use
/closeor theClose Postbutton above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
then you need to run the mvn command in that directory
in Server_Scripts, not History_Game_Server_Scripts
??
How is that related to the error?
it's not I was giving context
ok so do you want to fix the error or do you need help with syncing?
well I need to fix the error otherwise the workflow won't complete
and thus I cannot sync
Why are you including .project, .classpath and .settings in git repos?
did that automatically
So you want to build the project?
Or why do you run Maven?
these are generated files so you normally don't want to include them in git repos
ok
I can just delete them from the repo right?
Do you just want to build the server scripts thing?
yes
I wouldn't delete the files on your system though
but I can just delete them straight from the repo?
and then exclude them whenever I commit changes
and if you delete it on GitHub and then pull,it will alsso delete them on your system
I just won't pull it
So I would git rm --cached them
then you cannot push
and then add these files to the gitignore
Can you show your workflow YAML?
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# More GitHub Actions for Azure: https://github.com/Azure/actions
name: Build and deploy JAR app to Azure Web App - historygame-app
on:
push:
branches:
- master
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Set up Java version
uses: actions/setup-java@v1
with:
java-version: '21'
- name: Build with Maven
run: mvn clean install
- name: Upload artifact for deployment job
uses: actions/upload-artifact@v3
with:
name: java-app
path: '${{ github.workspace }}/target/*.jar'
deploy:
runs-on: windows-latest
needs: build
environment:
name: 'Production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
steps:
- name: Download artifact from build job
uses: actions/download-artifact@v3
with:
name: java-app
- name: Deploy to Azure Web App
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
with:
app-name: 'historygame-app'
slot-name: 'Production'
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_74C8926C37AE4A468A34ED5D83010300 }}
package: '*.jar'```
so you are executing mvn clean install in the repository root
but mvn clean install requires a pom.xml file in the same directory
so you first need to switch to the server scripts directory
and only then run mvn clean install
how
cd Server_Scripts?
- name: Build with Maven
run: |
cd Server_Scripts
mvn clean install
...
path: '${{ github.workspace }}/Server_Scripts/target/*.jar
Do you know what the cd command does?
no
cd means "change directory"
oh
if you are in C: and you enter cd Users, it will go to C:\Users
I can just change this directly in the repo file right?
yeah
could I just have these two folders committed to the web app @viscid void
You need the Server_Scripts directory
because that has the pom.xml
do I run that in the IDE?
that would be in a terminal
I don't use git very often as you can probably tell
where
but I think you can also do it within Eclipse
right-click on the file>Team
which options are there?
idk the name by heart
uh
what's happening here
do I just ignore that
I have src/main/java and src -> main -> java
??
Did you delete the files?
no
oh yeah that's ok
Eclipse might hide them by default
as long as you can run the project within Eclipse, it's fine
right click on the project you mean?
that was for the .classpath/project files, not the entire project
uh
you can try the show in repositories view thing
here
can you right-click them?
is there more?
no
you would want an untrack and ignore option: https://stackoverflow.com/a/8311883/10871900
alternatively open a terminal in that directory and enter git rm --cached .classpath
I was just reading that
in the repo directory you mean?
in server_scripts
or whatever that was
rm --cached means "mark as removed but don't actually delete the file"
where is the option to open a terminal
click on the project in Eclipse
then press Ctrl+Alt+T
in the .gitignore, add .classpath, .project and .settings
or create the .gitignore if it doesn't exist
in eclipse you mean?
do I remove the /target/
no
target should be in the gitignore as well
oh yeah you need -r in the command for .settings as well
also what's gone wrong here
each entry is a line, yes
as in git -rm --cached .settings?
git rm --cached -r .settings
because it's a directory
ok
you you need to explicitly tell it to apply for everything in that directory
and I don't need to ignore the files within .settings
they're just ignored by proxy?
add them to the .gitignore I mean
if you add .settings to the .gitignore, it should include these files
Can you show the content of the Git Staging view?
btw if you want a resource for learning git: https://git-scm.com/book/en/v2 is great IMO
@viscid void ?
looks ok
ok
no
commit that as-is, don't move anything
under staged changes, you see the x next to the file - this means these files are removed
(and push)
oh ok
why does everything always go wrong for me
and eclipse never accepts my github password I always have to use a token
that means you made changes in GitHub that you don't have locally
oh to the pom file
not the pom
the maven thing
that's the only thing I changed...
or it means you changed something inside .github/workflows
yeah you'd need to pull to get these changes
yeah GitHub doesn't allow the use of passwords for that any more
that's a GitHub thing, not an Eclipse thing
oh so push head
Did you pull already?
yes
then yes, push HEAD
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
I'll make sure to read up on git
it's a whole book but it's freely available and it has all the important stuff about git
since it's a necessity for collaborative programming