Skip to content
Merged

Deploy #1153

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions .github/workflows/google-gce-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,26 +73,29 @@ jobs:

- name: Deploy to Compute Engine
run: |
# Setup SSH credentials
SSH_DIR=~/.ssh
mkdir -p $SSH_DIR
echo "${{ secrets.GCP_SSH_PRIVATE_KEY }}" > $SSH_DIR/id_rsa
chmod 600 $SSH_DIR/id_rsa
ssh-keyscan -H ${{ env.GCP_VM_IP }} >> $SSH_DIR/known_hosts
ssh-keyscan -p ${{ vars.SSH_PORT }} -H ${{ env.GCP_VM_IP }} >> $SSH_DIR/known_hosts

# Define remote path
REMOTE_PATH="/home/${{ env.GCP_VM_USER }}/${{ env.GCP_ARTIFACT_REGISTRY_NAME }}"
REMOTE_PATH="/home/${{ env.GCP_VM_USER }}/${{ env.GCP_PROJECT_ID }}/${{ env.GCP_ARTIFACT_REGISTRY_NAME }}"

# Create remote directory and transfer files in one SSH session
echo "Creating remote path"
ssh -i $SSH_DIR/id_rsa ${{ env.GCP_VM_USER }}@${{ env.GCP_VM_IP }} "mkdir -p $REMOTE_PATH"
ssh -p ${{ vars.SSH_PORT }} -i $SSH_DIR/id_rsa ${{ env.GCP_VM_USER }}@${{ env.GCP_VM_IP }} "mkdir -p $REMOTE_PATH"
echo "Sending files"
scp -i $SSH_DIR/id_rsa compose.yaml deploy_to_vm.sh ${{ env.GCP_VM_USER }}@${{ env.GCP_VM_IP }}:$REMOTE_PATH
scp -P ${{ vars.SSH_PORT }} -i $SSH_DIR/id_rsa compose.yaml deploy_to_vm.sh ${{ env.GCP_VM_USER }}@${{ env.GCP_VM_IP }}:"$REMOTE_PATH/"

ssh -i $SSH_DIR/id_rsa ${{ env.GCP_VM_USER }}@${{ env.GCP_VM_IP }} 'bash -s' << 'ENDSSH'
echo "Deploy"
# SSH into VM and execute deployment
ssh -p ${{ vars.SSH_PORT }} -i $SSH_DIR/id_rsa ${{ env.GCP_VM_USER }}@${{ env.GCP_VM_IP }} 'bash -s' << 'ENDSSH'

# Go to working directory
echo "Going to working directory"
cd "/home/${{ env.GCP_VM_USER }}/${{ env.GCP_ARTIFACT_REGISTRY_NAME }}"
cd "/home/${{ env.GCP_VM_USER }}/${{ env.GCP_PROJECT_ID }}/${{ env.GCP_ARTIFACT_REGISTRY_NAME }}"

# Create .env.gcp file
echo "Creating .env.gcp file"
Expand Down
2 changes: 1 addition & 1 deletion api/customAttributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ module.exports = function(app) {
const retObj = {
...colorMapping,
breadcrumbs,
freightYear: 2023,
freightYear: 2024,
neverShow: false,
geoservice: CANON_GEOSERVICE_API,
tesseract: CANON_CONST_TESSERACT,
Expand Down
12 changes: 4 additions & 8 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -1,37 +1,33 @@
services:
site: &app
container_name: site
container_name: datausa-site
image: ${GCP_ARTIFACT_REGISTRY_LOCATION}-docker.pkg.dev/${GCP_PROJECT_ID}/${GCP_ARTIFACT_REGISTRY_NAME}/${GCP_IMAGE_NAME}:${GCP_IMAGE_TAG}
restart: always
stop_signal: SIGTERM
stop_grace_period: 30s
volumes:
- "/home/${GCP_VM_USER}/${GCP_ARTIFACT_REGISTRY_NAME}-${GCP_IMAGE_NAME}/google:/app/google/"
env_file:
- .env.gcp
networks:
- site
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- "3300:3300"
- "9997:3300"

site-1: &app
container_name: site-1
container_name: datausa-site-1
image: ${GCP_ARTIFACT_REGISTRY_LOCATION}-docker.pkg.dev/${GCP_PROJECT_ID}/${GCP_ARTIFACT_REGISTRY_NAME}/${GCP_IMAGE_NAME}:${GCP_IMAGE_TAG}
restart: always
stop_signal: SIGTERM
stop_grace_period: 30s
volumes:
- "/home/${GCP_VM_USER}/${GCP_ARTIFACT_REGISTRY_NAME}-${GCP_IMAGE_NAME}/google:/app/google/"
env_file:
- .env.gcp
networks:
- site
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- "3301:3300"
- "9996:3300"

networks:
site:
Expand Down
16 changes: 0 additions & 16 deletions results-20240930-104515.txt

This file was deleted.