diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..810d4ea --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,26 @@ +--- +name: Bug report +about: Is something broken? +title: '' +labels: bug +assignees: '' + +--- + +**Describe the bug, optionally with screenshots** +A clear and concise description of what the bug is. If applicable, add screenshots to help explain your problem. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Additional context:** +- Ship type (comet/moon/planet/star/galaxy) +- Instance type (Tlon-hosted/self-hosted with Port/CLI) +- OS/browser (Safari on MacOS, Chrome on Windows, Firefox on Linux, etc.) diff --git a/.github/actions/deploy/Dockerfile b/.github/actions/deploy/Dockerfile new file mode 100644 index 0000000..95520b5 --- /dev/null +++ b/.github/actions/deploy/Dockerfile @@ -0,0 +1,4 @@ +FROM tloncorp/janeway:v0.16.8-dev +COPY entrypoint.sh /entrypoint.sh +EXPOSE 22/tcp +ENTRYPOINT ["/entrypoint.sh"] \ No newline at end of file diff --git a/.github/actions/deploy/action.yml b/.github/actions/deploy/action.yml new file mode 100644 index 0000000..0ec4be5 --- /dev/null +++ b/.github/actions/deploy/action.yml @@ -0,0 +1,32 @@ +name: 'deploy' +description: 'Create a glob and deploy it to a moon' +inputs: + app: + description: "App to deploy" + required: true + ship: + description: "Ship to deploy to" + required: true + credentials: + description: "base64-encoded GCP Service Account credentials" + required: true + ssh-sec-key: + description: "A base64-encoded SSH secret key for the container to use" + required: true + ssh-pub-key: + description: "The corresponding base64-encoded SSH public key" + required: true + ref: + description: "The github reference to checkout when deploying" + required: false + +runs: + using: 'docker' + image: 'Dockerfile' + args: + - ${{ inputs.app }} + - ${{ inputs.ship }} + - ${{ inputs.credentials }} + - ${{ inputs.ssh-sec-key }} + - ${{ inputs.ssh-pub-key }} + - ${{ inputs.ref }} diff --git a/.github/actions/deploy/entrypoint.sh b/.github/actions/deploy/entrypoint.sh new file mode 100755 index 0000000..1779a06 --- /dev/null +++ b/.github/actions/deploy/entrypoint.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +echo "$3" | base64 -d > /service-account +echo "$4" | base64 -d > /id_ssh +echo "$5" | base64 -d > /id_ssh.pub + +chmod 600 /service-account +chmod 600 /id_ssh +chmod 600 /id_ssh.pub + +janeway \ + --ci \ + --credentials /service-account \ + --ssh-key /id_ssh \ + release glob \ + "$1" \ + | bash + +janeway \ + --ci \ + --verbose \ + --credentials /service-account \ + --ssh-key /id_ssh \ + release ota \ + "$1" "$2" \ + ${6:+"--ref"} ${6:+"$6"} \ + | bash diff --git a/.github/actions/release/Dockerfile b/.github/actions/release/Dockerfile new file mode 100644 index 0000000..95520b5 --- /dev/null +++ b/.github/actions/release/Dockerfile @@ -0,0 +1,4 @@ +FROM tloncorp/janeway:v0.16.8-dev +COPY entrypoint.sh /entrypoint.sh +EXPOSE 22/tcp +ENTRYPOINT ["/entrypoint.sh"] \ No newline at end of file diff --git a/.github/actions/release/action.yml b/.github/actions/release/action.yml new file mode 100644 index 0000000..8a63dba --- /dev/null +++ b/.github/actions/release/action.yml @@ -0,0 +1,32 @@ +name: 'release' +description: 'Release to a moon' +inputs: + app: + description: "App to deploy" + required: true + ship: + description: "Ship to deploy to" + required: true + credentials: + description: "base64-encoded GCP Service Account credentials" + required: true + ssh-sec-key: + description: "A base64-encoded SSH secret key for the container to use" + required: true + ssh-pub-key: + description: "The corresponding base64-encoded SSH public key" + required: true + ref: + description: "The github reference to checkout when deploying" + required: false + +runs: + using: 'docker' + image: 'Dockerfile' + args: + - ${{ inputs.app }} + - ${{ inputs.ship }} + - ${{ inputs.credentials }} + - ${{ inputs.ssh-sec-key }} + - ${{ inputs.ssh-pub-key }} + - ${{ inputs.ref }} diff --git a/.github/actions/release/entrypoint.sh b/.github/actions/release/entrypoint.sh new file mode 100755 index 0000000..1a13c42 --- /dev/null +++ b/.github/actions/release/entrypoint.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +echo "$3" | base64 -d > /service-account +echo "$4" | base64 -d > /id_ssh +echo "$5" | base64 -d > /id_ssh.pub + +chmod 600 /service-account +chmod 600 /id_ssh +chmod 600 /id_ssh.pub + +janeway \ + --ci \ + --verbose \ + --credentials /service-account \ + --ssh-key /id_ssh \ + release ota \ + "$1" "$2" \ + ${6:+"--ref"} ${6:+"$6"} \ + | bash diff --git a/.github/workflows/bump.yml b/.github/workflows/bump.yml new file mode 100644 index 0000000..c1619dc --- /dev/null +++ b/.github/workflows/bump.yml @@ -0,0 +1,23 @@ +name: Version Bump +on: + workflow_dispatch: + inputs: + tag: + type: string + required: true + description: Enter the version +jobs: + deploy: + runs-on: ubuntu-latest + name: "Bumps versions and pushes to master" + steps: + - uses: actions/checkout@v3 + with: + token: ${{ secrets.REPO_TOKEN }} + - name: Bump + run: | + sed -i "s/version\+\[.*]/version+[${{ github.event.inputs.tag }}]/" desk/desk.docket-0 + - name: Commit + uses: EndBug/add-and-commit@v9 + with: + add: '-A' \ No newline at end of file diff --git a/.github/workflows/deploy-canary.yml b/.github/workflows/deploy-canary.yml new file mode 100644 index 0000000..8de88a5 --- /dev/null +++ b/.github/workflows/deploy-canary.yml @@ -0,0 +1,22 @@ +name: Deploy Landscape (canary) +on: + workflow_dispatch: + inputs: + tag: + type: string + required: false + description: Enter the tag to deploy +jobs: + deploy: + runs-on: ubuntu-latest + name: "Release to ~binnec-dozzod-marzod (canary)" + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/release + with: + app: 'landscape' + ship: 'canary' + credentials: ${{ secrets.JANEWAY_SERVICE_KEY }} + ssh-sec-key: ${{ secrets.JANEWAY_SSH_SEC_KEY }} + ssh-pub-key: ${{ secrets.JANEWAY_SSH_PUB_KEY }} + ref: ${{ github.event.inputs.tag }} \ No newline at end of file diff --git a/.github/workflows/deploy-external.yml b/.github/workflows/deploy-external.yml new file mode 100644 index 0000000..01b2e56 --- /dev/null +++ b/.github/workflows/deploy-external.yml @@ -0,0 +1,22 @@ +name: Deploy Landscape (external) +on: + workflow_dispatch: + inputs: + tag: + type: string + required: true + description: Enter the tag to deploy +jobs: + deploy: + runs-on: ubuntu-latest + name: "Release to ~doznec-dozzod-marzod (external)" + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/release + with: + app: 'landscape' + ship: 'external' + credentials: ${{ secrets.JANEWAY_SERVICE_KEY }} + ssh-sec-key: ${{ secrets.JANEWAY_SSH_SEC_KEY }} + ssh-pub-key: ${{ secrets.JANEWAY_SSH_PUB_KEY }} + ref: ${{ github.event.inputs.tag }} \ No newline at end of file diff --git a/.github/workflows/deploy-internal.yml b/.github/workflows/deploy-internal.yml new file mode 100644 index 0000000..c07c400 --- /dev/null +++ b/.github/workflows/deploy-internal.yml @@ -0,0 +1,22 @@ +name: Deploy Landscape (internal) +on: + workflow_dispatch: + inputs: + tag: + type: string + required: true + description: Enter the tag to deploy +jobs: + deploy: + runs-on: ubuntu-latest + name: "Release to ~marnec-dozzod-marzod (internal)" + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/release + with: + app: 'landscape' + ship: 'internal' + credentials: ${{ secrets.JANEWAY_SERVICE_KEY }} + ssh-sec-key: ${{ secrets.JANEWAY_SSH_SEC_KEY }} + ssh-pub-key: ${{ secrets.JANEWAY_SSH_PUB_KEY }} + ref: ${{ github.event.inputs.tag }} \ No newline at end of file diff --git a/.github/workflows/deploy-live.yml b/.github/workflows/deploy-live.yml new file mode 100644 index 0000000..bb3692d --- /dev/null +++ b/.github/workflows/deploy-live.yml @@ -0,0 +1,22 @@ +name: Deploy Landscape (livenet) +on: + workflow_dispatch: + inputs: + tag: + type: string + required: true + description: Enter the tag to deploy +jobs: + deploy: + runs-on: ubuntu-latest + name: "Release to ~mister-dister-dozzod-dozzod (livenet)" + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/release + with: + app: 'landscape' + ship: 'mister' + credentials: ${{ secrets.JANEWAY_SERVICE_KEY }} + ssh-sec-key: ${{ secrets.JANEWAY_SSH_SEC_KEY }} + ssh-pub-key: ${{ secrets.JANEWAY_SSH_PUB_KEY }} + ref: ${{ github.event.inputs.tag }} \ No newline at end of file diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..90c24da --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,19 @@ +name: Deploy Landscape +on: + workflow_dispatch: + push: + branches: + - 'master' +jobs: + deploy: + runs-on: ubuntu-latest + name: "Create and deploy a glob to ~wannec-dozzod-marzod (devstream)" + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/deploy + with: + app: 'landscape' + ship: 'devstream' + credentials: ${{ secrets.JANEWAY_SERVICE_KEY }} + ssh-sec-key: ${{ secrets.JANEWAY_SSH_SEC_KEY }} + ssh-pub-key: ${{ secrets.JANEWAY_SSH_PUB_KEY }} \ No newline at end of file