Skip to content

Latest commit

 

History

History
86 lines (61 loc) · 2.51 KB

tutorial.md

File metadata and controls

86 lines (61 loc) · 2.51 KB

Tutorial

Start ECR

git clone https://github.com/sagecontinuum/sage-ecr.git
cd sage-ecr
./run.sh -d

Define ECR_API, SAGE_USER_TOKEN variables

export ECR_API="localhost:5000"
export SAGE_USER_TOKEN="token1"

Optional: Use jq for pretty formatting of json output. jq installation instructions

upload "simple plugin" under the namespace "sage"

curl -X POST ${ECR_API}/apps/sage/simple/1.0 -H "Authorization: sage ${SAGE_USER_TOKEN}" --data-binary  @./example_app.yaml | jq .

Note: repeating this call will re-upload the app, as long as the field "frozen" is false

get app

curl -X GET  ${ECR_API}/apps/sage/simple/1.0 -H "Authorization: sage ${SAGE_USER_TOKEN}" | jq .

share repository sage/simple with testuser2

curl -X PUT  ${ECR_API}/permissions/sage/simple -H "Authorization: sage ${SAGE_USER_TOKEN}" -d '{"operation":"add", "granteeType": "USER", "grantee": "testuser2", "permission":"WRITE"}' | jq .

verify (view permissions as testuser):

curl ${ECR_API}/permissions/sage/simple -H "Authorization: sage ${SAGE_USER_TOKEN}"  | jq .

verify (view app as testuser2)

curl ${ECR_API}/apps/sage/simple/1.0 -H "Authorization: sage token2"  | jq .

share namespace sage with testuser2

curl -X PUT  ${ECR_API}/permissions/sage -H "Authorization: sage ${SAGE_USER_TOKEN}" -d '{"operation":"add", "granteeType": "USER", "grantee": "testuser2", "permission":"WRITE"}' | jq .

verify

curl ${ECR_API}/permissions/sage -H "Authorization: sage ${SAGE_USER_TOKEN}" | jq .

list all namespaces

curl ${ECR_API}/namespaces -H "Authorization: sage ${SAGE_USER_TOKEN}" | jq .

list all repositories in a given namespace

curl  ${ECR_API}/repositories/sage -H "Authorization: sage ${SAGE_USER_TOKEN}" | jq .

trigger build for specific app

curl -X POST ${ECR_API}/builds/sage/simple/1.0 -H "Authorization: sage ${SAGE_USER_TOKEN}" | jq .

get build status

curl -X GET ${ECR_API}/builds/sage/simple/1.0 -H "Authorization: sage ${SAGE_USER_TOKEN}" | jq .

open Jenkins UI in browser

http://localhost:8082

Note: After the start of Jenkins you have to login as user ecrdb with password test. You can skip the "Getting Started" dialogue but clicking the X in the upper right corner. Then click on the blue button Start using Jenkins. After that your are logged in. Users can view the Jenkins instance without logging in.