dit-calendar
Dependency hinzufügen: in dit-calendar-server.cabal unter dem "build-depends:"-Tag
alles installieren und bauen: cabal install -j
beim erstem Mal sandbox aufsetzen: cabal sandbox init
alles Dependency und Compelierte Dateinen werden nicht mehr global sondern local(im Projektverzeichnis) installiert
Play around with the code in GHCi
Programm bauen und ausführen
bauen: cabal build
starten: .cabal-sandbox/bin/dit-calendar-server
einzelne Datein ausführen: ?
bei kaputtem cabal: cabal clean
builds tests and runs them: cabal install --enable-tests
oder cabal configure --enable-tests
alle Tests ausführen: cabal test
einzelne Tests ausführen: ?
buil: stack build
stack build --fast --file-watch
execute: stack exec dit-calendar-server
if stack broken: stack clean
repl: stack ghci
test: stack test
Manche IDE's benötigen das Packet "intero" dies muss beim ersten mal manuell installiert werden stack install intero-0.1.24 --resolver=lts-10.10
create docker image
build docker image docker build -t ditcalendar/dit-calendar-server .
update image to docker hub docker push ditcalendar/dit-calendar-server
kubernetes
set up kubectl
export KUBECONFIG=$HOME/Downloads/okteto-kube.config:${KUBECONFIG:-$HOME/.kube/config}
kubectl get all
update pod kubectl apply -f k8s.yml
curl -H " Content-Type: application/json" -X POST -d ' {"user":"alex2","password":"12345"}' http://localhost:8080/authenticate/authentication-methods/password/token --insecure
curl -H " Content-Type: application/json" -X POST -d ' {"naPassword":"12345","naPasswordConfirm":"12345", "naUser":{"email": "a.befort@googlemail.com", "username":"alex2", "userId":0}}' http://localhost:8080/authenticate/authentication-methods/password/account --insecure
curl -H " Authorization: Bearer xxx" -X GET http://localhost:8080/users/me --insecure
curl -H " Content-Type: application/json" -H " Authorization: Bearer xxx" -X PUT -d ' {"loginName":"test", "userId":1}' http://localhost:8080/user/me --insecure
curl -H "Authorization: Bearer xxx" -X GET http://localhost:8080/ --insecure
curl -X GET http://localhost:8080/users --insecure
curl -X GET http://localhost:8080/users/1 --insecure
curl -H " Content-Type: application/json" -H " Authorization: Bearer xxx" -X GET http://localhost:8080/calendarentries/1 --insecure
show calendar of logged in user
curl -H " Content-Type: application/json" -H " Authorization: Bearer xxx" -X GET http://localhost:8080/calendarentries/ --insecure
curl -H " Content-Type: application/json" -H " Authorization: Bearer XXX" -X POST -d ' {"description":"testHeute","startDate":"2011-11-19T18:28:52.607875Z", "endDate":"2011-11-20T12:15:53.102875Z"}' http://localhost:8080/calendarentries --insecure
curl -H " Content-Type: application/json" -H " Authorization: Bearer XX" -X PUT -d ' {"description":"testHeute","startDate":"2011-11-19T18:28:52.607875Z", "endDate":"2011-11-20T12:15:53.102875Z"}' http://localhost:8080/calendarentries/1 --insecure
show all telegramLinks of calendar
curl -H " Content-Type: application/json" -H " Authorization: Bearer XX" -X GET http://localhost:8080/calendarentries/1/telegramlinks --insecure
curl -H " Content-Type: application/json" -H " Authorization: Bearer xxx" -X GET http://localhost:8080/calendarentries/1/tasks/1 --insecure
curl -H " Content-Type: application/json" -H " Authorization: Bearer xxx" -X GET http://localhost:8080/calendarentries/2/tasks --insecure
curl -H " Content-Type: application/json" -H " Authorization: Bearer xxx" -X POST -d ' {"description":"testHeute", "belongingUsers":[1], "startTime":"2011-11-19T18:28:52.607875Z"}' http://localhost:8080/calendarentries/1/tasks --insecure
curl -H " Content-Type: application/json" -H " Authorization: Bearer xxx" -X PUT -d ' {"description":"testHeute2", "belongingUsers":[1]}' http://localhost:8080/calendarentries/1/tasks/1 --insecure
curl -H " Content-Type: application/json" -H " Authorization: Bearer xxx" -X PUT http://localhost:8080/calendarentries/1/tasks/1/assignment --insecure