Skip to content

Commit

Permalink
Run helm through bastion
Browse files Browse the repository at this point in the history
  • Loading branch information
minottic committed Dec 7, 2023
1 parent af43614 commit 6e812a2
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 48 deletions.
1 change: 0 additions & 1 deletion .github/actions/open-ssh-tunnel/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,4 @@ runs:
ssh-keyscan ${BASTION_USER#*@} > .ssh/known_hosts 2> /dev/null;
chmod 644 .ssh/known_hosts;
ssh -i .ssh/github_bastion ${{ inputs.bastion_user }} -o UserKnownHostsFile=.ssh/known_hosts -D 1080 -f -q -N;
ps -ax | grep ssh | grep -v grep | awk '{print $1}' | xargs kill;
shell: bash
3 changes: 0 additions & 3 deletions .github/workflows/reusable.build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,3 @@ jobs:
secrets: '${{ secrets.JSON_SECRETS }}'
env:
KUBECONFIG_FILE: '${{ secrets.KUBECONFIG }}'

- name: Close ssh connection
run:
79 changes: 35 additions & 44 deletions .github/workflows/scicat-search-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
description: 'Commit of the CI repo to deploy'
required: false
pull_request:
branches: [ main]
branches: [ main ]
push:
branches: [ main ]
release:
Expand All @@ -20,54 +20,45 @@ jobs:

ssh:

runs-on: ubuntu-latest
environment: development
steps:
- name: Open ssh tunnel
uses: paulscherrerinstitute/scicat-ci/.github/actions/open-ssh-tunnel@bastion_ssh
with:
bastion_user: '${{ secrets.BASTION_USER }}'
bastion_ssh_key: '${{ secrets.BASTION_SSH_KEY }}'

set_env:
needs: ssh
uses: ./.github/workflows/reusable.environment.yml
with:
commit: ${{ github.event.inputs.commit }}
submodule_commit: ${{ github.event.inputs.submodule_commit }}

# check_changed:
# needs: set_env
# uses: ./.github/workflows/reusable.changes.yml
# with:
# files: |
# .github/workflows/scicat-search-api.yml
# helm/configs/search-api/${{ needs.set_env.outputs.environment }}/**
# helm/configs/search-api/values.yaml
# search-api/**
# commit: ${{ needs.set_env.outputs.commit }}
# submodule_commit: ${{ github.event.inputs.submodule_commit }}
# submodule: search-api
check_changed:
needs: set_env
uses: ./.github/workflows/reusable.changes.yml
with:
files: |
.github/workflows/scicat-search-api.yml
helm/configs/search-api/${{ needs.set_env.outputs.environment }}/**
helm/configs/search-api/values.yaml
search-api/**
commit: ${{ needs.set_env.outputs.commit }}
submodule_commit: ${{ github.event.inputs.submodule_commit }}
submodule: search-api

# build_deploy_scicat_search_api:
# if: (needs.check_changed.outputs.changed == 'true' && !needs.set_env.outputs.component) || needs.set_env.outputs.component == 'sa'
# needs:
# - check_changed
# - set_env
# uses: ./.github/workflows/reusable.build-deploy.yml
# with:
# context: search-api/.
# image_name: ${{ github.repository }}/search-api
# release_name: search-api
# tag: ${{ needs.set_env.outputs.tag }}
# environment: ${{ needs.set_env.outputs.environment }}
# commit: ${{ needs.set_env.outputs.commit }}
# submodule_commit: ${{ github.event.inputs.submodule_commit }}
# submodule: search-api
# helm_set_files: >-
# CONFIG=helm/configs/search-api/config.json
# COMPONENT_CONFIG=helm/configs/search-api/component-config.json
# secrets:
# KUBECONFIG: ${{ secrets.KUBECONFIG }}
# BASTION_USER: ${{ secrets.BASTION_USER }}
# BASTION_SSH_KEY: ${{ secrets.BASTION_SSH_KEY }}
build_deploy_scicat_search_api:
if: (needs.check_changed.outputs.changed == 'true' && !needs.set_env.outputs.component) || needs.set_env.outputs.component == 'sa'
needs:
- check_changed
- set_env
uses: ./.github/workflows/reusable.build-deploy.yml
with:
context: search-api/.
image_name: ${{ github.repository }}/search-api
release_name: search-api
tag: ${{ needs.set_env.outputs.tag }}
environment: ${{ needs.set_env.outputs.environment }}
commit: ${{ needs.set_env.outputs.commit }}
submodule_commit: ${{ github.event.inputs.submodule_commit }}
submodule: search-api
helm_set_files: >-
CONFIG=helm/configs/search-api/config.json
COMPONENT_CONFIG=helm/configs/search-api/component-config.json
secrets:
KUBECONFIG: ${{ secrets.KUBECONFIG }}
BASTION_USER: ${{ secrets.BASTION_USER }}
BASTION_SSH_KEY: ${{ secrets.BASTION_SSH_KEY }}

0 comments on commit 6e812a2

Please sign in to comment.