test socks5 #65
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Jenkins Deployment via SSH Port Forwarding | |
# on: | |
# workflow_run: | |
# workflows: ["Terraform Deployment"] | |
# types: | |
# - completed | |
on: | |
push: | |
branches: | |
- task_xxx # Replace with your branch name to test GitHub Actions without pushing to the dev branch | |
- task_4 | |
- dev | |
jobs: | |
deploy-jenkins: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup SOCKS5 Proxy | |
env: | |
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | |
BASTION_HOST: ${{ vars.BASTION_HOST }} | |
K3S_SERVER_HOST: ${{ vars.K3S_SERVER_HOST }} | |
BASTION_USER: ${{ vars.BASTION_USER }} | |
EC2_USER: ${{ vars.EC2_USER }} | |
run: | | |
# Start SSH agent and add the SSH key | |
eval "$(ssh-agent -s)" | |
echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - | |
ssh -D 1080 -N -q -o StrictHostKeyChecking=no "$BASTION_USER@$BASTION_HOST" & | |
# env: | |
# KUBECONFIG: ${{ vars.K3S_CONFIG }} | |
# run: | | |
# # Download your k3s.yml from the EC2 instance | |
# scp -J "$EC2_USER@$BASTION_HOST" "$EC2_USER@$K3S_SERVER_HOST:/etc/rancher/k3s/k3s.yml" $KUBECONFIG | |
- name: Deploy Jenkinss | |
env: | |
KUBECONFIG: /tmp/k3s.yml | |
run: | | |
echo "${{ vars.K3S_CONFIG }}" >> $KUBECONFIG | |
cat /tmp/k3s.yml | |
kubectl get pods -A | |
# kubectl create namespace jenkins | |
# kubectl apply -f jenkins-volume.yaml | |
# kubectl apply -f jenkins-sa.yaml | |
# helm repo add jenkins https://charts.jenkins.io | |
# helm repo update | |
# helm install jenkins -n jenkins -f jenkins-values.yaml jenkins/jenkins | |
# kubectl exec --namespace jenkins -it svc/jenkins -c jenkins -- /bin/cat /run/secrets/additional/chart-admin-password && echo |