#github azure build

184 messages · Page 1 of 1 (latest)

warped gorge
#

@viscid void any idea what's causing this?

ivory meadowBOT
#

This post has been reserved for your question.

Hey @warped gorge! Please use /close or the Close Post button 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.

warped gorge
#

I have my pom file right there

#

I'm trying to sync my web app with my github repo

viscid void
#

then you need to run the mvn command in that directory

viscid void
warped gorge
#

??

viscid void
warped gorge
viscid void
#

ok so do you want to fix the error or do you need help with syncing?

warped gorge
#

well I need to fix the error otherwise the workflow won't complete

#

and thus I cannot sync

viscid void
# warped gorge

Why are you including .project, .classpath and .settings in git repos?

warped gorge
viscid void
#

Or why do you run Maven?

warped gorge
#

bro I'm trying to do this

viscid void
viscid void
warped gorge
viscid void
#

Do you just want to build the server scripts thing?

viscid void
warped gorge
#

and then exclude them whenever I commit changes

viscid void
#

and if you delete it on GitHub and then pull,it will alsso delete them on your system

viscid void
#

So I would git rm --cached them

viscid void
viscid void
viscid void
warped gorge
#
# 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'```
viscid void
#

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

viscid void
warped gorge
#

???

#

could you talk me through it in simpler terms

viscid void
#
- 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?

warped gorge
#

no

viscid void
#

cd means "change directory"

warped gorge
#

oh

viscid void
#

if you are in C: and you enter cd Users, it will go to C:\Users

warped gorge
warped gorge
#

could I just have these two folders committed to the web app @viscid void

viscid void
#

because that has the pom.xml

warped gorge
#

oh yeah

#

I was thinking that so nvm

warped gorge
viscid void
warped gorge
#

I don't use git very often as you can probably tell

warped gorge
viscid void
#

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

warped gorge
#

uh

#

what's happening here

#

do I just ignore that

#

I have src/main/java and src -> main -> java

#

??

viscid void
warped gorge
#

no

viscid void
warped gorge
#

idk where they've gone

#

I didn't touch them

viscid void
viscid void
warped gorge
viscid void
#

the team thing?

warped gorge
#

yeah

#

these are the options

viscid void
#

that was for the .classpath/project files, not the entire project

warped gorge
#

uh

viscid void
warped gorge
#

in eclipse?

viscid void
warped gorge
#

oh ok

#

files are there

#

what now

viscid void
#

can you right-click them?

warped gorge
viscid void
#

is there more?

warped gorge
#

no

viscid void
#

alternatively open a terminal in that directory and enter git rm --cached .classpath

warped gorge
#

I was just reading that

warped gorge
viscid void
#

in server_scripts

#

or whatever that was

#

rm --cached means "mark as removed but don't actually delete the file"

warped gorge
viscid void
#

then press Ctrl+Alt+T

warped gorge
#

oh ok

#

and then add to git.ignore in the repo?

viscid void
#

in the .gitignore, add .classpath, .project and .settings

#

or create the .gitignore if it doesn't exist

warped gorge
warped gorge
#

do I remove the /target/

viscid void
#

target should be in the gitignore as well

warped gorge
#

so what's the syntax

#

do I just add .classpath and drop a line

#

and add the next?

viscid void
warped gorge
viscid void
warped gorge
viscid void
#

because it's a directory

warped gorge
#

ok

viscid void
#

you you need to explicitly tell it to apply for everything in that directory

warped gorge
#

and I don't need to ignore the files within .settings

#

they're just ignored by proxy?

warped gorge
#

these files

warped gorge
viscid void
#

if you add .settings to the .gitignore, it should include these files

warped gorge
#

ok

#

alr

#

do I just commit now

#

and done

viscid void
#

Can you show the content of the Git Staging view?

warped gorge
#

why are they in both

#

do I just remove them from staged

#

all but the .gitignore

viscid void
warped gorge
#

👍

#

I'll have a read

warped gorge
viscid void
warped gorge
#

ok

viscid void
viscid void
#

under staged changes, you see the x next to the file - this means these files are removed

viscid void
warped gorge
#

why does everything always go wrong for me

#

and eclipse never accepts my github password I always have to use a token

viscid void
# warped gorge

that means you made changes in GitHub that you don't have locally

warped gorge
#

not the pom

#

the maven thing

#

that's the only thing I changed...

viscid void
viscid void
viscid void
#

that's a GitHub thing, not an Eclipse thing

warped gorge
#

oh ok

#

where did all the changes go

viscid void
#

comitted

#

but you would still need to push them

#

I guess

warped gorge
#

oh so push head

viscid void
#

Did you pull already?

warped gorge
#

yes

viscid void
#

then yes, push HEAD

warped gorge
#

alr done

#

looks nice and tidy

#

thanks very much

ivory meadowBOT
# warped gorge thanks very much

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.

warped gorge
#

I'll make sure to read up on git

viscid void
warped gorge
#

since it's a necessity for collaborative programming