Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

April 2021 Hubs Cloud Update #479

Merged
merged 208 commits into from
Mar 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
208 commits
Select commit Hold shift + click to select a range
3ec288e
Fix cert path resolution on non-WSL Windows
robertlong Jan 7, 2020
0379d32
Update README.md
lalalune May 6, 2020
98ed136
GraphQL API WIP
robertlong Jul 16, 2020
55b1260
Fix formatting and remove inspect
robertlong Jul 16, 2020
bd512d5
Use a changeset error handling middleware
robertlong Jul 16, 2020
3da617c
Add pagination to public rooms query
robertlong Jul 16, 2020
d396147
Add myRooms and authenticated routes
robertlong Jul 16, 2020
8ea148a
Add favorite rooms query
robertlong Jul 16, 2020
c28f8fb
Add more room and scene fields
robertlong Jul 16, 2020
6e718e1
Use dataloader for batch fetching scenes
robertlong Jul 16, 2020
b269d9b
Fix typo in comment
johnshaughnessy Jul 30, 2020
ada6276
specify preferred json codec
johnshaughnessy Jul 30, 2020
bdc1f8d
Add test cases for room query
johnshaughnessy Jul 30, 2020
125769c
DRY up tests
johnshaughnessy Jul 30, 2020
6883a09
Remove unused "variables" from tests
johnshaughnessy Jul 30, 2020
1a5853f
DRY : add assign_creator function
johnshaughnessy Jul 30, 2020
b585a8c
Rename put_auth_header_for_email
johnshaughnessy Jul 30, 2020
002f1e9
DRY: put_auth_header_for_account
johnshaughnessy Jul 30, 2020
66d8c4a
DRY: graphql query
johnshaughnessy Jul 30, 2020
b7c55e5
Don't need to hit the iql api
johnshaughnessy Jul 30, 2020
96d27c8
Test room creation. Add default creator assignment
johnshaughnessy Jul 30, 2020
6b4c0b6
Specify json_codec
johnshaughnessy Jul 30, 2020
fec3753
Add room name to mutation result
johnshaughnessy Jul 30, 2020
012d040
Test pagination
johnshaughnessy Jul 30, 2020
0e3f85e
Fix warnings
johnshaughnessy Jul 30, 2020
8f2611c
Formatting
johnshaughnessy Jul 30, 2020
1eb8003
Add StatsD counters for media resolution results
johnshaughnessy Aug 8, 2020
e60ddff
Add mutation for updating room name
johnshaughnessy Aug 17, 2020
2f4c8bb
Add capabilities to room resolver
johnshaughnessy Aug 24, 2020
ee0a66c
Refactor for readability
johnshaughnessy Aug 24, 2020
4afe9d6
Broadcast changes to anyone connected to the hub channel
johnshaughnessy Aug 24, 2020
5a81895
Add ability to update member_permissions
johnshaughnessy Aug 24, 2020
81726e7
Remove unused vars
johnshaughnessy Aug 24, 2020
15d6475
Add some documentation for the API
johnshaughnessy Aug 25, 2020
c5e89eb
Fixup doc
johnshaughnessy Aug 25, 2020
5dc75b3
Add ability to modify allow_promotion
johnshaughnessy Aug 25, 2020
57a052f
Add descriptions to graphql objects/fields
johnshaughnessy Aug 26, 2020
20328ed
Add descriptions to scene types
johnshaughnessy Aug 26, 2020
67dd3c0
Match on Repo.update errors
johnshaughnessy Aug 27, 2020
342c165
Make specifying a room name optional. Add other fields
johnshaughnessy Aug 27, 2020
af98550
Add statix measurement of rate_limited responses
johnshaughnessy Aug 27, 2020
1b06615
Authorization is enforced on a per-resolver basis
johnshaughnessy Aug 28, 2020
568548f
Fix failing test case for allow_promotion
johnshaughnessy Sep 9, 2020
f8f8477
Add helper script for setting Authorization header
johnshaughnessy Sep 9, 2020
dcc8672
Remove duplicate field
johnshaughnessy Sep 9, 2020
634f0f4
Setup guardian_db and ApiTokens
johnshaughnessy Sep 18, 2020
6de2ca2
Show that revoked token cannot be verified in test
johnshaughnessy Sep 18, 2020
8c0e869
Confer permissions onto api tokens
johnshaughnessy Sep 18, 2020
c8ac232
Remove hub_refresh_by_api
johnshaughnessy Sep 28, 2020
3841cbb
Add primitive timing info as middleware
johnshaughnessy Sep 29, 2020
01a6331
Build up middleware incrementally
johnshaughnessy Sep 29, 2020
5a47417
Merge remote-tracking branch 'origin/feature/api-tokens' into feature…
johnshaughnessy Sep 29, 2020
18b4b62
Verify the permissions on graphql api usage
johnshaughnessy Sep 30, 2020
02c76c3
Start handling auth_errors in the plug
johnshaughnessy Sep 30, 2020
028c3ae
Update guardian so we can avoid halt on error
johnshaughnessy Sep 30, 2020
693204d
Add guardian_phoenix after guardian upgrade
johnshaughnessy Sep 30, 2020
1d9fedd
Fix tests. Check for token in middleware.
johnshaughnessy Oct 1, 2020
5f03033
Tighten up error handling / reporting
johnshaughnessy Oct 1, 2020
5aa730c
Add TODO's from talking with Dom
johnshaughnessy Oct 2, 2020
61e097d
Rename return_error -> put_error_result
johnshaughnessy Oct 9, 2020
81c84e8
Rename Context -> AddAbsintheContext
johnshaughnessy Oct 9, 2020
5c6b08c
Rename context.ex -> add_absinthe_context.ex
johnshaughnessy Oct 9, 2020
d9caf59
Remove unused middleware. Rename PutErrorResult
johnshaughnessy Oct 9, 2020
85301be
Add mix task for generating api tokens
johnshaughnessy Oct 10, 2020
edb17af
Remove unused middleware
johnshaughnessy Oct 10, 2020
b7eabe2
Implement scopes and app_tokens
johnshaughnessy Oct 13, 2020
6db7fcf
Modify helper mix task for generating tokens
johnshaughnessy Oct 13, 2020
f365bca
Remove insert auth header helper
johnshaughnessy Oct 13, 2020
e699e8b
Minor changes
johnshaughnessy Oct 16, 2020
f96f226
Remove unnecessary middleware
johnshaughnessy Oct 16, 2020
69902c7
Rename Ret.ApiToken -> Ret.Api.Token
johnshaughnessy Oct 16, 2020
f652f0c
Update room access pattern for user and app tokens
johnshaughnessy Oct 19, 2020
9a5c089
Fix tests and warnings
johnshaughnessy Oct 19, 2020
dc45130
Generate random room names
johnshaughnessy Oct 20, 2020
5084f61
Reimplement create and update room with auth
johnshaughnessy Oct 20, 2020
05d8008
Add some notes for graphiql testing
johnshaughnessy Oct 20, 2020
a279ce5
Remove unused middleware
johnshaughnessy Oct 20, 2020
b9a7175
Remove commented code
johnshaughnessy Oct 20, 2020
82108fd
Remove unused permissions
johnshaughnessy Oct 20, 2020
a386b8f
Remove IO.inspect
johnshaughnessy Oct 20, 2020
b876e86
Fix warnings
johnshaughnessy Oct 21, 2020
1de05d7
Implement can? for :reticulum_app_token
johnshaughnessy Oct 21, 2020
e2eec9b
Put generated token onto clipboard
johnshaughnessy Oct 21, 2020
6f5a4e6
Check permissions for getting public rooms
johnshaughnessy Oct 21, 2020
f121458
Remove unused function
johnshaughnessy Oct 21, 2020
2eb4934
Remove unused function
johnshaughnessy Oct 21, 2020
497d97c
Remove outdated tests
johnshaughnessy Oct 21, 2020
550863c
Add comments
johnshaughnessy Oct 22, 2020
7f1c1cb
Lengthen ttl
johnshaughnessy Oct 22, 2020
9f23b27
Create API token module. Replace jwt's in API
johnshaughnessy Oct 28, 2020
dfaf3f8
Remove guardian db
johnshaughnessy Oct 28, 2020
884893b
Remove unused secrets
johnshaughnessy Oct 28, 2020
3040fb4
Remove unused function
johnshaughnessy Oct 28, 2020
8dc209c
Removed unused alias/import
johnshaughnessy Oct 28, 2020
c88e0a0
(Re)Implement revoke for tokens
johnshaughnessy Oct 28, 2020
272003d
Fix introspection queries and invalid token errors
johnshaughnessy Oct 28, 2020
c5096c7
Check for introspection types how Absinthe does
johnshaughnessy Oct 28, 2020
75a2087
Fix warnings
johnshaughnessy Oct 28, 2020
6c22990
Remove TODO
johnshaughnessy Oct 28, 2020
d3bf787
Fix tests
johnshaughnessy Oct 28, 2020
300bf33
Add sample graphiql workspace
johnshaughnessy Oct 28, 2020
a32f840
Format
johnshaughnessy Oct 28, 2020
6f810a4
Update API Guide
johnshaughnessy Oct 28, 2020
8a2e6f4
Remove graphiql notes
johnshaughnessy Oct 28, 2020
737b716
Update scopes table in guide
johnshaughnessy Oct 28, 2020
04ee343
Update formatting in guide
johnshaughnessy Oct 28, 2020
8d0d6df
Update justification in guide table
johnshaughnessy Oct 28, 2020
560da97
Remove unused error message
johnshaughnessy Oct 29, 2020
275cfde
Move dataloader config
johnshaughnessy Oct 29, 2020
617a3bf
Change title of guide
johnshaughnessy Oct 29, 2020
59153bf
Do not assume xclip exists
johnshaughnessy Nov 13, 2020
0df81f4
Check write_rooms scope to allow update_hub
johnshaughnessy Nov 13, 2020
c856764
Remove things from documentation that are not done
johnshaughnessy Nov 13, 2020
aa718ae
Check hub_bindings before allowed embeds
johnshaughnessy Nov 13, 2020
f8919ab
Remove API credentials expiration
johnshaughnessy Nov 17, 2020
a088b2f
Include rooms whose entry mode is invite
johnshaughnessy Nov 17, 2020
8ef4ba1
Return more specific token error: :token_revoked
johnshaughnessy Nov 17, 2020
6d19640
Return scene or scene_listing in room result
johnshaughnessy Nov 17, 2020
e7aa161
Add json scalar type for user_data
johnshaughnessy Nov 17, 2020
6d1999b
Add missing close parenthesis
johnshaughnessy Nov 17, 2020
465f637
Add indexes and prevent null in credentials table schema
johnshaughnessy Nov 17, 2020
6afdb17
Fix query for favorite rooms
johnshaughnessy Nov 17, 2020
0c9638f
Define internal functions with defp
johnshaughnessy Nov 17, 2020
9009d96
Fix call to internal function
johnshaughnessy Nov 17, 2020
4923a66
Remove max_page_size
johnshaughnessy Nov 17, 2020
016d737
Fix credential changeset validation/constraints
johnshaughnessy Nov 17, 2020
832898b
Do not have all tokens end in "09"
johnshaughnessy Nov 17, 2020
50f7df6
Prefix the sid to the rest of the token
johnshaughnessy Nov 17, 2020
ec55da4
Update comment for Can impl for Atom
johnshaughnessy Nov 17, 2020
0eabfb3
Add create_room function for api
johnshaughnessy Nov 18, 2020
4d1d9c8
Fixup scene changes and member permissions
johnshaughnessy Nov 19, 2020
ec9cd68
Fix member perm parsing: return ArgumentError
johnshaughnessy Nov 19, 2020
7059fdd
Remove unused test queries
johnshaughnessy Nov 19, 2020
461de60
Update workspace
johnshaughnessy Dec 7, 2020
4bdde03
PR feedback
johnshaughnessy Dec 14, 2020
70bb8a5
Remove issued_at field
johnshaughnessy Dec 14, 2020
a02026d
Add (regular) API to manage (graphql) credentials
johnshaughnessy Dec 9, 2020
2b633c1
Expand admin account permissions
johnshaughnessy Dec 10, 2020
e448b99
Remove create_accounts scope
johnshaughnessy Dec 14, 2020
80c275d
Create test helper
johnshaughnessy Dec 14, 2020
3b49320
PR Feedback
johnshaughnessy Dec 14, 2020
ca9ab00
Require a server-level flag for graphql api
johnshaughnessy Dec 14, 2020
d3adae7
lint
johnshaughnessy Dec 14, 2020
2de8003
Merge pull request #436 from mozilla/feature/credentials-api
johnshaughnessy Dec 14, 2020
b80f8c9
Merge pull request #399 from mozilla/feature/graphql-2
johnshaughnessy Dec 14, 2020
c7cb427
Enable promotion to staging channel
brianpeiris Dec 16, 2020
7cadfc2
Remove allow_promotion from create_room mutation
johnshaughnessy Dec 18, 2020
5bb3ef0
Update api guide
johnshaughnessy Dec 22, 2020
ae9e142
Upload and parse newest hart file instead of oldest. There's only eve…
brianpeiris Dec 22, 2020
a5df51e
Add more detail to slack message
brianpeiris Dec 22, 2020
699fc3e
Fix indentation
brianpeiris Dec 22, 2020
6addf99
Prevent accidental promotions from the example graphiql workspace
johnshaughnessy Dec 22, 2020
47cf047
Make sure allowPromotion is false in examples
johnshaughnessy Dec 22, 2020
276bd6b
Remove allow_promotion from the graphql API
johnshaughnessy Dec 22, 2020
01ca5ca
Add updated graphiql workspace
johnshaughnessy Dec 22, 2020
7d338fb
Remove new graphiql workspace
johnshaughnessy Dec 22, 2020
989c9ea
Merge pull request #440 from mozilla/bug/graphql_api_enforce_promotio…
johnshaughnessy Dec 23, 2020
46824f4
Merge pull request #441 from mozilla/feature/credentials-api-docs
johnshaughnessy Dec 23, 2020
fb61b11
Merge pull request #405 from mozilla/feature/statix-media-resolution
johnshaughnessy Dec 23, 2020
afbadfe
Merge pull request #407 from mozilla/feature/measure_rate_limiting
johnshaughnessy Dec 23, 2020
5ba379b
Merge branch 'master' of github.com:mozilla/reticulum into bp-test-stage
brianpeiris Jan 5, 2021
89e7b31
Fix variable scope
brianpeiris Jan 5, 2021
1e6f972
Merge pull request #439 from mozilla/bp-test-stage
brianpeiris Jan 5, 2021
fd1518c
Add null check
brianpeiris Jan 5, 2021
bae4acb
update hackney dependency in lockfile
robinkwilson Jan 8, 2021
a2526b0
Merge pull request #451 from mozilla/hackney-update
robinkwilson Jan 8, 2021
8debfcd
qa build workflow
brianpeiris Jan 11, 2021
75aebdd
Fix condition
brianpeiris Jan 11, 2021
fce2446
Merge branch 'master' of github.com:mozilla/reticulum into bp-qa-test
brianpeiris Jan 11, 2021
3eef119
trigger build
brianpeiris Jan 11, 2021
ba92036
Change slack command
brianpeiris Jan 11, 2021
e444fb6
parameterize qa builds channel
brianpeiris Jan 11, 2021
8181a0e
Refactor resolve_and_render
johnshaughnessy Jan 11, 2021
37aa259
Fallback to screenshots / opengraph
johnshaughnessy Jan 11, 2021
33ae75a
Fix env var
brianpeiris Jan 11, 2021
a5723da
Fix compilation warning: default arguments are never used
johnshaughnessy Jan 12, 2021
ffab45c
Match :error tuples more carefully
johnshaughnessy Jan 12, 2021
569c8ea
lint
johnshaughnessy Jan 12, 2021
96379dc
lint...
johnshaughnessy Jan 12, 2021
4e769e9
Cache the errors as :error atoms
johnshaughnessy Jan 12, 2021
38870cd
My local linter is not showing me errors... :(
johnshaughnessy Jan 12, 2021
823511f
Remove an unnecessary branch
johnshaughnessy Jan 12, 2021
992f830
revert readme
brianpeiris Jan 12, 2021
f94d9e8
Send fake user-agent to fix range queries
johnshaughnessy Jan 13, 2021
0c0d9aa
Use user agent from windows firefox
johnshaughnessy Jan 15, 2021
95a17a7
lint
johnshaughnessy Jan 15, 2021
4630a3d
Merge pull request #452 from mozilla/feature/media-resolve-fallback-t…
johnshaughnessy Jan 15, 2021
7fa96b3
Update absinthe to 1.5
johnshaughnessy Jan 20, 2021
16008d6
Revert "Update absinthe to 1.5"
johnshaughnessy Jan 20, 2021
42775ac
test push
brianpeiris Jan 20, 2021
37a3e68
Add support for creating scenes directly from GLB
netpro2k Jan 26, 2021
da52617
Add /scenes/projectless vs using dummy projects
netpro2k Jan 29, 2021
38b29c2
Add comment for local dev configs
brianpeiris Feb 5, 2021
325dd16
tweak wording. add more comments
brianpeiris Feb 5, 2021
b38b85e
Merge pull request #464 from mozilla/other/comment-dev-configs
brianpeiris Feb 5, 2021
b1be9b2
PR Feedback
netpro2k Feb 20, 2021
1e9f258
delint
netpro2k Feb 20, 2021
75534ab
Merge branch 'master' into patch-1
robertlong Feb 22, 2021
fb3b5ab
Merge pull request #375 from shawticus/patch-1
robertlong Feb 22, 2021
38aebf0
Remove nodejs
robertlong Feb 22, 2021
dac5245
Merge pull request #298 from mozilla/fix/windows-cert-path
robertlong Feb 22, 2021
3b7f377
Merge pull request #453 from mozilla/bp-qa-test
brianpeiris Feb 23, 2021
deb1818
Merge pull request #474 from mozilla/remove-nodejs
robertlong Feb 23, 2021
6e459fa
Merge pull request #462 from mozilla/glb-upload-scenes
netpro2k Mar 1, 2021
8ff8376
Exclude scenes with project files from projectless
netpro2k Mar 2, 2021
5f21610
Merge pull request #478 from mozilla/glb-upload-scenes
netpro2k Mar 2, 2021
ce5dcb8
Increase CachedFile timeout
johnshaughnessy Mar 8, 2021
8392440
Merge pull request #480 from mozilla/feature/two-day-timeout
johnshaughnessy Mar 8, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM elixir:1.5
RUN apt-get update -qq && apt-get install -y inotify-tools nodejs nodejs-legacy
RUN apt-get update -qq && apt-get install -y inotify-tools
RUN curl -so- -L https://yarnpkg.com/install.sh | bash
RUN mkdir /ret
WORKDIR /ret
Expand Down
107 changes: 68 additions & 39 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
import groovy.json.JsonOutput

// From https://issues.jenkins-ci.org/browse/JENKINS-44231

// Given arbitrary string returns a strongly escaped shell string literal.
// I.e. it will be in single quotes which turns off interpolation of $(...), etc.
// E.g.: 1'2\3\'4 5"6 (groovy string) -> '1'\''2\3\'\''4 5"6' (groovy string which can be safely pasted into shell command).
def shellString(s) {
// Replace ' with '\'' (https://unix.stackexchange.com/a/187654/260156). Then enclose with '...'.
// 1) Why not replace \ with \\? Because '...' does not treat backslashes in a special way.
// 2) And why not use ANSI-C quoting? I.e. we could replace ' with \'
// and enclose using $'...' (https://stackoverflow.com/a/8254156/4839573).
// Because ANSI-C quoting is not yet supported by Dash (default shell in Ubuntu & Debian) (https://unix.stackexchange.com/a/371873).
'\'' + s.replace('\'', '\'\\\'\'') + '\''
}

pipeline {
agent any

Expand All @@ -34,46 +20,65 @@ pipeline {
/usr/bin/script --return -c \\\\"sudo /usr/bin/hab-docker-studio -k mozillareality run /bin/bash scripts/build.sh\\\\" /dev/null
'''

sh 'sudo /usr/bin/hab-pkg-upload $(ls -rt results/*.hart | head -n 1)'
sh 'sudo /usr/bin/hab-pkg-upload $(ls -t results/*.hart | head -n 1)'

script {
// Grab IDENT file and cat it from .hart
def s = $/eval 'ls -rt results/*.hart | head -n 1'/$
def hart = sh(returnStdout: true, script: "${s}").trim()
s = $/eval 'tail -n +6 ${hart} | xzcat | tar tf - | grep IDENT'/$
def identPath = sh(returnStdout: true, script: "${s}").trim()
s = $/eval 'tail -n +6 ${hart} | xzcat | tar xf - "${identPath}" -O'/$
def packageIdent = sh(returnStdout: true, script: "${s}").trim()
def poolHost = env.RET_DARK_POOL_HOST
def slackURL = env.SLACK_URL
def buildNumber = env.BUILD_NUMBER
def jobName = env.JOB_NAME
def disablePromoteToStable = env.DISABLE_PROMOTE_TO_STABLE
def showQAPromoteCommand = env.SHOW_QA_PROMOTE_COMMAND
def qaBuildsSlackChannel = env.QA_BUILDS_SLACK_CHANNEL

// Grab IDENT file and cat it from .hart
def s = $/eval 'ls -t results/*.hart | head -n 1'/$
def hart = sh(returnStdout: true, script: "${s}").trim()

s = $/eval 'tail -n +6 ${hart} | xzcat | tar tf - | grep IDENT'/$
def identPath = sh(returnStdout: true, script: "${s}").trim()

s = $/eval 'tail -n +6 ${hart} | xzcat | tar xf - "${identPath}" -O'/$
def packageIdent = sh(returnStdout: true, script: "${s}").trim()

def gitMessage = sh(returnStdout: true, script: "git log -n 1 --pretty=format:'[%an] %s'").trim()
def gitSha = sh(returnStdout: true, script: "git log -n 1 --pretty=format:'%h'").trim()

if (disablePromoteToStable == null || disablePromoteToStable == "") {
def retPool = sh(returnStdout: true, script: "curl https://${poolHost}/api/v1/meta | jq -r '.pool'").trim()
sh "sudo /usr/bin/hab-pkg-promote '${packageIdent}' '${retPool}'"
sh "sudo /usr/bin/hab-pkg-promote '${packageIdent}' 'stable'"

def packageTimeVersion = packageIdent.tokenize('/')[3]
def (major, minor, version) = packageIdent.tokenize('/')[2].tokenize('.')
def retVersion = "${major}.${minor}.${packageTimeVersion}"
def poolHost = env.RET_DARK_POOL_HOST
def retPool = sh(returnStdout: true, script: "curl https://${poolHost}/api/v1/meta | jq -r '.pool'").trim()

def retPoolIcon = retPool == 'earth' ? ':earth_americas:' : ':new_moon:'

def gitMessage = sh(returnStdout: true, script: "git log -n 1 --pretty=format:'[%an] %s'").trim()
def gitSha = sh(returnStdout: true, script: "git log -n 1 --pretty=format:'%h'").trim()
def slackURL = env.SLACK_URL
def text = (
"*<http://localhost:8080/job/${env.JOB_NAME}/${env.BUILD_NUMBER}|#${env.BUILD_NUMBER}>* *${env.JOB_NAME}* " +
"*<http://localhost:8080/job/${jobName}/${buildNumber}|#${buildNumber}>* *${jobName}* " +
"<https://bldr.habitat.sh/#/pkgs/${packageIdent}|${packageIdent}>\n" +
"<https://github.com/mozilla/reticulum/commit/$gitSha|$gitSha> " +
"Reticulum -> ${retPoolIcon} `${retPool}`: ```${gitSha} ${gitMessage}```\n" +
"<https://smoke-hubs.mozilla.com/0zuesf6c6mf/smoke-test?required_ret_version=${retVersion}&required_ret_pool=${retPool}|Smoke Test> - to push:\n" +
"`/mr ret deploy ${retVersion} ${retPool}`"
)
def payload = 'payload=' + JsonOutput.toJson([
text : text,
channel : "#mr-builds",
username : "buildbot",
icon_emoji: ":gift:"
])
sh "sudo /usr/bin/hab-pkg-promote '${packageIdent}' '${retPool}'"
sh "sudo /usr/bin/hab-pkg-promote '${packageIdent}' 'stable'"
sh "curl -X POST --data-urlencode ${shellString(payload)} ${slackURL}"
sendSlackMessage(text, "#mr-builds", ":gift:", slackURL);
}

// Upload to ret depot after publishing to slack to minimize wait
sh 'sudo /usr/bin/hab-ret-pkg-upload $(ls -rt results/*.hart | head -n 1)'
// Upload to ret depot after publishing to slack to minimize wait
sh 'sudo /usr/bin/hab-ret-pkg-upload $(ls -t results/*.hart | head -n 1)'

if (showQAPromoteCommand == "true") {
def text = (
"*<http://localhost:8080/job/${jobName}/${buildNumber}|#${buildNumber}>* *${jobName}* " +
"<https://bldr.reticulum.io/#/pkgs/${packageIdent}|${packageIdent}>\n" +
"<https://github.com/mozilla/reticulum/commit/$gitSha|$gitSha> " +
"${packageIdent} built and uploaded - to promote:\n" +
"`/mr promote-ret-qa ${packageIdent}`"
)
sendSlackMessage(text, qaBuildsSlackChannel, ":gift:", slackURL);
}
}
}
}
Expand All @@ -85,3 +90,27 @@ pipeline {
}
}
}

def sendSlackMessage(text, channel, icon, slackURL) {
def payload = 'payload=' + JsonOutput.toJson([
text : text,
channel : channel,
username : "buildbot",
icon_emoji: icon
])
sh "curl -X POST --data-urlencode ${shellString(payload)} ${slackURL}"
}

// From https://issues.jenkins-ci.org/browse/JENKINS-44231

// Given arbitrary string returns a strongly escaped shell string literal.
// I.e. it will be in single quotes which turns off interpolation of $(...), etc.
// E.g.: 1'2\3\'4 5"6 (groovy string) -> '1'\''2\3\'\''4 5"6' (groovy string which can be safely pasted into shell command).
def shellString(s) {
// Replace ' with '\'' (https://unix.stackexchange.com/a/187654/260156). Then enclose with '...'.
// 1) Why not replace \ with \\? Because '...' does not treat backslashes in a special way.
// 2) And why not use ANSI-C quoting? I.e. we could replace ' with \'
// and enclose using $'...' (https://stackoverflow.com/a/8254156/4839573).
// Because ANSI-C quoting is not yet supported by Dash (default shell in Ubuntu & Debian) (https://unix.stackexchange.com/a/371873).
'\'' + s.replace('\'', '\'\\\'\'') + '\''
}
42 changes: 33 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@ A hybrid game networking and web API server, focused on Social Mixed Reality.

#### PostgreSQL (recommended version 11.x):

Linux: Use your package manager
Linux:

On Ubuntu, you can use
```
apt install postgresql
```

Otherwise, consult your package manager of choice for other Linux distributions

Windows: https://www.postgresql.org/download/windows/

Expand All @@ -30,8 +37,9 @@ Run the following commands at the root of the reticulum directory:

1. `mix deps.get`
2. `mix ecto.create`
- If step 2 fails, you may need to change the password for the `postgres` role to match the password configured `dev.exs`.
- From within the `psql` shell, enter `ALTER USER postgres WITH PASSWORD 'postgres';`
* If step 2 fails, you may need to change the password for the `postgres` role to match the password configured `dev.exs`.
* From within the `psql` shell, enter `ALTER USER postgres WITH PASSWORD 'postgres';`
* If you receive an error that the `ret_dev` database does not exist, (using psql again) enter `create database ret_dev;`
3. from the `assets` directory, `npm install`
4. From the project directory `mkdir -p storage/dev`

Expand All @@ -41,19 +49,22 @@ Run `scripts/run.sh` if you have the hubs secret repo cloned. Otherwise `iex -S

## Run Hubs Against a Local Reticulum Instance

### 0. Dependencies

[Install NodeJS](https://nodejs.org) if you haven't already. We recommend version 12 or above.

### 1. Setup the `hubs.local` hostname

When running the full stack for Hubs (which includes Reticulum) locally it is necessary to add a `hosts` entry pointing `hubs.local` to your local server's IP.
This will allow the CSP checks to pass that are served up by Reticulum so you can test the whole app. Note that you must also load hubs.local over https.

Example:
On MacOS or Linux:

```bash
nano /etc/hosts
```
hubs.local 127.0.0.1

From there, add a host alias

Example:
```bash
127.0.0.1 hubs.local
```

### 2. Setting up the Hubs Repository
Expand Down Expand Up @@ -96,6 +107,17 @@ After you've started Reticulum for the first time you'll likely want to create a
Ret.Account |> Ret.Repo.all() |> Enum.at(0) |> Ecto.Changeset.change(is_admin: true) |> Ret.Repo.update!()
```

### 7. Start the Admin Portal server in local development mode

When running locally, you will need to also run the admin portal, which routes to hubs.local:8989
Using a separate terminal instance, navigate to the `hubs/admin` folder and use:
```
npm run local
```

You can now navigate to https://hubs.local:4000/admin to access the admin control panel


## Run Spoke Against a Local Reticulum Instance

1. Follow the steps above to setup Hubs
Expand Down Expand Up @@ -125,3 +147,5 @@ default_janus_csp_rule =
```
psql-userdb="host=hubs.local dbname=ret_dev user=postgres password=postgres options='-c search_path=coturn' connect_timeout=30"
```


62 changes: 0 additions & 62 deletions assets/brunch-config.js

This file was deleted.

6 changes: 0 additions & 6 deletions assets/css/app.css

This file was deleted.

26 changes: 0 additions & 26 deletions assets/js/app.js

This file was deleted.

Loading