From ac1857e6d3e87e98806c925530fef408416dbb93 Mon Sep 17 00:00:00 2001 From: 0pens0 <36497537+0pens0@users.noreply.github.com> Date: Mon, 12 Aug 2024 08:51:58 +0100 Subject: [PATCH] 1 --- .github/workflows/cfdeploy.yml | 36 +++++++++++++++++++++-------- conf/cfdeploy.yml | 42 ---------------------------------- 2 files changed, 27 insertions(+), 51 deletions(-) delete mode 100644 conf/cfdeploy.yml diff --git a/.github/workflows/cfdeploy.yml b/.github/workflows/cfdeploy.yml index 0788860..50469a5 100644 --- a/.github/workflows/cfdeploy.yml +++ b/.github/workflows/cfdeploy.yml @@ -3,22 +3,40 @@ run-name: ${{ github.actor }} deploying on: push: branches: - - "none" + - "dev" jobs: gitops-deploy: runs-on: ubuntu-latest steps: - - name: Deploy to CF - env: - CF_DOCKER_PASSWORD: ${{secrets.CF_DOCKER_PASSWORD}} + - name: Install CLI run: | wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo apt-key add - - echo "deb https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list + echo "deb https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list sudo apt update sudo apt install cf8-cli - cf api ${{ vars.CF_API_ENDPOINT }} --skip-ssl-validation + sudo apt install openjdk-17-jdk openjdk-17-jre + sudo update-java-alternatives --set /usr/lib/jvm/java-1.17.0-openjdk-amd64 + export JAVA_HOME=/usr/lib/jvm/java-1.17.0-openjdk-amd64 + + - name: Connect to CF API + env: + CF_API: ${{ vars.CF_API_ENDPOINT }} + CF_ORG: ${{ vars.CF_ORG }} + CF_SPACE: ${{ vars.CF_SPACE }} + + run: | + cf api $CF_API --skip-ssl-validation cf auth admin ${{ secrets.CF_API_TOKEN }} - cf target -o ${{ vars.CF_ORG }} -s ${{ vars.CF_SPACE }} - cf push spring-metal --docker-image harbor.vmtanzu.com/openso-tap-apps/spring-metal --docker-username openso - + cf target -o $CF_ORG -s $CF_SPACE + + - name: Check out repository code + uses: actions/checkout@v4 + - name: Deploy + run: | + export JAVA_HOME=/usr/lib/jvm/java-1.17.0-openjdk-amd64 + mvn package + cf push + + + - run: echo "🍏 This job's status is ${{ job.status }}." diff --git a/conf/cfdeploy.yml b/conf/cfdeploy.yml deleted file mode 100644 index 50469a5..0000000 --- a/conf/cfdeploy.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Deploy to CF -run-name: ${{ github.actor }} deploying -on: - push: - branches: - - "dev" -jobs: - gitops-deploy: - runs-on: ubuntu-latest - steps: - - name: Install CLI - run: | - wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo apt-key add - - echo "deb https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list - sudo apt update - sudo apt install cf8-cli - sudo apt install openjdk-17-jdk openjdk-17-jre - sudo update-java-alternatives --set /usr/lib/jvm/java-1.17.0-openjdk-amd64 - export JAVA_HOME=/usr/lib/jvm/java-1.17.0-openjdk-amd64 - - - name: Connect to CF API - env: - CF_API: ${{ vars.CF_API_ENDPOINT }} - CF_ORG: ${{ vars.CF_ORG }} - CF_SPACE: ${{ vars.CF_SPACE }} - - run: | - cf api $CF_API --skip-ssl-validation - cf auth admin ${{ secrets.CF_API_TOKEN }} - cf target -o $CF_ORG -s $CF_SPACE - - - name: Check out repository code - uses: actions/checkout@v4 - - name: Deploy - run: | - export JAVA_HOME=/usr/lib/jvm/java-1.17.0-openjdk-amd64 - mvn package - cf push - - - - - run: echo "🍏 This job's status is ${{ job.status }}."