Skip to content

Commit

Permalink
Merge pull request #2 from Termina/deploy
Browse files Browse the repository at this point in the history
trying deploy script
  • Loading branch information
NoEgAm authored Sep 21, 2023
2 parents 61fedd9 + 86c9327 commit 0239d2e
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 27 deletions.
19 changes: 18 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,21 @@ jobs:
- name: "test"
run: caps --ci

- run: cr --emit-ir -1
- run: cr --emit-js -1

- run: mkdir -p dist-server && cp -r {package.json,main.mjs,js-out,yarn.lock} dist-server/

- name: Upload server script
id: deploy-server
uses: Pendect/[email protected]
env:
DEPLOY_KEY: ${{secrets.rsync_private_key}}
with:
flags: '-avzr --progress'
options: ''
ssh_options: ''
src: 'dist-server/*'
dest: '[email protected]:/servers/cos-up/'

- name: Display status from deploy
run: echo "${{ steps.deploy-server.outputs.status }}"
62 changes: 38 additions & 24 deletions calcit.cirru

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions compact.cirru
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
cos-obj $ new COS
js-object (:SecretId app-id) (:SecretKey secret)
w-js-log $ .!getObjectUrl cos-obj
js-object (:Bucket bucket) (:Region "\"ap-hongkong")
js-object (:Bucket bucket) (:Region "\"ap-shanghai")
:Key $ str "\"cos-up/" (or file-key "\"demo0")
:Method "\"PUT"
:Sign true
Expand All @@ -45,6 +45,7 @@
defn main! ()
println "\"COS get" $ .-getAuthorization COS
skir/create-server! on-request! $ {}
:port $ js/parseInt (get-env "\"PORT" "\"4000")
|on-request! $ %{} :CodeEntry (:doc |)
:code $ quote
defn on-request! (req-data res)
Expand All @@ -68,7 +69,7 @@
= (:user body) (:user secrets)
= (:pass body) (:pass-md5 secrets)
handle-token (:bucket secrets) (:app-id secrets) (:secret secrets) (:file-key body) cb
{} (:code 403) (:message "\"Not user")
cb $ {} (:code 403) (:message "\"Not user")
:headers $ {}
:body $ {} (:message "\"not open for all users...")
if
Expand Down

0 comments on commit 0239d2e

Please sign in to comment.