Merge pull request #66 from tloncorp/hm/debug-deploy

ops: debugging deploy
This commit is contained in:
Hunter Miller 2023-02-01 16:11:14 -06:00 committed by GitHub
commit c83edd10d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 83 additions and 24 deletions

View File

@ -6,32 +6,28 @@
repo=$1
desk=$2
ship=$3
zone=$4
ref=${5:-.}
ref=${4:-.}
folder=$ship/$desk
set -e
set -o pipefail
cmds=$(mktemp "${TMPDIR:-/tmp/}janeway.XXXXXXXXX")
echo '
cmdfile=$(mktemp "${TMPDIR:-/tmp/}janeway.XXXXXXXXX")
cmds='
source_repo=$(mktemp --dry-run /tmp/repo.janeway.XXXXXXXXX)
echo $source_repo;
git clone git@github.com:'$repo'.git $source_repo
urbit_repo=$(mktemp --dry-run /tmp/repo.urbit.XXXXXXXXX)
echo $urbit_repo;
git clone git@github.com:urbit/urbit.git $urbit_repo
cd $source_repo
git checkout '$ref'
cd /home/urb || return
curl -s --data '"'"'{"source":{"dojo":"+hood/mount %'$desk'"},"sink":{"app":"hood"}}'"'"' http://localhost:12321
curl -s --data '\''{\"source\":{\"dojo\":\"+hood/mount %'$desk'\"},\"sink\":{\"app\":\"hood\"}}'\'' http://localhost:12321
rsync -avL --delete $source_repo/desk/ '$folder'
rsync -avL $urbit_repo/pkg/base-dev/ '$folder'
curl -s --data '"'"'{"source":{"dojo":"+hood/commit %'$desk'"},"sink":{"app":"hood"}}'"'"' http://localhost:12321
curl -s --data '\''{\"source\":{\"dojo\":\"+hood/commit %'$desk'\"},\"sink\":{\"app\":\"hood\"}}'\'' http://localhost:12321
rm -rf $source_repo
rm -rf $urbit_repo
' >> "$cmds"
gcloud compute \
--project mainnet \
ssh \
--ssh-flag="-T" \
--zone $4 \
urb@$ship < "$cmds" &> /dev/null
echo "OTA performed for $desk on $ship"
'
echo "$cmds" >> "$cmdfile"
echo "cmdfile=$(echo $cmdfile)" >> $GITHUB_OUTPUT

View File

@ -18,6 +18,18 @@ jobs:
credentials_json: '${{ secrets.JANEWAY_SERVICE_KEY }}'
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v1'
- name: Deploy
- id: deploy-prep
name: Prep Deploy Script
run:
./.github/helpers/deploy.sh tloncorp/landscape landscape binnec-dozzod-marzod us-west1-b ${{ github.event.inputs.tag }}
./.github/helpers/deploy.sh tloncorp/landscape garden binnec-dozzod-marzod ${{ github.event.inputs.tag }}
- id: 'compute-ssh'
name: Deploy
uses: 'google-github-actions/ssh-compute@v0'
with:
project_id: mainnet
zone: 'us-west1-b'
user: 'urb'
instance_name: 'wannec-dozzod-marzod'
flags: '--verbosity=info'
ssh_private_key: '${{ secrets.TEST_KEY }}'
script: ${{ steps.deploy-prep.outputs.cmdfile }}

View File

@ -18,6 +18,18 @@ jobs:
credentials_json: '${{ secrets.JANEWAY_SERVICE_KEY }}'
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v1'
- name: Deploy
- id: deploy-prep
name: Prep Deploy Script
run:
./.github/helpers/deploy.sh tloncorp/landscape landscape doznec-dozzod-marzod us-west1-b ${{ github.event.inputs.tag }}
./.github/helpers/deploy.sh tloncorp/landscape garden doznec-dozzod-marzod ${{ github.event.inputs.tag }}
- id: 'compute-ssh'
name: Deploy
uses: 'google-github-actions/ssh-compute@v0'
with:
project_id: mainnet
zone: 'us-west1-b'
user: 'urb'
instance_name: 'wannec-dozzod-marzod'
flags: '--verbosity=info'
ssh_private_key: '${{ secrets.TEST_KEY }}'
script: ${{ steps.deploy-prep.outputs.cmdfile }}

View File

@ -18,6 +18,18 @@ jobs:
credentials_json: '${{ secrets.JANEWAY_SERVICE_KEY }}'
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v1'
- name: Deploy
- id: deploy-prep
name: Prep Deploy Script
run:
./.github/helpers/deploy.sh tloncorp/landscape landscape marnec-dozzod-marzod us-west1-b ${{ github.event.inputs.tag }}
./.github/helpers/deploy.sh tloncorp/landscape garden marnec-dozzod-marzod ${{ github.event.inputs.tag }}
- id: 'compute-ssh'
name: Deploy
uses: 'google-github-actions/ssh-compute@v0'
with:
project_id: mainnet
zone: 'us-west1-b'
user: 'urb'
instance_name: 'wannec-dozzod-marzod'
flags: '--verbosity=info'
ssh_private_key: '${{ secrets.TEST_KEY }}'
script: ${{ steps.deploy-prep.outputs.cmdfile }}

View File

@ -18,6 +18,18 @@ jobs:
credentials_json: '${{ secrets.JANEWAY_SERVICE_KEY }}'
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v1'
- name: Deploy
- id: deploy-prep
name: Prep Deploy Script
run:
./.github/helpers/deploy.sh tloncorp/landscape landscape mister-dister-dozzod-dozzod us-central1-a ${{ github.event.inputs.tag }}
./.github/helpers/deploy.sh tloncorp/landscape garden mister-dister-dozzod-dozzod ${{ github.event.inputs.tag }}
- id: 'compute-ssh'
name: Deploy
uses: 'google-github-actions/ssh-compute@v0'
with:
project_id: mainnet
zone: 'us-west1-b'
user: 'urb'
instance_name: 'wannec-dozzod-marzod'
flags: '--verbosity=info'
ssh_private_key: '${{ secrets.TEST_KEY }}'
script: ${{ steps.deploy-prep.outputs.cmdfile }}

View File

@ -1,6 +1,9 @@
name: Deploy Landscape
on:
workflow_dispatch:
pull_request:
branches:
- 'master'
push:
branches:
- 'master'
@ -36,6 +39,18 @@ jobs:
with:
add: '-A'
message: 'update glob: ${{ steps.glob.outputs.hash }} [skip actions]'
- id: deploy
- id: deploy-prep
name: Prep Deploy Script
run:
./.github/helpers/deploy.sh tloncorp/landscape landscape wannec-dozzod-marzod us-west1-b
./.github/helpers/prep-deploy.sh tloncorp/landscape garden wannec-dozzod-marzod
- id: 'compute-ssh'
name: Deploy
uses: 'google-github-actions/ssh-compute@v0'
with:
project_id: mainnet
zone: 'us-west1-b'
user: 'urb'
instance_name: 'wannec-dozzod-marzod'
flags: '--verbosity=info'
ssh_private_key: '${{ secrets.TEST_KEY }}'
script: ${{ steps.deploy-prep.outputs.cmdfile }}