Skip to content

Commit

Permalink
Merge pull request #37 from TJM/feat/make-setup-better
Browse files Browse the repository at this point in the history
feat: use env variables during make setup
  • Loading branch information
alexhung authored Feb 22, 2023
2 parents 1adb380 + 6bb0068 commit a540732
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
GOARCH = amd64
ACCESS_TOKEN ?= $(shell printenv ACCESS_TOKEN || echo 'access_token')
ARTIFACTORY_URL ?= $(shell printenv ARTIFACTORY_URL || echo 'http://localhost:8080')
ARTIFACTORY_SCOPE ?= $(shell printenv ARTIFACTORY_SCOPE || echo 'applied-permissions/groups:readers')

UNAME = $(shell uname -s)

Expand Down Expand Up @@ -33,9 +36,9 @@ fmt:
go fmt $$(go list ./...)

setup: enable
vault write artifactory/config/admin url=http://localhost:8080 access_token=access_token
vault write artifactory/config/admin url=$(ARTIFACTORY_URL) access_token=$(ACCESS_TOKEN)
vault read artifactory/config/admin
vault write artifactory/roles/test scope="test" username="test-user" max_ttl=3h default_ttl=2h
vault write artifactory/roles/test scope="$(ARTIFACTORY_SCOPE)" username="test-user" max_ttl=3h default_ttl=2h
vault read artifactory/roles/test

artifactory:
Expand Down

0 comments on commit a540732

Please sign in to comment.