diff --git a/.config/config.json b/.config/config.json index b5cae0dd4..ac5d6f379 100644 --- a/.config/config.json +++ b/.config/config.json @@ -16,8 +16,7 @@ "db": "biohub-platform-db", "api": "biohub-platform-api", "queue": "biohub-platform-queue", - "app": "biohub-platform-app", - "geoserver": "biohub-platform-geoserver" + "app": "biohub-platform-app" }, "staticUrls": { "dev": "dev-biohub-platform.apps.silver.devops.gov.bc.ca", @@ -29,11 +28,6 @@ "test": "api-test-biohub-platform.apps.silver.devops.gov.bc.ca", "prod": "api-biohub-platform.apps.silver.devops.gov.bc.ca" }, - "staticUrlsGeoServer": { - "dev": "geoserver-dev-biohub-platform.apps.silver.devops.gov.bc.ca", - "test": "geoserver-test-biohub-platform.apps.silver.devops.gov.bc.ca", - "prod": "geoserver-biohub-platform.apps.silver.devops.gov.bc.ca" - }, "siteminderLogoutURL": { "dev": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi", "test": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi", diff --git a/.docker/nginx/n8n/Dockerfile b/.docker/nginx/n8n/Dockerfile deleted file mode 100644 index b25dfbc54..000000000 --- a/.docker/nginx/n8n/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM nginx:stable-alpine - -RUN mkdir -p /usr/app - -WORKDIR /usr/app - -# remove any existing conf file -RUN rm /etc/nginx/conf.d/default.conf - -# copy our nginx conf file -COPY /dev.conf /etc/nginx/conf.d diff --git a/.docker/nginx/n8n/dev.conf b/.docker/nginx/n8n/dev.conf deleted file mode 100644 index 732cb31b9..000000000 --- a/.docker/nginx/n8n/dev.conf +++ /dev/null @@ -1,19 +0,0 @@ -server { - listen 5100; - - location / { - proxy_pass http://n8n:5678; - proxy_redirect default; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Host $server_name; - - if ($request_method = 'OPTIONS') { - add_header "Access-Control-Allow-Origin" "*"; - add_header "Access-Control-Allow-Methods" "GET, POST, OPTIONS, HEAD"; - add_header "Access-Control-Allow-Headers" "Authorization, Origin, X-Requested-With, Content-Type, Accept, sessionid"; - return 204; - } - } -} diff --git a/.github/workflows/backup/deploy.yml b/.github/workflows/backup/deploy.yml index 2ab27846e..3790f1e9c 100644 --- a/.github/workflows/backup/deploy.yml +++ b/.github/workflows/backup/deploy.yml @@ -70,98 +70,3 @@ jobs: echo $CYPRESS_authRealm echo $CYPRESS_authClientId echo $CYPRESS_authUrl - - # Build the GeoServer image - buildGeoserver: - name: Build GeoServer Image - runs-on: ubuntu-latest - if: ${{ github.event.pull_request.merged == false && github.event.pull_request.draft == false }} - env: - PR_NUMBER: ${{ github.event.number }} - needs: - - checkoutRepo - steps: - # Install Node - for `node` and `npm` commands - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: 14 - - # Load repo from cache - - name: Cache repo - uses: actions/cache@v3 - id: cache-repo - env: - cache-name: cache-repo - with: - path: ${{ github.workspace }}/* - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }} - - # Checkout the branch if not restored via cache - - name: Checkout Target Branch - if: steps.cache-repo.outputs.cache-hit != 'true' - uses: actions/checkout@v3 - - # Log in to OpenShift. - # Note: The secrets needed to log in are NOT available if the PR comes from a FORK. - # PR's must originate from a branch off the original repo or else all openshift `oc` commands will fail. - - name: Log in to OpenShift - run: oc login --token=${{ secrets.TOOLS_SA_TOKEN }} --server=https://api.silver.devops.gov.bc.ca:6443 - - # Build the GeoServer image - - name: Build GeoServer Image - working-directory: "./geoserver/.pipeline/" - run: | - npm ci - DEBUG=* npm run build -- --pr=$PR_NUMBER - - # Deploy GeoServer image - deployGeoserver: - name: Deploy Geoserver Image - runs-on: ubuntu-latest - if: ${{ github.event.pull_request.merged == false && github.event.pull_request.draft == false }} - env: - PR_NUMBER: ${{ github.event.number }} - needs: - - scaleDownPods - - buildGeoserver - # - deployDatabase - # - deployDatabaseSetup - steps: - # Install Node - for `node` and `npm` commands - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: 14 - - # Load repo from cache - - name: Cache repo - uses: actions/cache@v3 - id: cache-repo - env: - cache-name: cache-repo - with: - path: ${{ github.workspace }}/* - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }} - - # Checkout the branch if not restored via cache - - name: Checkout Target Branch - if: steps.cache-repo.outputs.cache-hit != 'true' - uses: actions/checkout@v3 - - # Log in to OpenShift. - # Note: The secrets needed to log in are NOT available if the PR comes from a FORK. - # PR's must originate from a branch off the original repo or else all openshift `oc` commands will fail. - - name: Log in to OpenShift - run: oc login --token=${{ secrets.TOOLS_SA_TOKEN }} --server=https://api.silver.devops.gov.bc.ca:6443 - - # Deploy the GeoServer image - - name: Deploy GeoServer Image - working-directory: "./geoserver/.pipeline/" - run: | - npm ci - DEBUG=* npm run deploy -- --pr=$PR_NUMBER --env=dev diff --git a/.github/workflows/cleanClosedPR.yml b/.github/workflows/cleanClosedPR.yml index 3b48ab00d..04fd06f9c 100644 --- a/.github/workflows/cleanClosedPR.yml +++ b/.github/workflows/cleanClosedPR.yml @@ -73,13 +73,13 @@ jobs: DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=build DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=dev - # Clean the queue deployment artifacts - - name: Clean Queue Deployment - working-directory: "./api/.pipeline/" - run: | - npm ci - DEBUG=* npm run queue:clean -- --pr=$PR_NUMBER --env=build - DEBUG=* npm run queue:clean -- --pr=$PR_NUMBER --env=dev + # # Clean the queue deployment artifacts + # - name: Clean Queue Deployment + # working-directory: "./api/.pipeline/" + # run: | + # npm ci + # DEBUG=* npm run queue:clean -- --pr=$PR_NUMBER --env=build + # DEBUG=* npm run queue:clean -- --pr=$PR_NUMBER --env=dev # Clean the reamaining build/deployment artifacts - name: Clean remaining Artifacts diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 26c05479b..857c4ab73 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -46,7 +46,8 @@ jobs: # Set to `true` if the latest commit message contains `ignore-skip` anywhere in the message OR the base branch # is dev, test, or prod. # Used to disable duplicate action skipping, if needed. - ignore_skip: ${{ contains(steps.head_commit_message.outputs.commit_message, 'ignore-skip') || + ignore_skip: + ${{ contains(steps.head_commit_message.outputs.commit_message, 'ignore-skip') || github.head_ref == 'dev' || github.head_ref == 'test' || github.head_ref == 'prod' }} steps: - id: skip_check @@ -371,67 +372,67 @@ jobs: run: | DEBUG=* npm run build -- --pr=$PR_NUMBER - # Build the Queue image - buildQueue: - name: Build Queue Image - runs-on: ubuntu-latest - timeout-minutes: 20 - if: ${{ github.event.pull_request.merged == false && - github.event.pull_request.draft == false && - ( needs.skipDuplicateActions.outputs.ignore_skip == 'true' || - fromJSON(needs.skipDuplicateActions.outputs.paths_result).api.should_skip == false || - fromJSON(needs.skipDuplicateActions.outputs.paths_result).api.skipped_by.branch != github.head_ref ) }} - env: - PR_NUMBER: ${{ github.event.number }} - APP_NAME: "biohub-platform-api" - needs: - - checkoutRepo - - skipDuplicateActions - steps: - # Install Node - for `node` and `npm` commands - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: 14 - - # Load repo from cache - - name: Cache repo - uses: actions/cache@v3 - id: cache-repo - env: - cache-name: cache-repo - with: - path: ${{ github.workspace }}/* - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }} - - # Checkout the branch if not restored via cache - - name: Checkout Target Branch - if: steps.cache-repo.outputs.cache-hit != 'true' - uses: actions/checkout@v3 - - # Log in to OpenShift. - # Note: The secrets needed to log in are NOT available if the PR comes from a FORK. - # PR's must originate from a branch off the original repo or else all openshift `oc` commands will fail. - - name: Log in to OpenShift - run: oc login --token=${{ secrets.TOOLS_SA_TOKEN }} --server=https://api.silver.devops.gov.bc.ca:6443 - - # Scale down any existing OpenShift pods for this PR deployment - # Why? The new pods will be deployed before the existing pods are terminated, and twice the resources will be needed - # in that moment. If not enough resources are available to spin up the new pods, then they may fail to deploy. - - name: Scale down api pods - run: oc get deploymentconfig --namespace a0ec71-dev --selector env-id=$PR_NUMBER,app-name=$APP_NAME -o name | awk '{print "oc scale --replicas=0 " $1}' | bash - - # Install api pipeline node modules - # Note: This already caches node modules internally - - name: Install pipeline node modules - working-directory: api/.pipeline/ - run: npm ci - - # Build the queue image - - name: Build Queue Image - working-directory: "./api/.pipeline/" - run: | - DEBUG=* npm run queue:build -- --pr=$PR_NUMBER + # # Build the Queue image + # buildQueue: + # name: Build Queue Image + # runs-on: ubuntu-latest + # timeout-minutes: 20 + # if: ${{ github.event.pull_request.merged == false && + # github.event.pull_request.draft == false && + # ( needs.skipDuplicateActions.outputs.ignore_skip == 'true' || + # fromJSON(needs.skipDuplicateActions.outputs.paths_result).api.should_skip == false || + # fromJSON(needs.skipDuplicateActions.outputs.paths_result).api.skipped_by.branch != github.head_ref ) }} + # env: + # PR_NUMBER: ${{ github.event.number }} + # APP_NAME: "biohub-platform-api" + # needs: + # - checkoutRepo + # - skipDuplicateActions + # steps: + # # Install Node - for `node` and `npm` commands + # - name: Setup Node.js + # uses: actions/setup-node@v3 + # with: + # node-version: 14 + + # # Load repo from cache + # - name: Cache repo + # uses: actions/cache@v3 + # id: cache-repo + # env: + # cache-name: cache-repo + # with: + # path: ${{ github.workspace }}/* + # key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }} + + # # Checkout the branch if not restored via cache + # - name: Checkout Target Branch + # if: steps.cache-repo.outputs.cache-hit != 'true' + # uses: actions/checkout@v3 + + # # Log in to OpenShift. + # # Note: The secrets needed to log in are NOT available if the PR comes from a FORK. + # # PR's must originate from a branch off the original repo or else all openshift `oc` commands will fail. + # - name: Log in to OpenShift + # run: oc login --token=${{ secrets.TOOLS_SA_TOKEN }} --server=https://api.silver.devops.gov.bc.ca:6443 + + # # Scale down any existing OpenShift pods for this PR deployment + # # Why? The new pods will be deployed before the existing pods are terminated, and twice the resources will be needed + # # in that moment. If not enough resources are available to spin up the new pods, then they may fail to deploy. + # - name: Scale down api pods + # run: oc get deploymentconfig --namespace a0ec71-dev --selector env-id=$PR_NUMBER,app-name=$APP_NAME -o name | awk '{print "oc scale --replicas=0 " $1}' | bash + + # # Install api pipeline node modules + # # Note: This already caches node modules internally + # - name: Install pipeline node modules + # working-directory: api/.pipeline/ + # run: npm ci + + # # Build the queue image + # - name: Build Queue Image + # working-directory: "./api/.pipeline/" + # run: | + # DEBUG=* npm run queue:build -- --pr=$PR_NUMBER # Deploy APP image deployAPP: @@ -653,62 +654,62 @@ jobs: run: | DEBUG=* npm run deploy -- --pr=$PR_NUMBER --env=dev - # Deploy Queue image - deployQueue: - name: Deploy Queue Image - runs-on: ubuntu-latest - timeout-minutes: 20 - if: ${{ always() && - ( needs.deployDatabase.result == 'success' || needs.deployDatabase.result == 'skipped' ) && - github.event.pull_request.merged == false && - github.event.pull_request.draft == false && - ( needs.skipDuplicateActions.outputs.ignore_skip == 'true' || - fromJSON(needs.skipDuplicateActions.outputs.paths_result).api.should_skip == false || - fromJSON(needs.skipDuplicateActions.outputs.paths_result).api.skipped_by.branch != github.head_ref ) }} - env: - PR_NUMBER: ${{ github.event.number }} - needs: - - buildQueue - - deployDatabase - steps: - # Install Node - for `node` and `npm` commands - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: 14 - - # Load repo from cache - - name: Cache repo - uses: actions/cache@v3 - id: cache-repo - env: - cache-name: cache-repo - with: - path: ${{ github.workspace }}/* - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }} - - # Checkout the branch if not restored via cache - - name: Checkout Target Branch - if: steps.cache-repo.outputs.cache-hit != 'true' - uses: actions/checkout@v3 - - # Log in to OpenShift. - # Note: The secrets needed to log in are NOT available if the PR comes from a FORK. - # PR's must originate from a branch off the original repo or else all openshift `oc` commands will fail. - - name: Log in to OpenShift - run: oc login --token=${{ secrets.TOOLS_SA_TOKEN }} --server=https://api.silver.devops.gov.bc.ca:6443 - - # Install api pipeline node modules - # Note: This already caches node modules internally - - name: Install pipeline node modules - working-directory: api/.pipeline/ - run: npm ci - - # Deploy the queue image - - name: Deploy Queue Image - working-directory: "./api/.pipeline/" - run: | - DEBUG=* npm run queue:deploy -- --pr=$PR_NUMBER --env=dev + # # Deploy Queue image + # deployQueue: + # name: Deploy Queue Image + # runs-on: ubuntu-latest + # timeout-minutes: 20 + # if: ${{ always() && + # ( needs.deployDatabase.result == 'success' || needs.deployDatabase.result == 'skipped' ) && + # github.event.pull_request.merged == false && + # github.event.pull_request.draft == false && + # ( needs.skipDuplicateActions.outputs.ignore_skip == 'true' || + # fromJSON(needs.skipDuplicateActions.outputs.paths_result).api.should_skip == false || + # fromJSON(needs.skipDuplicateActions.outputs.paths_result).api.skipped_by.branch != github.head_ref ) }} + # env: + # PR_NUMBER: ${{ github.event.number }} + # needs: + # - buildQueue + # - deployDatabase + # steps: + # # Install Node - for `node` and `npm` commands + # - name: Setup Node.js + # uses: actions/setup-node@v3 + # with: + # node-version: 14 + + # # Load repo from cache + # - name: Cache repo + # uses: actions/cache@v3 + # id: cache-repo + # env: + # cache-name: cache-repo + # with: + # path: ${{ github.workspace }}/* + # key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }} + + # # Checkout the branch if not restored via cache + # - name: Checkout Target Branch + # if: steps.cache-repo.outputs.cache-hit != 'true' + # uses: actions/checkout@v3 + + # # Log in to OpenShift. + # # Note: The secrets needed to log in are NOT available if the PR comes from a FORK. + # # PR's must originate from a branch off the original repo or else all openshift `oc` commands will fail. + # - name: Log in to OpenShift + # run: oc login --token=${{ secrets.TOOLS_SA_TOKEN }} --server=https://api.silver.devops.gov.bc.ca:6443 + + # # Install api pipeline node modules + # # Note: This already caches node modules internally + # - name: Install pipeline node modules + # working-directory: api/.pipeline/ + # run: npm ci + + # # Deploy the queue image + # - name: Deploy Queue Image + # working-directory: "./api/.pipeline/" + # run: | + # DEBUG=* npm run queue:deploy -- --pr=$PR_NUMBER --env=dev # Report the overall status of all jobs. # Why? Skipped jobs are not considered successes when specifying requird jobs in the GitHub PR settings. Rather than @@ -730,12 +731,12 @@ jobs: - buildDatabase - buildDatabaseSetup - buildAPI - - buildQueue + # - buildQueue - deployAPP - deployDatabase - deployDatabaseSetup - deployAPI - - deployQueue + # - deployQueue steps: - name: Log result run: | @@ -746,12 +747,12 @@ jobs: echo needs.buildDatabase.result: ${{ needs.buildDatabase.result }} echo needs.buildDatabaseSetup.result: ${{ needs.buildDatabaseSetup.result }} echo needs.buildAPI.result: ${{ needs.buildAPI.result }} - echo needs.buildQueue.result: ${{ needs.buildQueue.result }} + # echo needs.buildQueue.result: ${{ needs.buildQueue.result }} echo needs.deployAPP.result: ${{ needs.deployAPP.result }} echo needs.deployDatabase.result: ${{ needs.deployDatabase.result }} echo needs.deployDatabaseSetup.result: ${{ needs.deployDatabaseSetup.result }} echo needs.deployAPI.result: ${{ needs.deployAPI.result }} - echo needs.deployQueue.result: ${{ needs.deployQueue.result }} + # echo needs.deployQueue.result: ${{ needs.deployQueue.result }} - name: Report success if: | diff --git a/.github/workflows/deployStatic.yml b/.github/workflows/deployStatic.yml index 4d0b256f2..58b73dfce 100644 --- a/.github/workflows/deployStatic.yml +++ b/.github/workflows/deployStatic.yml @@ -285,55 +285,55 @@ jobs: run: | DEBUG=* npm run build -- --pr=$PR_NUMBER --branch=$BRANCH --type=static - # Build the Queue image - buildQueue: - name: Build Queue Image - runs-on: ubuntu-latest - timeout-minutes: 20 - if: ${{ github.event.pull_request.merged == true }} - env: - PR_NUMBER: ${{ github.event.number }} - BRANCH: ${{ github.base_ref }} - needs: - - checkoutRepo - steps: - # Install Node - for `node` and `npm` commands - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: 14 - - # Load repo from cache - - name: Cache repo - uses: actions/cache@v3 - id: cache-repo - env: - cache-name: cache-repo - with: - path: ${{ github.workspace }}/* - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }} - - # Checkout the branch if not restored via cache - - name: Checkout Target Branch - if: steps.cache-repo.outputs.cache-hit != 'true' - uses: actions/checkout@v3 - - # Log in to OpenShift. - # Note: The secrets needed to log in are NOT available if the PR comes from a FORK. - # PR's must originate from a branch off the original repo or else all openshift `oc` commands will fail. - - name: Log in to OpenShift - run: oc login --token=${{ secrets.TOOLS_SA_TOKEN }} --server=https://api.silver.devops.gov.bc.ca:6443 - - # Install api pipeline node modules - - name: Install api pipeline node modules - working-directory: "api/.pipeline/" - run: npm ci - - # Build the queue image - - name: Build Queue Image - working-directory: "./api/.pipeline/" - run: | - DEBUG=* npm run queue:build -- --pr=$PR_NUMBER --branch=$BRANCH --type=static + # # Build the Queue image + # buildQueue: + # name: Build Queue Image + # runs-on: ubuntu-latest + # timeout-minutes: 20 + # if: ${{ github.event.pull_request.merged == true }} + # env: + # PR_NUMBER: ${{ github.event.number }} + # BRANCH: ${{ github.base_ref }} + # needs: + # - checkoutRepo + # steps: + # # Install Node - for `node` and `npm` commands + # - name: Setup Node.js + # uses: actions/setup-node@v3 + # with: + # node-version: 14 + + # # Load repo from cache + # - name: Cache repo + # uses: actions/cache@v3 + # id: cache-repo + # env: + # cache-name: cache-repo + # with: + # path: ${{ github.workspace }}/* + # key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }} + + # # Checkout the branch if not restored via cache + # - name: Checkout Target Branch + # if: steps.cache-repo.outputs.cache-hit != 'true' + # uses: actions/checkout@v3 + + # # Log in to OpenShift. + # # Note: The secrets needed to log in are NOT available if the PR comes from a FORK. + # # PR's must originate from a branch off the original repo or else all openshift `oc` commands will fail. + # - name: Log in to OpenShift + # run: oc login --token=${{ secrets.TOOLS_SA_TOKEN }} --server=https://api.silver.devops.gov.bc.ca:6443 + + # # Install api pipeline node modules + # - name: Install api pipeline node modules + # working-directory: "api/.pipeline/" + # run: npm ci + + # # Build the queue image + # - name: Build Queue Image + # working-directory: "./api/.pipeline/" + # run: | + # DEBUG=* npm run queue:build -- --pr=$PR_NUMBER --branch=$BRANCH --type=static # Deploy APP image deployAPP: @@ -541,58 +541,58 @@ jobs: run: | DEBUG=* npm run deploy -- --pr=$PR_NUMBER --env=$BRANCH --branch=$BRANCH --type=static - # Deploy Queue image - deployQueue: - name: Deploy Queue Image - runs-on: ubuntu-latest - timeout-minutes: 20 - if: ${{ github.event.pull_request.merged == true }} - env: - PR_NUMBER: ${{ github.event.number }} - BRANCH: ${{ github.base_ref }} - needs: - - scaleDownPods - - buildQueue - - deployDatabase - steps: - # Install Node - for `node` and `npm` commands - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: 14 - - # Load repo from cache - - name: Cache repo - uses: actions/cache@v3 - id: cache-repo - env: - cache-name: cache-repo - with: - path: ${{ github.workspace }}/* - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }} - - # Checkout the branch if not restored via cache - - name: Checkout Target Branch - if: steps.cache-repo.outputs.cache-hit != 'true' - uses: actions/checkout@v3 - - # Log in to OpenShift. - # Note: The secrets needed to log in are NOT available if the PR comes from a FORK. - # PR's must originate from a branch off the original repo or else all openshift `oc` commands will fail. - - name: Log in to OpenShift - run: oc login --token=${{ secrets.TOOLS_SA_TOKEN }} --server=https://api.silver.devops.gov.bc.ca:6443 - - # Install api pipeline node modules - - name: Install api pipeline node modules - working-directory: "api/.pipeline/" - run: npm ci - - # Deploy the queue image - - name: Deploy Queue Image - working-directory: "./api/.pipeline/" - run: | - npm ci - DEBUG=* npm run queue:deploy -- --pr=$PR_NUMBER --env=$BRANCH --branch=$BRANCH --type=static + # # Deploy Queue image + # deployQueue: + # name: Deploy Queue Image + # runs-on: ubuntu-latest + # timeout-minutes: 20 + # if: ${{ github.event.pull_request.merged == true }} + # env: + # PR_NUMBER: ${{ github.event.number }} + # BRANCH: ${{ github.base_ref }} + # needs: + # - scaleDownPods + # - buildQueue + # - deployDatabase + # steps: + # # Install Node - for `node` and `npm` commands + # - name: Setup Node.js + # uses: actions/setup-node@v3 + # with: + # node-version: 14 + + # # Load repo from cache + # - name: Cache repo + # uses: actions/cache@v3 + # id: cache-repo + # env: + # cache-name: cache-repo + # with: + # path: ${{ github.workspace }}/* + # key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }} + + # # Checkout the branch if not restored via cache + # - name: Checkout Target Branch + # if: steps.cache-repo.outputs.cache-hit != 'true' + # uses: actions/checkout@v3 + + # # Log in to OpenShift. + # # Note: The secrets needed to log in are NOT available if the PR comes from a FORK. + # # PR's must originate from a branch off the original repo or else all openshift `oc` commands will fail. + # - name: Log in to OpenShift + # run: oc login --token=${{ secrets.TOOLS_SA_TOKEN }} --server=https://api.silver.devops.gov.bc.ca:6443 + + # # Install api pipeline node modules + # - name: Install api pipeline node modules + # working-directory: "api/.pipeline/" + # run: npm ci + + # # Deploy the queue image + # - name: Deploy Queue Image + # working-directory: "./api/.pipeline/" + # run: | + # npm ci + # DEBUG=* npm run queue:deploy -- --pr=$PR_NUMBER --env=$BRANCH --branch=$BRANCH --type=static # Clean build/deployment artifacts clean: @@ -660,13 +660,13 @@ jobs: DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=build DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=dev - # Clean the queue deployment artifacts - - name: Clean Queue Deployment - working-directory: "./api/.pipeline/" - run: | - npm ci - DEBUG=* npm run queue:clean -- --pr=$PR_NUMBER --env=build - DEBUG=* npm run queue:clean -- --pr=$PR_NUMBER --env=dev + # # Clean the queue deployment artifacts + # - name: Clean Queue Deployment + # working-directory: "./api/.pipeline/" + # run: | + # npm ci + # DEBUG=* npm run queue:clean -- --pr=$PR_NUMBER --env=build + # DEBUG=* npm run queue:clean -- --pr=$PR_NUMBER --env=dev # Clean the reamaining build/deployment artifacts - name: Clean remaining Artifacts diff --git a/.gitignore b/.gitignore index 72cc6bde0..f72d5ede9 100644 --- a/.gitignore +++ b/.gitignore @@ -108,8 +108,3 @@ dist # Apple macOS folder attributes file **/.DS_Store - -# n8N - ignore root level temp config folder -.n8n -n8n/.n8n -n8n/.config diff --git a/Containers/geoserver/README.md b/Containers/geoserver/README.md deleted file mode 100644 index 0c1d50135..000000000 --- a/Containers/geoserver/README.md +++ /dev/null @@ -1,157 +0,0 @@ -# GeoServer - -Dockerized GeoServer comes from https://github.com/NickPhura/docker-geoserver which is a modified fork of https://github.com/kartoza/docker-geoserver - -- Modifications were needed to make the original kartoza docker setup compatible with OpenShift, specifically due to how OpenShift controls users/permissions within its pods (containers). - -The GeoServer project, and its documentation, can be found here: https://geoserver.org/ - -Description of the files: - -`./kartoza-geoserver`: contains OpenShift templates for building a GeoServer build config and image stream. -`./kartoza-geoserver/geoserver.cm.yaml`: an OpenShift config map template. -`./kartoza-geoserver/geoserver.bc.yaml`: an OpenShift build config template. -`./kartoza-geoserver/geoserver.dc.yaml`: an OpenShift deployment config template. - -# Installation - -The base geoserver image can be built in OpenShift from the steps below. - -See steps `1` and `2` for initial installation. -See step `3` for updates to an existing installation. - -# 1. Create Base GeoServer Image In OpenShift - -**_Note: All of these steps should be done in the OpenShift Tools Project (ie: `a0ec71-tools`)_** - -## 1. Upload Templates - -### 1.1 Upload ConfigMap (`geoserver.cm.yaml`) Template - -- Ensure the environment values in `geoserver.cm.yaml` specify the correct values. - - These can be easily changed after the template is uploaded, but should be persisted in `geoserver.cm.yaml` for backup. -- Follow the steps in [How to Upload a Template](#how-to-upload-a-template). -- This will automatically create a new ConfigMap (no template processing needed) - -_Note: This config map is simply a placeholder for the env vars. To make them accessible by the build config, you still need to include an entry in the `env` section of `geoserver.bc.yaml` for each variable. Similar to how secrets are added as variables to build/deployment configs._ - -### 1.2. Upload BuildConfig (`geoserver.bc.yaml`) Template - -- Ensure the environment values in `geoserver.bc.yaml` specify the correct values. - - In particular, the variables related to the repo url/ref, context/dockerfile paths, and version. -- Follow the steps in [How to Upload a Template](#how-to-upload-a-template). - -### 1.3. Upload Secret (`geoserver.secret.yaml`) Template - -- Follow the steps in [How to Upload a Template](#how-to-upload-a-template). - -_Note: This template includes no values for the secret keys (as they cannot be saved in the repo). See [Update Secret Values](#update-secret-values) for modifying the secret._ - -## 2. Update Secret Values - -- Under `Workloads -> Secrets -> ` - - Edit the secret, and enter a value for the secrets. - -## 3. Process The BuildConfig Template - -- See [Process A Template](#process-a-template) - -### 4. Run The BuildConfig - -### 4.1 Modify The BuildConfig (If Temporary Changes Are Needed) - -- You can still make modifications to the BuildConfig at this stage. - - Click on your build config (under `Builds -> BuildConfigs`) - - Under the `Actions` drop down, click `Edit BuildConfig`. - - You can edit it via a Form view or YAML view. - -_Note: Any modifications that are not intended to be temporary should be persisted in `geoserver.cm.yaml` for backup._ - -### 4.2. Run The BuildConfig - -- From the build config page, under the `Actions` drop down, click `Start Build`. - - This will generate a new item under `Builds -> Builds`, which will in turn create a new item under the `Builds -> ImageStreams`. - - Keep an eye on the build logs to ensure it builds correctly. This may take several minutes. - - If successful, it will finish with a log message like: `Successfully pushed image-registry.openshift-image-registry ...` - -# 2. Deploy GeoServer Image In OpenShift - -**_Note: All of these steps should be done in the OpenShift Dev/Test/Prod Project (ie: a0ec71-dev)_** - -## 1. Upload DeploymentConfig (`geoserver.dc.yaml`) Template - -- Ensure the environment values in `geoserver.dc.yaml` specify the correct values. -- Follow the steps in [How to Upload a Template](#how-to-upload-a-template). - -## 2. Process The DeploymentConfig Template - -- See [Process A Template](#process-a-template) - -## 3. Run the DeploymentConfig - -- From the build config page, under the `Actions` drop down, click `Start Build`. - - This will generate a new item under `Builds -> Builds`, which will in turn create a new item under the `Builds -> ImageStreams`. - - Keep an eye on the build logs to ensure it builds correctly. This may take several minutes. - - If successful, it will finish with a log message like: `Successfully pushed image-registry.openshift-image-registry ...` - -# 3. Updating The Base Image In OpenShift And Re-Deploying - -If there is a newer version of the geoserver project available, follow the below steps to update the base image and deploy the new version. - -## 1. Generated An Updated Image - -In the OpenShift Tools Project (ie: a0ec71-tools): - -- See [Run the BuildConfig](#42-Run-The-BuildConfig) -- This will generate a new `Build` which if successful will update the `ImageStream` from the latest geoserver project code - -## 2. Re-Tag the ImageStream - -In the OpenShift Dev/Test/Prod Project (ie: a0ec71-dev): - -- In a compatible cli, where you have logged into the OpenShift CLI, execute the following command: - - ``` - oc tag a0ec71-tools/kartoza-geoserver:latest a0ec71-dev/kartoza-geoserver:latest - ``` - -This will update the ImageStream in the `` environment to point to the latest version of the base ImageStream in the `tools` environment. - -- Confirm by checking that the `sha` number matches in both ImageStreams. - -This will also trigger an automatic re-deploy of the geoserver deployment config, which should roll out a new pod using the latest ImageStream tag. - -# How To Upload A Template - -- In the top right corner of the OpenShift UI, there is a circular plus button `(+)`. -- Click it and paste the template into the upload window. -- If there are any glaring errors, it will prompt you to address them. -- Click `Create`. - -# Find An Existing Template - -- Templates can be found via the `Home -> API Explorer` page. -- Filter `All groups` to `template.openshift.io`. -- Click `Template` from the list of results`. -- Click `Instances` from the subsequent page. -- From here you can view, edit, delete the template uploaded in the previous step. - -# Process A Template - -- In a compatible cli, where you have logged into the OpenShift CLI, execute the following command: - - ``` - oc process