Skip to content

Commit

Permalink
Revert "Update Workflow to Publish image, Deployment. Fix Codebase vu…
Browse files Browse the repository at this point in the history
…lnerability"
  • Loading branch information
pirupius authored Sep 14, 2023
1 parent a3aac89 commit a1c0cc2
Show file tree
Hide file tree
Showing 12 changed files with 100 additions and 468 deletions.
29 changes: 0 additions & 29 deletions .github/workflows/.ssh/known_hosts

This file was deleted.

27 changes: 0 additions & 27 deletions .github/workflows/.ssh/known_hosts.old

This file was deleted.

115 changes: 30 additions & 85 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: OHRI CI -
name: OHRI CI

on:
push:
Expand Down Expand Up @@ -128,97 +128,42 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}

docker_devserver_frontend:
runs-on: ubuntu-latest
needs: docker_setup

steps:
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push
uses: docker/build-push-action@v4
with:
context: ./frontend
file: ./frontend/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ secrets.DOCKERHUB_USERNAME }}/ohri-dev-frontend:next,${{ secrets.DOCKERHUB_USERNAME }}/ohri-dev-frontend:ci_${{ github.run_number }}
cache-from: type=inline,ref=user/app:buildcache
cache-to: type=inline,ref=user/app:buildcache,mode=max

dev_server_status:
if: github.ref == 'refs/heads/dev'
runs-on: ubuntu-latest
needs: docker_staging_backend
working:
runs-on: ubuntu-latest

steps:
- name: Wait for 5 minutos - Let Images reflect on Docker Hub
run: sleep 300
- name: Checkout repository
uses: actions/checkout@v3
needs: pre_release

- name: Copy files to /home/runner/
run: |
ls -la -t
cp -r $GITHUB_WORKSPACE/.ssh/ /home/runner/
if: ${{ github.ref == 'refs/heads/working' }}

- name: List contents of /home/runner/
run: ls -la /home/runner/
steps:
# Update the Microfrontends to reflect what we have in the Working branch
- uses: garygrossgarten/github-action-ssh@release
name: Run the Update MicroFronEnd Script
with:
command: cd /usr/share/tomcat/microfrontends/working && /bin/bash update_microfrontends.sh
host: ${{ secrets.HISTAC_HOST }}
username: ${{ secrets.HISTAC_USERNAME }}
privateKey: ${{ secrets.HISTAC_KEY}}
port: ${{ secrets.HISTAC_PORT }}

- name: webfactory/ssh-agent
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.LL_SSH_PRIVATE_KEY }}

- name: Check SSH to remote OHRI Dev status
run: |
ssh-keygen -R 172.19.0.16
dev_server_connection_dev:
runs-on: ubuntu-latest
needs: dev_server_status
steps:
- name: SSH to remote OHRI Dev server
run: |
ssh -o StrictHostKeyChecking=no -T [email protected] -p 2216 -J [email protected] -p 2202
ls -la -t && \
cd /opt && \
ls -la -t
dev_deploy:
ohri_dev:
runs-on: ubuntu-latest
needs: dev_server_status

if: (github.event_name == 'push' || github.event.pull_request.merged)

steps:
- name: Checkout code
uses: actions/checkout@v2
needs: pre_release

- name: webfactory/ssh-agent
uses: webfactory/[email protected]
if: ${{ github.ref == 'refs/heads/dev' }}

steps:
- name: Download Artifacts
uses: actions/download-artifact@v3
- name: Compute Timestamp
run: echo "TIMESTAMP=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- uses: garygrossgarten/github-action-ssh@release
name: Run the Update MicroFronEnd Script
with:
ssh-private-key: ${{ secrets.LL_SSH_PRIVATE_KEY }}
command: cd /usr/share/tomcat/microfrontends/dev && /bin/bash update_microfrontends.sh
host: ${{ secrets.HISTAC_HOST }}
username: ${{ secrets.HISTAC_USERNAME }}
privateKey: ${{ secrets.HISTAC_KEY}}

- name: SSH to remote OHRI Dev server via jump host
run: |
ssh -p 2216 \
-o "UserKnownHostsFile=/dev/null" \
-o "StrictHostKeyChecking=no" \
-o "ProxyCommand=ssh -o StrictHostKeyChecking=no -W %h:%p [email protected] -p 2202" \
[email protected] "\
cd /opt && \
docker compose -f docker-compose-ohri-dev.yml pull && \
docker compose -f docker-compose-ohri-dev.yml stop && \
docker compose -f docker-compose-ohri-dev.yml up -d"
port: ${{ secrets.HISTAC_PORT }}
35 changes: 0 additions & 35 deletions frontend/Dockerfile

This file was deleted.

Loading

0 comments on commit a1c0cc2

Please sign in to comment.