diff --git a/.github/workflows/development.yml b/.github/workflows/development.yml new file mode 100644 index 0000000..4773643 --- /dev/null +++ b/.github/workflows/development.yml @@ -0,0 +1,173 @@ +name: Development +run-name: ${{ github.actor }} is compiling our Sample App 🚀 +on: [push] +jobs: + compile: + name: OpenEdge Compile Job + permissions: write-all + runs-on: self-hosted + defaults: + run: + working-directory: ${{ github.workspace }}/Sports + steps: + - uses: actions/checkout@v3 + - name: Pull Dev PASOE Docker Image + run: | + docker login ${{ vars.DOCKER_REPO_URL }} -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PWD }} + docker pull ${{ vars.DOCKER_REPO_URL }}/openedge-dev-pasoe:${{ vars.OE_VERSION }} + - name: Running Gradle build in a Container + run: docker run --rm -v ./:/psc/wrk/Sports/ -e APP_LOCATION=/psc/wrk/Sports ${{ vars.DOCKER_REPO_URL }}/openedge-dev-pasoe:${{ vars.OE_VERSION }} + - name: Setup Python - needed by publish step + uses: actions/setup-python@v4 + with: + python-version: 3.8 + - name: Publish ABL Unit Test Results + uses: EnricoMi/publish-unit-test-result-action/composite@v2 + if: always() + with: + files: ${{ github.workspace }}/Sports/build/test-results/test/*.xml + check_name: Test Results - ABL Unit tests for Sports App + build: + name: Build Docker Image for Sports App + needs: compile + permissions: write-all + runs-on: self-hosted + defaults: + run: + working-directory: ${{ github.workspace }}/Sports/docker + steps: + - name: Copy ABLApp archive ('.oear') + run: cp -rf ./../build/distributions/ablapps/*.oear ./ablapps + - name: Docker build + run: sh build.sh + env: + APP_NAME: ${{ vars.APP_NAME }} + APP_VERSION: ${{ vars.APP_VERSION }} + - name: Test Docker Image state - Goss + run: sh test.sh + env: + APP_NAME: ${{ vars.APP_NAME }} + APP_VERSION: ${{ vars.APP_VERSION }} + - name: Setup Python - needed by publish step + uses: actions/setup-python@v4 + with: + python-version: 3.8 + - name: Publish Goss Test Results + uses: EnricoMi/publish-unit-test-result-action/composite@v2 + with: + files: ${{ github.workspace }}/Sports/docker/tests/*.xml + check_name: Test Results - Goss tests for Sports App + - name: Push Docker Image to Develop Docker Registry + run: | + docker tag ${{ vars.APP_NAME }}:${{ vars.APP_VERSION }} ${{ vars.DOCKER_REPO_URL }}/${{ vars.APP_GROUP }}/${{ vars.APP_NAME }}:${{ vars.APP_VERSION }} + docker login ${{ vars.DOCKER_REPO_URL }} -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PWD }} + docker push ${{ vars.DOCKER_REPO_URL }}/${{ vars.APP_GROUP }}/${{ vars.APP_NAME }}:${{ vars.APP_VERSION }} + buildwebui: + name: Build Docker Image for Web UI App + permissions: write-all + runs-on: self-hosted + defaults: + run: + working-directory: ${{ github.workspace }}/webui + steps: + - name: Docker build + run: sh build.sh + - name: Test Docker Image state - Goss + run: sh test.sh + - name: Setup Python - needed by publish step + uses: actions/setup-python@v4 + with: + python-version: 3.8 + - name: Publish Goss Test Results + uses: EnricoMi/publish-unit-test-result-action/composite@v2 + with: + files: ${{ github.workspace }}/webui/tests/*.xml + check_name: Test Results - Goss tests for Web UI App + - name: Push Docker Image to Develop Docker Registry + run: | + docker tag webui:latest ${{ vars.DOCKER_REPO_URL }}/${{ vars.APP_GROUP }}/webui:latest + docker login ${{ vars.DOCKER_REPO_URL }} -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PWD }} + docker push ${{ vars.DOCKER_REPO_URL }}/${{ vars.APP_GROUP }}/webui:latest + deploy: + name: Test Sample App Deploy + needs: [build, buildwebui] + permissions: write-all + runs-on: self-hosted + defaults: + run: + working-directory: ${{ github.workspace }}/deploy + steps: + - run: mkdir -p ./license + - name: Download the OpenEdge License file + run: wget -cO - ${{vars.NEXUS_URL}}/OpenEdge/linux/${{vars.OE_VERSION}}/linux-${{vars.OE_VERSION}}-license.cfg > ./license/progress.cfg --no-check-certificate + - name: Undeploy previous version of Sample App + run: sh undeploy.sh + env: + DOCKER_REPO_URL: ${{ vars.DOCKER_REPO_URL }} + OE_VERSION: ${{ vars.OE_VERSION }} + APP_NAME: ${{ vars.APP_NAME }} + APP_VERSION: ${{ vars.APP_VERSION }} + APP_GROUP: ${{ vars.APP_GROUP }} + - name: Deploy new version of Sample App + run: sh deploy.sh + env: + DOCKER_REPO_URL: ${{ vars.DOCKER_REPO_URL }} + OE_VERSION: ${{ vars.OE_VERSION }} + APP_NAME: ${{ vars.APP_NAME }} + APP_VERSION: ${{ vars.APP_VERSION }} + APP_GROUP: ${{ vars.APP_GROUP }} + - name: Test the app + run: sh test-app-image.sh + working-directory: ${{ github.workspace }}/test-app-image + - name: Setup Python - needed by publish step + uses: actions/setup-python@v4 + with: + python-version: 3.8 + - name: Publish Sample Sports App Test Results + uses: EnricoMi/publish-unit-test-result-action/composite@v2 + with: + files: ${{ github.workspace }}/test-app-image/*.xml + check_name: Test Results - Sports App Services + action_fail: true + - name: Undeploy the app and clean up resources + run: echo "TODO" + securityscans: + name: Scan Docker Images for Security Vulnerabilities + needs: [build, buildwebui] + permissions: write-all + runs-on: self-hosted + steps: + - name: Run security scan for Sports App docker image + uses: aquasecurity/trivy-action@master + with: + image-ref: ${{ vars.DOCKER_REPO_URL }}/${{ vars.APP_GROUP }}/${{ vars.APP_NAME }}:${{ vars.APP_VERSION }} + format: 'sarif' + output: 'trivy-results-sports.sarif' + - name: Upload security scan report of Sports App docker image to GitHub Security tab + uses: github/codeql-action/upload-sarif@v2 + with: + sarif_file: 'trivy-results-sports.sarif' + category: sports-app-scan + - name: Run security scan for Web UI App docker image + uses: aquasecurity/trivy-action@master + with: + image-ref: ${{ vars.DOCKER_REPO_URL }}/${{ vars.APP_GROUP }}/webui:latest + format: 'sarif' + output: 'trivy-results-webui.sarif' + - name: Upload security scan report of Web UI App docker image to GitHub Security tab + uses: github/codeql-action/upload-sarif@v2 + with: + sarif_file: 'trivy-results-webui.sarif' + category: webui-app-scan + stage: + name: Stage Artifacts and Docker Images for Release + needs: [deploy, securityscans] + runs-on: self-hosted + steps: + - name: Publish Docker Images to Release Docker Registry + run: | + docker login ${{ vars.DOCKER_REPO_URL }} -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PWD }} + docker tag ${{ vars.DOCKER_REPO_URL }}/${{ vars.APP_GROUP }}/webui:latest ${{ vars.DOCKER_REPO_URL }}/${{ vars.APP_GROUP }}/webui:latest-tested + docker push ${{ vars.DOCKER_REPO_URL }}/${{ vars.APP_GROUP }}/webui:latest-tested + docker tag ${{ vars.DOCKER_REPO_URL }}/${{ vars.APP_GROUP }}/${{ vars.APP_NAME }}:${{ vars.APP_VERSION }} ${{ vars.DOCKER_REPO_URL }}/${{ vars.APP_GROUP }}/${{ vars.APP_NAME }}:${{ vars.APP_VERSION }}-tested + docker push ${{ vars.DOCKER_REPO_URL }}/${{ vars.APP_GROUP }}/${{ vars.APP_NAME }}:${{ vars.APP_VERSION }}-tested \ No newline at end of file diff --git a/.github/workflows/sigrid-publish.yml b/.github/workflows/sigrid-publish.yml new file mode 100644 index 0000000..b6fa18a --- /dev/null +++ b/.github/workflows/sigrid-publish.yml @@ -0,0 +1,18 @@ +name: sigrid-publish +on: + push: + branches: + - "main" + +jobs: + sigridci: + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v3 + - name: Download Sigrid CI + run: "git clone https://github.com/Software-Improvement-Group/sigridci.git sigridci" + - name: "Run Sigrid CI" + env: + SIGRID_CI_TOKEN: "${{ secrets.SIGRID_CI_TOKEN }}" + run: "./sigridci/sigridci/sigridci.py --customer 'Progress Software' --system 'Sample App' --source . --publish" \ No newline at end of file diff --git a/.github/workflows/sigrid-pullrequest.yml b/.github/workflows/sigrid-pullrequest.yml new file mode 100644 index 0000000..1cbe2d9 --- /dev/null +++ b/.github/workflows/sigrid-pullrequest.yml @@ -0,0 +1,15 @@ +name: sigrid-pullrequest +on: [pull_request] + +jobs: + sigridci: + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v3 + - name: Download Sigrid CI + run: "git clone https://github.com/Software-Improvement-Group/sigridci.git sigridci" + - name: "Run Sigrid CI" + env: + SIGRID_CI_TOKEN: "${{ secrets.SIGRID_CI_TOKEN }}" + run: "./sigridci/sigridci/sigridci.py --customer 'Progress Software' --system 'SampleApp' --source ." \ No newline at end of file diff --git a/test-app-image/test/testCustomer.js b/test-app-image/test/testCustomer.js index 69bf4bc..3747718 100644 --- a/test-app-image/test/testCustomer.js +++ b/test-app-image/test/testCustomer.js @@ -15,8 +15,13 @@ var result, describe("Test Customer", () => { const options = { +<<<<<<< HEAD + serviceURI: "https://ec2-3-84-2-121.compute-1.amazonaws.com:8811/Sports", + catalogURI: "https://ec2-3-84-2-121.compute-1.amazonaws.com:8811/Sports/static/SportsService.json", +======= serviceURI: "https://:8811/Sports", catalogURI: "https://:8811/Sports/static/SportsService.json", +>>>>>>> 2dc36163c2e39a60013d4a4da933f744805c5f4a resourceName: "Customer", authenticationModel: "anonymous" }; diff --git a/webui/src/grid.js b/webui/src/grid.js index 279e697..aa244e2 100644 --- a/webui/src/grid.js +++ b/webui/src/grid.js @@ -4,7 +4,11 @@ $(function () { 'use strict'; +<<<<<<< HEAD + var serviceURI = "https://ec2-3-84-2-121.compute-1.amazonaws.com:8811/Sports"; +======= var serviceURI = "https://:8811/Sports"; +>>>>>>> 2dc36163c2e39a60013d4a4da933f744805c5f4a var catalogURI = serviceURI + "/static/SportsService.json"; function createGrid() {