Merge pull request #159 from tloncorp/hm/k-413

meta: 413k
This commit is contained in:
Hunter Miller 2023-04-27 14:57:52 -05:00 committed by GitHub
commit c6c97deafc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 63 additions and 29 deletions

View File

@ -7,7 +7,7 @@ repo=$1
desk=$2
ship=$3
zone=$4
ref=${5:-.}
ref=${5:-master}
folder=$ship/$desk
set -e
@ -16,11 +16,10 @@ cmdfile=$(mktemp "${TMPDIR:-/tmp/}janeway.XXXXXXXXX")
# mktemp only used for generating a random folder name below
cmds='
source_repo=$(mktemp --dry-run /tmp/repo.janeway.XXXXXXXXX)
git clone --depth 1 git@github.com:'$repo'.git $source_repo
git clone --depth 1 --branch '$ref' git@github.com:'$repo'.git $source_repo
urbit_repo=$(mktemp --dry-run /tmp/repo.urbit.XXXXXXXXX)
git clone --depth 1 git@github.com:urbit/urbit.git $urbit_repo -b '$URBIT_REPO_TAG' --single-branch
cd $source_repo
git checkout '$ref'
cd /home/urb || return
curl -s --data '\''{"source":{"dojo":"+hood/mount %'$desk'"},"sink":{"app":"hood"}}'\'' http://localhost:12321
rsync -avL --delete $urbit_repo/pkg/base-dev/ '$folder'

View File

@ -8,7 +8,7 @@
# $2: the location of the docket file
# globber is a prebooted and docked fakezod
curl https://bootstrap.urbit.org/globberv2.tgz | tar xzk
curl https://bootstrap.urbit.org/globberv3.tgz | tar xzk
./zod/.run -d
dojo () {

View File

@ -1,46 +1,83 @@
name: Deploy Landscape
on:
workflow_dispatch:
inputs:
tag:
type: string
required: false
default: master
description: Enter the tag to deploy
push:
branches:
- 'master'
jobs:
deploy:
build-frontend:
runs-on: ubuntu-latest
name: "Create a glob and deploy latest to ~wannec-dozzod-marzod (devstream)"
name: 'Build Frontend'
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.REPO_TOKEN }}
ref: ${{ github.event.inputs.tag }}
- uses: actions/setup-node@v3
with:
node-version: 16
node-version-file: ./ui/.nvmrc
- working-directory: ./ui
run: |
npm ci
npm run build
- uses: actions/upload-artifact@v3
with:
name: 'ui-dist'
path: ui/dist
glob:
runs-on: ubuntu-latest
name: 'Make a glob'
needs: build-frontend
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.REPO_TOKEN }}
ref: ${{ github.event.inputs.tag }}
- uses: actions/download-artifact@v3
with:
name: 'ui-dist'
path: ui/dist
- name: 'glob'
uses: ./.github/actions/glob
with:
folder: 'ui/dist/*'
docket: 'desk/desk.docket-0'
- name: Commit and Push Glob
run: |
git config --global user.name github-actions
git config --global user.email github-actions@github.com
git add desk/desk.docket-0
git commit -n -m "update glob: ${{ steps.glob.outputs.hash }} [skip actions]" || echo "No changes to commit"
INPUT=${{ github.event.inputs.tag }}
BRANCH=${INPUT:-"develop"}
git pull origin $BRANCH --rebase --autostash
git push
deploy:
runs-on: ubuntu-latest
needs: glob
name: "Deploy a glob to ~wannec-dozzod-marzod (devstream)"
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.REPO_TOKEN }}
ref: ${{ github.event.inputs.tag }}
- id: 'auth'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.JANEWAY_SERVICE_KEY }}'
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v1'
- name: Build Frontend
working-directory: ./ui
run: |
npm ci
npm run build
- id: glob
uses: ./.github/actions/glob
with:
folder: 'ui/dist/*'
docket: 'desk/desk.docket-0'
- name: Commit Glob
uses: EndBug/add-and-commit@v9
with:
add: '-A'
message: 'update glob: ${{ steps.glob.outputs.hash }} [skip actions]'
- id: deploy
name: Deploy
run:
./.github/helpers/deploy.sh tloncorp/landscape garden wannec-dozzod-marzod us-west1-b
./.github/helpers/deploy.sh tloncorp/landscape garden wannec-dozzod-marzod us-west1-b ${{ github.event.inputs.tag }}
env:
SSH_SEC_KEY: ${{ secrets.JANEWAY_SSH_SEC_KEY }}
SSH_PUB_KEY: ${{ secrets.JANEWAY_SSH_PUB_KEY }}
URBIT_REPO_TAG: ${{ vars.URBIT_REPO_TAG }}
URBIT_REPO_TAG: ${{ vars.URBIT_REPO_TAG }}

View File

@ -4,5 +4,5 @@
|= [our=ship =desk now=@da]
^- (list [=dude live=?])
%~ tap in
.^((set [=dude live=?]) ge+/(scot %p our)/[desk]/(scot %da now))
.^((set [=dude live=?]) ge+/(scot %p our)/[desk]/(scot %da now)/$)
--

View File

@ -27,6 +27,7 @@
%da s+(scot %da p.c)
%tas s+(scot %tas p.c)
%ud (numb p.c)
%uv s+(scot %uv p.c)
==
::
++ foreign-desk

View File

@ -1,4 +1 @@
[%zuse 417]
[%zuse 416]
[%zuse 415]
[%zuse 414]
[%zuse 413]