Skip to content

Instantly share code, notes, and snippets.

@jlandure
Last active February 12, 2020 12:24
Show Gist options
  • Select an option

  • Save jlandure/d9be06d672c05905fdcc36c440cfdcaa to your computer and use it in GitHub Desktop.

Select an option

Save jlandure/d9be06d672c05905fdcc36c440cfdcaa to your computer and use it in GitHub Desktop.
hugo command
#!/bin/bash
#Fetch Nantes branch
env
echo $'#!/bin/bash\nif [ "$CI_BRANCH" = "nantes" ]\nthen\n echo "Not a PullRequest, checkout nantes branch"\n git fetch origin\n git checkout nantes\nfi\n' > git-command.sh
cat git-command.sh
chmod +x git-command.sh && ./git-command.sh
rm -Rf themes/devfest-theme-hugo
git clone https://github.com/GDG-Nantes/devfest-theme-hugo.git themes/devfest-theme-hugo
#Get Hugo
#curl -fsSL -o /tmp/hugo.tar.gz https://github.com/gohugoio/hugo/releases/download/v0.55.2/hugo_extended_0.55.2_Linux-64bit.tar.gz
curl -fsSL -o /tmp/hugo.tar.gz https://github.com/gohugoio/hugo/releases/download/v0.54.0/hugo_extended_0.54.0_Linux-64bit.tar.gz
tar -xzf /tmp/hugo.tar.gz
ls -l
chmod +x ./hugo
./hugo version
#Install npm
nvm install 11.6.0
nvm use 11.6.0
node -v
cd themes/devfest-theme-hugo
git fetch origin
git checkout nantes
npm install
npm run build
#Launch Hugo Generation
cd ../..
./hugo -D
ls -al public
@jlandure
Copy link
Author

Deploy:

#Deploy with draft ./hugo
cp ./.appengine/app.yaml ./public/
chmod +x ./.appengine/*
#Install Cloud SDK
./.appengine/gcloud-install.sh
#Deploy to App Engine
./.appengine/gcloud-deploy.sh
#Deploy without draft ./hugo
HUGO_ENV=production ./hugo
cp ./.appengine/app.yaml ./public/
google-cloud-sdk/bin/gcloud --project XXX app deploy --version $VERSION_APPENGINE --quiet public/app.yaml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment