Compare commits
10 commits
3d1f701a48
...
3278e16057
Author | SHA1 | Date | |
---|---|---|---|
baalajimaestro | 3278e16057 | ||
baalajimaestro | 1d99a1e160 | ||
baalajimaestro | b20f4082eb | ||
baalajimaestro | a9b08ad89d | ||
baalajimaestro | 2a8a1cf5ed | ||
baalajimaestro | 19e703c6f0 | ||
baalajimaestro | cd79f4d7ce | ||
baalajimaestro | b47e31882c | ||
baalajimaestro | 584aeb3785 | ||
baalajimaestro | 76abf688c6 |
14
.build.sh
|
@ -1,8 +1,18 @@
|
|||
#! /bin/sh
|
||||
|
||||
apk add --no-cache python3 py3-pip git
|
||||
apk add git python3 py3-gitpython openssh-client
|
||||
|
||||
mkdir ~/.ssh
|
||||
chmod 700 ~/.ssh
|
||||
|
||||
echo "Setting Host Keys for GitLab...."
|
||||
echo '[git.baalajimaestro.me]:29999 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC3IrYRuprw3liGd+/EGLBFqxQ9S2+/1FNxNCpO87wjRIpDxZjAWOvT2tUoIEUzWEGNHqkgRLn+rR0hsGK0SqHIPyEIsJ5AKuS7zuhy6fkVS7RsDHjJ8usBF4j3EnkYBse5qLgUIf37u0mF0EXAFcuwOBgvXM6hqL0UYcQqRGWWrHvkRRcmizkAcxJcframf3+PLG/vn4fSUH7ZUUqjx6/QIJS0iFb0HB2mv8sWzpJlJmy46WZVltwPDLOLeGZb4OcAB20/yfPalb4MsQeSrVmYtRos3sN8Uh/DwfNT/u5Jk6qqXHm3GW2fzsbZInb+0XjrmdaH3awhUN0vQMDvYgvR2UcZHgRuJvKXMAo3keOA8m9cBXJvopr/TyKt4GUvIGzjXUB9kyW/sIxn6qJel8y3b486FxV1EI2m9wKzFbtRdRG1xWxjTR16LyerrzwgAaAayFxyuQ6UgvM4zCzdgk6cDT2hGfHhF2NUKiWDobGowQJairVCzaYZCT/jy9avm2M=' >> ~/.ssh/known_hosts
|
||||
echo '[git.baalajimaestro.me]:29999 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBL0yV054Ox/OPWCAz6hzo6VKkugDJx7ziCQBAdjhWfTTK3YCYroPANtflimBZYNhl43OyUx0mbdh8W27+T/PXBU=' >> ~/.ssh/known_hosts
|
||||
echo '[git.baalajimaestro.me]:29999 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHJWhNlVfjAqfnHGqtqudlRZ8IBD8gt2XJUvBBAI6+5K' >> ~/.ssh/known_hosts
|
||||
|
||||
git config --global user.name baalajimaestro
|
||||
git config --global user.email me@baalajimaestro.me
|
||||
pip3 install GitPython
|
||||
|
||||
export HUGO_ENV=production
|
||||
|
||||
python3 .buildpush.py
|
||||
|
|
|
@ -6,11 +6,7 @@ from time import time
|
|||
from pathlib import Path
|
||||
|
||||
# All the env vars
|
||||
base_repo_user = os.environ.get("BASE_REPO_USERNAME")
|
||||
base_repo_token = os.environ.get("BASE_REPO_TOKEN")
|
||||
content_repo_git = os.environ.get("CONTENT_REPO_GIT")
|
||||
content_repo_username = os.environ.get("CONTENT_REPO_USERNAME")
|
||||
content_repo_token = os.environ.get("CONTENT_REPO_TOKEN")
|
||||
out_dir = os.environ.get("OUT_DIR")
|
||||
|
||||
# Find absolute path of current directory
|
||||
|
@ -19,11 +15,15 @@ path = Path(cwd)
|
|||
base_dir = str(path)
|
||||
current_time = str(int(time()))
|
||||
|
||||
# Set SSH Key path
|
||||
git_ssh_cmd = "ssh -i /tmp/ssh-key"
|
||||
|
||||
# Clone our content
|
||||
content_repo = Repo.clone_from(
|
||||
f"https://{content_repo_username}:{content_repo_token}@git.baalajimaestro.me/baalajimaestro/{content_repo_git}.git",
|
||||
f"ssh://git@git.baalajimaestro.me:29999/baalajimaestro/{content_repo_git}.git",
|
||||
f"{base_dir}/content",
|
||||
branch="prod"
|
||||
branch="prod",
|
||||
env=dict(GIT_SSH_COMMAND=git_ssh_cmd)
|
||||
)
|
||||
|
||||
|
||||
|
@ -33,7 +33,7 @@ os.chdir(out_dir)
|
|||
repo = Repo.init(out_dir)
|
||||
repo.create_remote(
|
||||
"origin",
|
||||
f"https://{base_repo_user}:{base_repo_token}@git.baalajimaestro.me/baalajimaestro/personal-website.git",
|
||||
f"ssh://git@git.baalajimaestro.me:29999/baalajimaestro/personal-website.git",
|
||||
)
|
||||
|
||||
# Build the binaries
|
||||
|
@ -44,4 +44,4 @@ process = subprocess.run(["hugo", "--gc", "--minify", "-d", out_dir])
|
|||
os.chdir(out_dir)
|
||||
repo.git.add(".")
|
||||
repo.index.commit(f"[MaestroCI]: Binaries as of {current_time}")
|
||||
repo.git.push("origin", "master", force=True)
|
||||
repo.git.push("origin", "master", force=True, env=dict(GIT_SSH_COMMAND=git_ssh_cmd))
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
build-and-push:
|
||||
stage: build
|
||||
before_script:
|
||||
- chmod 600 $SSH_SECRET_KEY
|
||||
script:
|
||||
- docker run -v $(pwd):/app -w /app -e BASE_REPO_TOKEN="$BASE_REPO_TOKEN" -e BASE_REPO_USERNAME="$BASE_REPO_USERNAME" -e CONTENT_REPO_GIT="$CONTENT_REPO_GIT" -e CONTENT_REPO_TOKEN="$CONTENT_REPO_TOKEN" -e CONTENT_REPO_USERNAME="$CONTENT_REPO_USERNAME" -e OUT_DIR="$OUT_DIR" registry.baalajimaestro.me/baalajimaestro/hugo-alpine-ext:latest sh .build.sh
|
||||
- docker run -v $(pwd):/app -w /app -v "$SSH_SECRET_KEY":/tmp/ssh-key -e CONTENT_REPO_GIT="$CONTENT_REPO_GIT" -e OUT_DIR="$OUT_DIR" registry.baalajimaestro.me/baalajimaestro/hugo-alpine-ext:latest sh .build.sh
|
||||
- docker run -v $(pwd):/app busybox rm -rf /app/content /app/resources
|
||||
|
|
BIN
assets/logo.webp
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 62 KiB |
|
@ -1,9 +1,7 @@
|
|||
languageCode = "en"
|
||||
languageName = "English"
|
||||
displayName = "EN"
|
||||
isoCode = "en"
|
||||
weight = 1
|
||||
rtl = false
|
||||
|
||||
|
||||
copyright = "© 2023 Maestro Creativescape."
|
||||
title = "baalajimaestro"
|
||||
|
@ -11,4 +9,10 @@ title = "baalajimaestro"
|
|||
[author]
|
||||
name = "baalajimaestro"
|
||||
image = "logo.webp"
|
||||
headline = "DevOps Engineer, and Self-taught System Administrator"
|
||||
headline = "DevOps Engineer, and Self-taught System Administrator"
|
||||
|
||||
[params]
|
||||
isoCode = "en"
|
||||
displayName = "EN"
|
||||
rtl = false
|
||||
dateFormat = "2 January 2006"
|
2
go.mod
|
@ -2,4 +2,4 @@ module github.com/baalajimaestro/personal-website
|
|||
|
||||
go 1.17
|
||||
|
||||
require github.com/jpanther/congo/v2 v2.5.2 // indirect
|
||||
require github.com/jpanther/congo/v2 v2.6.1 // indirect
|
||||
|
|
10
go.sum
|
@ -1,4 +1,6 @@
|
|||
github.com/jpanther/congo/v2 v2.5.0 h1:eAnZFSsY9C0buQmyRVtIR7WAl2sHZEn5LXYvwS7BsxI=
|
||||
github.com/jpanther/congo/v2 v2.5.0/go.mod h1:1S7DRoO1ZYS4YUdFd1LjTkdyjQwsjFWd8TqSfz3Jd+M=
|
||||
github.com/jpanther/congo/v2 v2.5.2 h1:cSM6cnBfbsSN9uYIKXjnyudZDWK+OWWVPVlFmkQQSGE=
|
||||
github.com/jpanther/congo/v2 v2.5.2/go.mod h1:1S7DRoO1ZYS4YUdFd1LjTkdyjQwsjFWd8TqSfz3Jd+M=
|
||||
github.com/jpanther/congo/v2 v2.5.4 h1:6SLJ5y1hXs2eu4Ce8HBT5YLLbnu0GE+CZ686p/2jRFw=
|
||||
github.com/jpanther/congo/v2 v2.5.4/go.mod h1:1S7DRoO1ZYS4YUdFd1LjTkdyjQwsjFWd8TqSfz3Jd+M=
|
||||
github.com/jpanther/congo/v2 v2.6.0 h1:0AS0YKxEdqiAxzE4dUm9aSzVTOGIZW5GzD5syOWmsKw=
|
||||
github.com/jpanther/congo/v2 v2.6.0/go.mod h1:1S7DRoO1ZYS4YUdFd1LjTkdyjQwsjFWd8TqSfz3Jd+M=
|
||||
github.com/jpanther/congo/v2 v2.6.1 h1:iA8uosVsiMl3JbBSBwMvrxEibzBcDp+RIj18f/cmlDs=
|
||||
github.com/jpanther/congo/v2 v2.6.1/go.mod h1:1S7DRoO1ZYS4YUdFd1LjTkdyjQwsjFWd8TqSfz3Jd+M=
|
||||
|
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 66 KiB |
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 365 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 59 KiB |
Before Width: | Height: | Size: 612 B After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 3 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 12 KiB |