Commit 9615d5aa authored by kwadronaut's avatar kwadronaut
Browse files

build 'n run

parent d266ad62
image:
name: klakegg/hugo:ext
entrypoint: [""]
stages:
- build
- deploy
variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
DOCERK_DRIVER: overlay
GIT_SUBMODULE_STRATEGY: recursive
build:
stage: build
before_script:
- eval $(ssh-agent -s)
- echo "${deploykey}"| base64 -d| ssh-add - > /dev/null
- echo 'tell me to trust the public keyprint'
- mkdir -p ~/.ssh/ && cp $SSH_KNOWN_HOSTS ~/.ssh/known_hosts
- chmod 700 ~/.ssh/known_hosts
#- mkdir public
#- cd public
#- git init && git git@0xacab.org:leap/leap.se.git && git pull origin main
#- cd ..
script:
- ./deploy.sh
#- cd public
#- git config user.name "leap-o-magic-0xacabrunner"
#- git config user.email "0xacab@leap.se"
#- git pull
#- git status
#- git remote -v
#- git branch --set-upstream-to=origin/main
#- git push -nv --set-upstream origin main
#- hugo -t academic || hugo -t academic --debug
#- cd public; git add .
artifacts:
paths:
- public
- resources
when: always
expire_in: 3 day
deploy:
stage: deploy
needs: ["build"]
only:
- main
variables:
GIT_CLEAN_FLAGS: none
before_script:
- eval $(ssh-agent -s)
- echo "${deploykey}"| base64 -d| ssh-add - > /dev/null
- mkdir -p public; pwd
- echo 'tell me to trust the public keyprint'
- mkdir -p ~/.ssh/ && cp $SSH_KNOWN_HOSTS ~/.ssh/known_hosts
- chmod 700 ~/.ssh/known_hosts
script:
- echo "rsync it all"
- 'which rsync || ( apt-get -qq update && apt-get install -qq rsync )'
- echo "${deploykey}"| base64 -d| ssh-add - > /dev/null
- echo 'tell me to trust the public keyprint'
- cp $SSH_KNOWN_HOSTS ~/.ssh/known_hosts
- chmod 700 ~/.ssh
- ls -l public resources
#- ssh -v -t -o UserKnownHostsFile=~/.ssh/known_hosts web-hugo@204.13.164.51
- rsync -a -v --progress --human-readable
--exclude .git
--exclude .ssh
-e "ssh -o UserKnownHostsFile=~/.ssh/known_hosts -l web-hugo -o StrictHostKeyChecking=no"
public/ resources/
leap.se:/home/website/hugo/public
#leap.se:/tmp/testdeploy/
#-e "ssh -v -o UserKnownHostsFile=~/.ssh/known_hosts -l web-hugo -o StrictHostKeyChecking=no"
#"$PWD"
......@@ -4,10 +4,9 @@
1. Clone the repo:
git clone https://0xacab.org/leap/leap-se-hugo
cd leap-se-hugo
git clone https://0xacab.org/leap/leap-se-dev
cd leap-se-dev
2. Initialize the theme:
git submodule update --init --recursive
......@@ -12,15 +12,16 @@ mkdir public
cd public
git init
git checkout -b main
git remote add -m main origin git@0xacab.org:leap/leap.se.git
git branch -u origin/main
git remote add origin git@github.com:dcmcand/leap.se.git
git pull origin master
git pull origin main
cd ..
# Build the project.
hugo -t academic # if using a theme, replace with `hugo -t <YOURTHEME>`
hugo -t academic || hugo -t academic --debug # if using a theme, replace with `hugo -t <YOURTHEME>`
# Go To Public folder
cd public
......@@ -35,8 +36,8 @@ fi
git commit -m "$msg"
# Push source and build repos.
git push origin master
git remote add origin git@0xacab.org:leap/leap.se.git
git push --set-upstream origin main
# Come Back up to the Project Root
cd ..
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment