pipeline build v12 - working pipeline with repos
This commit is contained in:
parent
637c7b27b9
commit
dfedd49651
@ -1,5 +1,5 @@
|
|||||||
steps:
|
steps:
|
||||||
ssh-test:
|
push-to-staging:
|
||||||
image: google/cloud-sdk:latest
|
image: google/cloud-sdk:latest
|
||||||
commands:
|
commands:
|
||||||
- |
|
- |
|
||||||
@ -7,19 +7,23 @@ steps:
|
|||||||
set -eu
|
set -eu
|
||||||
mkdir -p ~/.ssh
|
mkdir -p ~/.ssh
|
||||||
|
|
||||||
# Decode known hosts
|
# Inject known hosts
|
||||||
gcloud secrets versions access latest --secret=STAGING_KNOWN_HOSTS --project=aptivaai-dev | base64 -d > ~/.ssh/known_hosts
|
gcloud secrets versions access latest --secret=STAGING_KNOWN_HOSTS --project=aptivaai-dev | base64 -d > ~/.ssh/known_hosts
|
||||||
chmod 644 ~/.ssh/known_hosts
|
chmod 644 ~/.ssh/known_hosts
|
||||||
|
|
||||||
# Inject SSH key
|
# Inject SSH key for staging push
|
||||||
gcloud secrets versions access latest --secret=STAGING_SSH_KEY --project=aptivaai-dev | base64 -d > ~/.ssh/id_ed25519
|
gcloud secrets versions access latest --secret=STAGING_SSH_KEY --project=aptivaai-dev | base64 -d > ~/.ssh/id_ed25519
|
||||||
|
|
||||||
chmod 600 ~/.ssh/id_ed25519
|
chmod 600 ~/.ssh/id_ed25519
|
||||||
|
|
||||||
# Verify key integrity
|
# Verify injected key (optional)
|
||||||
echo "Key size: $(wc -c < ~/.ssh/id_ed25519) bytes"
|
echo "Key size: $(wc -c < ~/.ssh/id_ed25519) bytes"
|
||||||
file ~/.ssh/id_ed25519 || echo "file not found"
|
head -n 2 ~/.ssh/id_ed25519
|
||||||
head -n 5 ~/.ssh/id_ed25519
|
|
||||||
|
|
||||||
# Attempt SSH
|
# Pull latest master from origin
|
||||||
ssh -vvv -i ~/.ssh/id_ed25519 -o StrictHostKeyChecking=yes jcoakley@10.128.0.12 hostname
|
git config --global user.name "Woodpecker CI"
|
||||||
|
git config --global user.email "ci@aptivaai.com"
|
||||||
|
git clone https://jcoakley:f4bf7ac91bdbd16bf47d241860198ba0bbe4b5c6@gitea.dev1.aptivaai.com/jcoakley/dev1.git repo
|
||||||
|
cd repo
|
||||||
|
|
||||||
|
# Push to staging remote over SSH
|
||||||
|
GIT_SSH_COMMAND="ssh -i ~/.ssh/id_ed25519 -o StrictHostKeyChecking=yes" git push staging master --force
|
||||||
|
Loading…
Reference in New Issue
Block a user