diff --git a/ansible/clouditor/Makefile b/ansible/clouditor/Makefile index 42a887c081f5e31c20fd01d77b5859d1d5eec95a..66708095aa3a99127a2caaadd88f2f9239a64549 100644 --- a/ansible/clouditor/Makefile +++ b/ansible/clouditor/Makefile @@ -1,9 +1,13 @@ -build: - go install google.golang.org/protobuf/cmd/protoc-gen-go \ +install-dependencies: + ~/.go/bin/go get github.com/google/gnostic/cmd/protoc-gen-openapi + ~/.go/bin/go install google.golang.org/protobuf/cmd/protoc-gen-go \ google.golang.org/grpc/cmd/protoc-gen-go-grpc \ github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway \ - github.com/googleapis/gnostic/apps/protoc-gen-openapi - go generate ./... && go build ./... + github.com/google/gnostic/cmd/protoc-gen-openapi + +build: + ~/.go/bin/go generate ./... + ~/.go/bin/go build ./... run: - go run cmd/engine/engine.go --db-in-memory \ No newline at end of file + ~/.go/bin/go run cmd/engine/engine.go --db-in-memory \ No newline at end of file diff --git a/ansible/provision-clouditor.yml b/ansible/provision-clouditor.yml index ca5ffe40a78f357972c85b7316cbfd38c55033e2..32beabfe94100924a72ec3533000dd6827da7070 100644 --- a/ansible/provision-clouditor.yml +++ b/ansible/provision-clouditor.yml @@ -15,10 +15,10 @@ - name: Download Golang installer get_url: url: https://storage.googleapis.com/golang/getgo/installer_linux - dest: ~/installer_linux + dest: /home/vagrant/installer_linux mode: '0555' - name: Run Golang installer - raw: ./installer_linux && source ~/.bashrc + raw: ./installer_linux && source /home/vagrant/.bash_profile - name: Create dir file: path: /home/vagrant/clouditor @@ -28,11 +28,15 @@ repo: https://github.com/clouditor/clouditor.git dest: /home/vagrant/clouditor force: yes - version: v1.3.9 + version: v1.3.14 - name: Copy Makefile copy: src: ./clouditor/Makefile dest: /home/vagrant/clouditor/Makefile + - name: Install Clouditor dependencies + make: + chdir: /home/vagrant/clouditor + target: install-dependencies - name: Build Clouditor make: chdir: /home/vagrant/clouditor @@ -50,5 +54,5 @@ shell: chdir: /home/vagrant/clouditor executable: /bin/bash - cmd: "(nohup ~/.go/bin/go run cmd/engine/engine.go --db-in-memory </dev/null >/var/log/clouditor.log 2>&1 & sleep 1)" + cmd: "(nohup /home/vagrant/.go/bin/go run cmd/engine/engine.go --db-in-memory </dev/null >/var/log/clouditor.log 2>&1 & sleep 1)" # see https://ansibledaily.com/execute-detached-process-with-ansible/ \ No newline at end of file