Skip to content

Commit

Permalink
Merge pull request #9 from cytopia/documentation
Browse files Browse the repository at this point in the history
Add install instructions
  • Loading branch information
cytopia authored May 31, 2022
2 parents b845d4c + af7f8d6 commit fbd8786
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 6 deletions.
29 changes: 28 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,39 @@ FL_IMAGE = cytopia/file-lint
FL_VERSION = 0.4
FL_IGNORES = .git/,.github/

BIN_DIR = /usr/local/bin


# -------------------------------------------------------------------------------------------------
# Default target
# -------------------------------------------------------------------------------------------------
.PHONY: help
help:
@echo "lint Lint files"
@echo "lint Lint files"
@echo "install Install aws-export-assume-profile to $(BIN_DIR)"
@echo "uninstall Remove aws-export-assume-profile from $(BIN_DIR)"


# -------------------------------------------------------------------------------------------------
# Install target
# -------------------------------------------------------------------------------------------------
.PHONY: install
install:
install -m 755 aws-export-assume-profile $(BIN_DIR)/aws-export-assume-profile

.PHONY: uninstall
uninstall:
rm $(BIN_DIR)/aws-export-assume-profile


# -------------------------------------------------------------------------------------------------
# Lint target
# -------------------------------------------------------------------------------------------------
.PHONY: lint
lint: lint-files
lint: lint-shell

.PHONY: lint-files
lint-files: _pull-fl
@# Lint all files
@echo "################################################################################"
Expand All @@ -40,6 +63,7 @@ lint-files: _pull-fl
@docker run --rm $$(tty -s && echo "-it" || echo) -v $(CURRENT_DIR):/data $(FL_IMAGE):$(FL_VERSION) file-utf8-bom --text --ignore '$(FL_IGNORES)' --path .
@echo

.PHONY: lint-shell
lint-shell: _pull-sc
@# Lint all Shell files
@echo "################################################################################"
Expand All @@ -56,11 +80,14 @@ lint-shell: _pull-sc
fi;
@echo


# -------------------------------------------------------------------------------------------------
# Helper Targets
# -------------------------------------------------------------------------------------------------
.PHONY: _pull-fl
_pull-fl:
docker pull $(FL_IMAGE):$(FL_VERSION)

.PHONY: _pull-sc
_pull-sc:
docker pull $(SC_IMAGE):$(SC_VERSION)
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This tool requires `aws` cli and retrieves credentials via `aws sts assume-role`
**Note:** Wrap the command in **`$(aws-export-assume-profile)`** to actually export your profiled environment variables.


## But why?
## :question: But why?

Most AWS related tools support profiles out of the box, such as the `aws-cli` (Example: `aws ec2 --profile <AWS_PROFILE>`). However sometimes it is required to have your chosen aws profile available as shell variables. One of the use cases is when you use Docker and want a specific login available inside your container.:
```bash
Expand All @@ -26,7 +26,7 @@ user> docker run --rm -it \
```


## Available exports
## :arrow_forward: Available exports

The following export variables are currently supported.

Expand All @@ -44,7 +44,14 @@ The following export variables are currently supported.
> https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html

## Examples

## :tada: Installation
```bash
sudo make install
```


## :bulb: Examples

This tool simply output the exports to stdout. In order to auto-source them, wrap the command in **`$(...)`**.

Expand Down Expand Up @@ -105,7 +112,7 @@ user> $(aws-export-assume-profile -u)
```


## Usage
## :computer: Usage

```bash
Usage: aws-export-assume-profile [profile] [config]
Expand Down Expand Up @@ -153,7 +160,8 @@ Copyright (c) 2019 cytopia
https://github.com/cytopia/aws-export-assume-profile
```

## License

## :page_facing_up: License

**[MIT License](LICENSE.md)**

Expand Down

0 comments on commit fbd8786

Please sign in to comment.