Skip to content

Commit

Permalink
displicandum-gh-pages-travis (#8): created exclusive deploy key, save…
Browse files Browse the repository at this point in the history
…d in name of @eticaaibot
  • Loading branch information
fititnt committed May 11, 2021
1 parent 46be9ed commit 50b6822
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Site](https://img.shields.io/badge/Site-hapi.etica.ai-blue)](https://hapi.etica.ai)
[![HXL-CPLP/Auxilium-Humanitarium-API](https://img.shields.io/badge/GitHub-HXL--CPLP%2FAuxilium--Humanitarium--API-lightgrey?logo=github&style=social)](https://github.com/HXL-CPLP/Auxilium-Humanitarium-API)
[![GitHub Repo stars](https://img.shields.io/github/stars/HXL-CPLP/Auxilium-Humanitarium-API?style=social)](https://github.com/HXL-CPLP/Auxilium-Humanitarium-API)
[![Download .zip](https://img.shields.io/badge/Download-.zip-blue)](https://github.com/HXL-CPLP/Auxilium-Humanitarium-API/archive/refs/heads/main.zip)
[![Download .zip](https://img.shields.io/badge/Download-.zip-brightgreen)](https://github.com/HXL-CPLP/Auxilium-Humanitarium-API/archive/refs/heads/main.zip)

<!--
![Repo license](https://img.shields.io/github/license/HXL-CPLP/Auxilium-Humanitarium-API)
Expand Down
10 changes: 8 additions & 2 deletions systema/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,14 @@
> - https://en.wiktionary.org/wiki/displico#Latin
> - English, "deploy", "deployment"
> - https://en.wiktionary.org/wiki/deploy

> - "infrastrūctūram", "infra"" + "strūctūram"
> - "infra-"
> - https://en.wiktionary.org/wiki/infra-#English
> - "structure"
> - https://en.wiktionary.org/wiki/structura#Latin
> - https://en.wiktionary.org/wiki/structure#English
> - "temporārium"
> - temporārium, https://en.wiktionary.org/wiki/temporarius#Latin
<!--
cd systema || exit
npm run displicandum-gh-pages
Expand Down
77 changes: 77 additions & 0 deletions systema/infrastructuram/temporarium.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#!/bin/sh
#===============================================================================
#
# FILE: temporarium.sh
#
# USAGE: ./systema/infrastructuram/temporarium.sh
#
# DESCRIPTION: ---
#
# OPTIONS: ---
#
# REQUIREMENTS: ---
# BUGS: ---
# NOTES: ---
# AUTHOR: Emerson Rocha <rocha[at]ieee.org>
# COMPANY: EticaAI
# LICENSE: Public Domain dedication
# SPDX-License-Identifier: Unlicense
# VERSION: v1.0
# CREATED: 2021-05-11 18:04 UTC started
# REVISION: ---
#===============================================================================

#### Create an exclusive SSH key for specific repository _______________________
### Create on local computer ---------------------------------------------------
# @see https://docs.github.com/en/developers/overview/managing-deploy-keys
# @see https://docs.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent

ssh-keygen -t ed25519 -C "[email protected]" -f "$HOME/.ssh/eticaai/id_ed25519-hapi"

### Add on the deploy repository -----------------------------------------------
# On our case is here
# - https://github.com/HXL-CPLP/hapi.etica.ai/settings/keys
# If someone is create on a different project, change this

# fititnt@bravo:~$ tree "$HOME/.ssh/eticaai/"
# /home/fititnt/.ssh/eticaai/
# ├── id_ed25519-hapi
# └── id_ed25519-hapi.pub

#### Change git push to use custom SSH key _____________________________________
### ALTERNATIVE ONE ------------------------------------------------------------
# @see https://stackoverflow.com/questions/7927750/specify-an-ssh-key-for-git-push-for-a-given-domain/7927828#7927828
# Without this step, the git will push as your user, not the new key

# cat "$HOME/.ssh/config.d/config_eticaai"
# # (...)
# Host github-as-hapi-user
# User git
# HostName github.com
# IdentityFile ~/.ssh/eticaai/id_ed25519-hapi
# IdentitiesOnly yes

# fititnt@bravo:~$ cat /workspace/git/HXL-CPLP/Auxilium-Humanitarium-API/systema/cache/gh-pages-temp-git/.git/config
# [core]
# repositoryformatversion = 0
# filemode = true
# bare = false
# logallrefupdates = true
# [remote "remote-publisher"]
# # url = [email protected]:HXL-CPLP/hapi.etica.ai.git
# url = git@github-as-hapi-user:HXL-CPLP/hapi.etica.ai.git
# fetch = +refs/heads/*:refs/remotes/remote-publisher/*
# [branch "gh-pages"]
# remote = remote-publisher
# merge = refs/heads/gh-pages


### ALTERNATIVE TWO ------------------------------------------------------------
# @see https://stackoverflow.com/questions/7927750/specify-an-ssh-key-for-git-push-for-a-given-domain/43953433#43953433
# fititnt@bravo:/workspace/git/HXL-CPLP/Auxilium-Humanitarium-API$ ./systema/programma/displicandum-gh-pages.sh
# manual instructions says
# cd /workspace/git/HXL-CPLP/Auxilium-Humanitarium-API/systema/cache/gh-pages-temp-git
# git push -u remote-publisher gh-pages --force
# New command instead of git push -u remote-publisher gh-pages --force
# GIT_SSH_COMMAND="ssh -i $HOME/.ssh/eticaai/id_ed25519-hapi" git push -u remote-publisher gh-pages --force

4 changes: 4 additions & 0 deletions systema/programma/displicandum-gh-pages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,12 @@ GIT_COMMITTER_NAME="${GIT_COMMITTER_NAME}" \
echo "RUN THIS MANUALLY"
echo ""
echo cd "${LOCALGIT}"
echo "# if want to publish with your own SSH key"
echo git push -u "${DEPLOY_REMOTE_NAME}" "${DEPLOY_BRANCH}" --force

echo "# if want to publish with a very specific Deploy key (recommented)"
echo GIT_SSH_COMMAND="ssh -i $HOME/.ssh/eticaai/id_ed25519-hapi" git push -u "${DEPLOY_REMOTE_NAME}" "${DEPLOY_BRANCH}" --force

# GIT_COMMITTER_NAME="${GIT_COMMITTER_NAME}" \
# GIT_COMMITTER_EMAIL="${GIT_COMMITTER_EMAIL}" git commit --author="New Name <[email protected]>

Expand Down

0 comments on commit 50b6822

Please sign in to comment.