Skip to content

Commit

Permalink
feat: docker-compose-deploy template, shell config for AWS and GCP
Browse files Browse the repository at this point in the history
  • Loading branch information
acrois committed Apr 24, 2024
1 parent a9cd5e6 commit 40f09ae
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/template/docker-compose-deploy
Submodule docker-compose-deploy added at daf5b7
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@
[submodule ".github/template/terraform-prepare"]
path = .github/template/terraform-prepare
url = [email protected]:acrois/terraform-prepare
[submodule ".github/template/docker-compose-deploy"]
path = .github/template/docker-compose-deploy
url = [email protected]:acrois/docker-compose-deploy
17 changes: 17 additions & 0 deletions .ssh/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Host gcp-*
ProxyCommand gcloud compute start-iap-tunnel $(cut -c 4- <<< "%h") %p --listen-on-stdin --verbosity=warning
StrictHostKeyChecking no

Host aws-*
ProxyCommand aws ssm start-session --target $(cut -c 4- <<< "%h") --document-name AWS-StartSSHSession --parameters portNumber=%p
StrictHostKeyChecking no

Host i-* mi-*
ProxyCommand aws ssm start-session --target %h --document-name AWS-StartSSHSession --parameters portNumber=%p
StrictHostKeyChecking no

Host * *
ControlMaster auto
ControlPersist 900
# Alternative: /tmp/%r@%h-%p
ControlPath /tmp/u-%i-ssh-%C
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ RUN \
tar \
coreutils \
python3 \
openssh \
&& apk add \
--repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing/ \
git-filter-repo \
Expand All @@ -24,6 +25,9 @@ ENTRYPOINT [ "/entrypoint.sh" ]
WORKDIR /etc/skel/
RUN echo -e "\nsource ~/scripts/config/.profile\n" >> .profile

WORKDIR /etc/skel/.ssh/
COPY .ssh .

WORKDIR /etc/skel/scripts/
COPY config.sh .
COPY config ./config
Expand Down
14 changes: 11 additions & 3 deletions config.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
#/usr/bin/env sh
echo -e "\nsource $HOME/scripts/config/.profile\n" >> ~/.profile
source ~/.profile
#!/usr/bin/env sh

DEST="$HOME/.profile"

if [ -f "$HOME/.bash_profile" ]; then
DEST="$HOME/.bash_profile";
fi

# echo $DEST;
echo "\nsource $HOME/scripts/config/.profile\n" >> $DEST;
source $DEST;

0 comments on commit 40f09ae

Please sign in to comment.