Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions deployer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ RUN apt update && \
RUN wget https://github.com/mikefarah/yq/releases/download/v4.27.5/yq_linux_amd64 -O /bin/yq && \
chmod +x /bin/yq

COPY deploy.sh deploy
ENTRYPOINT ["/app/deploy"]
COPY deployer.sh deployer
ENTRYPOINT ["/app/deployer"]
34 changes: 34 additions & 0 deletions deployer/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,35 @@
# Deployer - update k8s manifest and commit changes
This is ment to be part of CD proccess.
Will update k8s manifest in local repo with selected key-value and push changes to remote (where ArgoCD/Flux/other gitops will deploy)
Using `DEPLOY_KEY` will pull target repo

## Usage

### Args
`-f` -- file to be changed and commited
`-k` -- (key) - yaml path in -f(ile) to be changed
`-v` -- (value) - new values to be set for -k(ey)

### Environment variables

- `DEPLOY_KEY` -- plain ssh key to be used to commit

## Examples

### Argo Workflows

```yaml

```

## Tests

```sh
./deployer.sh -f tests/test.yaml -k '.global.tag' -v testing
```

## TODO

- [ ] Option to pull repo
- [ ] Set to which branch changes should be pushed
- [ ] create PR
9 changes: 5 additions & 4 deletions deployer/deploy.sh → deployer/deployer.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
set -eu
# DEPLOY_KEY=/app/.ssh/ssh.private
WORKDIR=/app/clone
WORKDIR="${WORKDIR:-/app/clone}"

_help() {
echo """
Expand All @@ -13,8 +13,8 @@ _help() {
-v -- (value) - new values to be set for -k(ey)

Envs:
DEPLOY_KEY - plain ssh key to be used to commit

DEPLOY_KEY -- plain ssh key to be used to commit
WORKDIR -- optional, workdir to clone and commit changes
"""
}

Expand Down Expand Up @@ -43,7 +43,8 @@ done

git_config() {
eval $(ssh-agent -s)
echo "${DEPLOY_KEY}" | tr -d '\r' | ssh-add - # TODO
# echo "${DEPLOY_KEY}" | tr -d '\r' | ssh-add - # TODO
ssh-add -i "${DEPLOY_KEY}"
mkdir -p ~/.ssh
chmod 700 ~/.ssh
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
Expand Down
47 changes: 0 additions & 47 deletions mongodump/README.md

This file was deleted.