deploying hugo static site on Netlify - deployment

I have issue to deploy my static site from Hugo on NETLIFY.
the link of the repo: https://github.com/glaiveVII/hugo_quickstart
I have double-checked my netlify.toml file, rebase and recreate my submodules but I still have issues with themes submodules
I never got this kind of issue before, developer logs :
2:57:08 PM: Build ready to start
2:57:17 PM: build-image version: 9e0f207a27642d0115b1ca97cd5e8cebbe492f63
2:57:17 PM: build-image tag: v3.3.2
2:57:17 PM: buildbot version: a2bab682ae0761baa4d123ebd00c57be933655dc
2:57:17 PM: Fetching cached dependencies
2:57:17 PM: Failed to fetch cache, continuing with build
2:57:17 PM: Starting to prepare the repo for build
2:57:18 PM: No cached dependencies found. Cloning fresh repo
2:57:18 PM: git clone https://github.com/glaiveVII/hugo_quickstart
2:57:18 PM: Preparing Git Reference refs/heads/master
2:57:21 PM: Error checking out submodules: Submodule 'themes/ananke' (https://github.com/budparr/gohugo-theme-ananke.git) registered for path 'themes/ananke'
Submodule 'themes/hyde-hyde' (https://github.com/htr3n/hyde-hyde.git) registered for path 'themes/hyde-hyde'
Cloning into '/opt/build/repo/themes/ananke'...
Cloning into '/opt/build/repo/themes/hyde-hyde'...
Submodule path 'themes/ananke': checked out '11246e470dedf8e563af4e215f388ce2bcc4685a'
error: Server does not allow request for unadvertised object 984f6bcfc2385be29cd05246f0eaf3bcfdef18fd
Fetched in submodule path 'themes/hyde-hyde', but it did not contain 984f6bcfc2385be29cd05246f0eaf3bcfdef18fd. Direct fetching of that commit failed.
2:57:21 PM: Failing build: Failed to prepare repo
2:57:21 PM: failed during stage 'preparing repo': Error checking out submodules: Submodule 'themes/ananke' (https://github.com/budparr/gohugo-theme-ananke.git) registered for path 'themes/ananke'
Submodule 'themes/hyde-hyde' (https://github.com/htr3n/hyde-hyde.git) registered for path 'themes/hyde-hyde'
Cloning into '/opt/build/repo/themes/ananke'...
Cloning into '/opt/build/repo/themes/hyde-hyde'...
Submodule path 'themes/ananke': checked out '11246e470dedf8e563af4e215f388ce2bcc4685a'
error: Server does not allow request for unadvertised object 984f6bcfc2385be29cd05246f0eaf3bcfdef18fd
Fetched in submodule path 'themes/hyde-hyde', but it did not contain 984f6bcfc2385be29cd05246f0eaf3bcfdef18fd. Direct fetching of that commit failed.
: exit status 1
2:57:21 PM: Finished processing build request in 4.298914476s
my netlify.toml file :
[build]
publish = "public"
command = "hugo"
[context.production.environment]
HUGO_VERSION = "0.59.1"
HUGO_ENV = "production"
HUGO_ENABLEGITINFO = "true"
my submodule file :
[submodule "themes/ananke"]
path = themes/ananke
url = https://github.com/budparr/gohugo-theme-ananke.git
[submodule "themes/hyde-hyde"]
path = themes/hyde-hyde
url = https://github.com/htr3n/hyde-hyde.git
an important part of my config.toml file :
languageCode = "en-us"
title = "Julien Pelegri"
theme = "hyde-hyde"
## Basic Configuration
baseurl = "https://pelegri.netlify.com/"
thank you in advance for your responses!

I solve my issues, I did many things :
- upgrade my hugo version in my netlify.toml
- clear cache
- re-add submodules

Related

Actions dont copy the entire subfolder

I was trying to build my soultion using msbuild and using follow ing workflow
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: ./genshincheat.sln
# Configuration type to build.
# You can convert this to a build matrix if you need coverage of multiple configuration types.
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
BUILD_CONFIGURATION: Release
permissions:
contents: read
jobs:
build:
runs-on: windows-2022
steps:
- uses: actions/checkout#v2
with:
submodules: true
- uses: actions/setup-dotnet#v1
- name: Build
run: dotnet build
- name: Run tests
run: dotnet test
The problem comes when the msbuild command runs :-
Build FAILED.
D:\a\genshin-cheat\genshin-cheat\injector\injector.vcxproj : warning NU1503: Skipping restore for project 'D:\a\genshin-cheat\genshin-cheat\injector\injector.vcxproj'. The project file may be invalid or missing targets required for restore. [D:\a\genshin-cheat\genshin-cheat\genshincheat.sln]
D:\a\genshin-cheat\genshin-cheat\cheat-base\cheat-base.vcxproj : warning NU1503: Skipping restore for project 'D:\a\genshin-cheat\genshin-cheat\cheat-base\cheat-base.vcxproj'. The project file may be invalid or missing targets required for restore. [D:\a\genshin-cheat\genshin-cheat\genshincheat.sln]
D:\a\genshin-cheat\genshin-cheat\cheat-library\cheat-library.vcxproj : warning NU1503: Skipping restore for project 'D:\a\genshin-cheat\genshin-cheat\cheat-library\cheat-library.vcxproj'. The project file may be invalid or missing targets required for restore. [D:\a\genshin-cheat\genshin-cheat\genshincheat.sln]
C:\Program Files\dotnet\sdk\6.0.202\NuGet.targets(130,5): warning : Unable to find a project to restore! [D:\a\genshin-cheat\genshin-cheat\genshincheat.sln]
D:\a\genshin-cheat\genshin-cheat\cheat-base\cheat-base.vcxproj(25,3): error MSB4019: The imported project "D:\Microsoft.Cpp.Default.props" was not found. Confirm that the expression in the Import declaration "\Microsoft.Cpp.Default.props" is correct, and that the file exists on disk.
D:\a\genshin-cheat\genshin-cheat\cheat-library\cheat-library.vcxproj(757,3): error MSB4019: The imported project "D:\Microsoft.Cpp.Default.props" was not found. Confirm that the expression in the Import declaration "\Microsoft.Cpp.Default.props" is correct, and that the file exists on disk.
D:\a\genshin-cheat\genshin-cheat\injector\injector.vcxproj(39,3): error MSB4019: The imported project "D:\Microsoft.Cpp.Default.props" was not found. Confirm that the expression in the Import declaration "\Microsoft.Cpp.Default.props" is correct, and that the file exists on disk.
4 Warning(s)
3 Error(s)
Time Elapsed 00:00:12.01
Error: Process completed with exit code 1.
I suppose this is because of the non - existence of the file mentioned
my repo has a solution file and with it 3 subfolders. in the error "cheat-base\cheat-base.vcxproj(25,3)" was missing so i suppose one of the subfolders i.e. cheat-base isnt being cloned. any solutions?
adding recursive instead of true to subfolder solved this

Understanding npm packages inside github actions

Here is my idea: build a static web page template, over time add .md files to a /posts directory and build a CI job to convert the .md files to html (with the showdownjs/showdown package).
Is there a need to install the package on every push? Seems like a waste, but uploading /node-modules is incorrect as well. Is there a way to install the package once, and let github action just work with it (run the md to html converter on newly added files)?
You have 2 options:
Recommened: Use caching action to cache dependencies for your project - using a hash from package-lock.json as a key to make sure it rebuild when depenendencies has changed:
- name: Cache node modules
uses: actions/cache#v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ hashFiles('**/package-lock.json') }}
- name: Install Dependencies
run: npm install
Push your node_modules to Git repository so it's checkout together with everything else
For optimising a need to run your converted you can use this action:
https://github.com/tj-actions/changed-files/
and detect if any files were modified at certain path

Deployment Failure - Adding submodule issues - Using Netlify

I am trying to deploy my site to Netlify, when I try to trigger deployment, I am getting this error:
1:46:02 PM: Error checking out submodules: fatal: No url found for submodule path 'startbootstrap-grayscale' in .gitmodules
1:46:02 PM: Failing build: Failed to prepare repo
1:46:02 PM: failed during stage 'preparing repo': Error checking out submodules: fatal: No url found for submodule path 'startbootstrap-grayscale' in .gitmodules
My Folder directory is the one I want to deploy and these are the contents within that directory.
LICENSE node_modules
README.md package-lock.json
css package.json
gulpfile.js scss
img startbootstrap-grayscale
index.html vendor
js
As you can see, the error is pointing to the startbootstrap-grayscale directory.
Within that startbootstrap-grayscale directory, everything you see above is within that same directory. (Not sure what I did there to have that happen). If I cd into the 2nd startbootstrap-grayscale directory, there is nothing inside of it.
I was told that I need to git submodule add <my github name> but am not sure what else to add in order to resolve this issue.
git submodule add -f asks for more info:
usage: git submodule [--quiet] add [-b <branch>] [-f|--force] [--name <name>] [--reference <repository>] [--] <repository> [<path>]
or: git submodule [--quiet] status [--cached] [--recursive] [--] [<path>...]
or: git submodule [--quiet] init [--] [<path>...]
or: git submodule [--quiet] deinit [-f|--force] (--all| [--] <path>...)
or: git submodule [--quiet] update [--init] [--remote] [-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--[no-]recommend-shallow] [--reference <repository>] [--recursive] [--] [<path>...]
or: git submodule [--quiet] summary [--cached|--files] [--su mmary-limit <n>] [commit] [--] [<path>...]
or: git submodule [--quiet] foreach [--recursive] <command>
or: git submodule [--quiet] sync [--recursive] [--] [<path>...]
or: git submodule [--quiet] absorbgitdirs [--] [<path>...]
Any suggestions as to what to add in order to fix this issue? Appreciate any help.
I've had a similar issue in different projects a few times before. My solution was usually to decouple the submodule and move the code into my codebase (or using a managed package for this).
To decouple the module go into your submodule folder, delete the .git folder and add the files to your git repository. On the command line I would do it like this:
// going into the submodule - might need to tweaked, depending on the exact path
cd startbootstrap-grayscale
// delete the git submodule
rm -rf .git
// going out of the directory
cd ..
// adding everything to git
git add .
With these steps (and potentially minor tweaks to the paths) I've been able to resolve this issue for me.
I was able to figure it out, I needed to get rid of my startbootstrap-grayscale folder by using rm -r startbootstrap-grayscale and pushing the changes. I had too many nested folders of the same type for some reason.
Completely nuking my git directory and then starting over with a new git commit worked for me. Not ideal but I was trying to get rid of git submodules and it didn't work. Now my site is live! https://connorleech.info/
rm -rf .git
git init
git remote add origin YOUR_URL
git add .
git commit -m 'restart history'
git push origin master

Travis CI deploy JAR to Github master

Refs: http://docs.travis-ci.com/user/deployment/ and http://docs.travis-ci.com/user/deployment/releases/
I'm tring to deploy my JAR file to Github, but I don't want to create a tag every time.
I know it is not the correct behaviour, but I want to do this way if possible.
Building process is running fine, but when I use this travis.yml file:
language: java
deploy:
provider: releases
api-key: "<my_api_key>"
file: "teapot-1.2.5-beta.jar"
skip_cleanup: true
on:
branch: master
I got this error:
Installing deploy dependencies
Fetching: addressable-2.3.6.gem (100%)
Successfully installed addressable-2.3.6
Fetching: multipart-post-2.0.0.gem (100%)
Successfully installed multipart-post-2.0.0
Fetching: faraday-0.9.1.gem (100%)
Successfully installed faraday-0.9.1
Fetching: sawyer-0.6.0.gem (100%)
Successfully installed sawyer-0.6.0
Fetching: octokit-3.7.0.gem (100%)
Successfully installed octokit-3.7.0
5 gems installed
Fetching: mime-types-2.4.3.gem (100%)
Successfully installed mime-types-2.4.3
1 gem installed dpl.2
Preparing deploy
Logged in as Carlos Magno Oliveira de Abreu
Deploying to repo: icemagno/teapot
Current tag is: dpl.3
Deploying application
/home/travis/.rvm/gems/ruby-1.9.3-p551/gems/octokit-3.7.0/lib/octokit/response/raise_error.rb:16:in `on_complete': POST https://api.github.com/repos/icemagno/teapot/releases: 422 - Validation Failed (Octokit::UnprocessableEntity)
Error summary:
resource: Release
code: missing_field
field: tag_name
resource: Release
code: custom
field: tag_name
message: tag_name is not well-formed
resource: Release
code: custom
message: Published releases must have a valid tag // See: https://developer.github.com/v3/repos/releases/#create-a-release
...
failed to deploy
This is the basic deploy config:
language: java
deploy:
provider: releases
api-key: "<my_key_again>"
file: "teapot-1.2.5-beta.jar"
skip_cleanup: true
on:
tags: true
all_branches: true
But I have not created any tag because I don't want to do this for now.
EDIT
I've created a tag, now I need to change .travis.yml file to test some configurations and GitHub is not allowing me to change anything on tag files (ok, must be this way) cr#p !
If I may, I believe what you are looking for is the same as I was.
Basically add something like the following to your .travis.yml:
before_deploy:
- git config --global user.email "builds#travis-ci.com"
- git config --global user.name "Travis CI"
- export GIT_TAG=$TRAVIS_BRANCH-v0.1.$TRAVIS_BUILD_NUMBER
- git tag $GIT_TAG -a -m "Generated tag from TravisCI for build $TRAVIS_BUILD_NUMBER"
- git push -q https://<your-api-key>#github.com/<your_name>/<project_name> --tags
deploy:
skip_cleanup: true
provider: releases
api_key:
secure: [redacted]
file:
- "your_file"
on:
tags: false
all_branches: true
branches:
except:
- /^*-v[0-9]/
Careful doing this though, as messing up while working with these particular config options might lead to an infinite Travis-CI build loop, which will pollute your build and tag history, and not be easy to cleanup.

How can I deploy updates to an OpenShift Mono application with Jenkins?

I created a mono application on OpenShift using the community cartridge here.
Now, I'm reading about how to set up continuous builds via jenkins here.
The default mono application doesn't seem to come with any of the necessary scripts for building, restoring NuGet packages, etc. Instead, the git repo seems to have the DLL binaries in it, which doesn't seem sustainable.
What's the best approach for deploying mono on open shift?
I will refine this answer when/if I get it working...
Did you start by clicking the "Continuous Integration - Enable Jenkins" link below your cartridge on your OpenShift Applications page?
Once I did this, my git push output changed from:
remote: CLIENT_MESSAGE: Stopping Apache+mod_mono HTTPD server
remote: Waiting for stop to finish
remote: Waiting for stop to finish
remote: Stopping Postgres cartridge
remote: Building git ref 'master', commit 8da79f2
remote: Preparing build for deployment
remote: Deployment id is 05e8d1d8
remote: Activating deployment
remote: Starting Postgres cartridge
remote: Postgres started
remote: CLIENT_MESSAGE: Starting Apache+mod_mono HTTPD server
remote: -------------------------
remote: Git Post-Receive Result: success
remote: Activation status: success
remote: Deployment completed with status: success
To:
remote: Executing Jenkins build.
remote:
remote: You can track your build at https://jenkins-[you].rhcloud.com/job/mono-build
remote:
remote: Waiting for build to schedule...........Done
remote: Waiting for job to complete...............Done
remote: SUCCESS
remote: New build has been deployed.
remote: -------------------------
remote: Git Post-Receive Result: success
remote: Deployment completed with status: success
But if I remove the bin directory from my source code, then the web site no longer works, even though the build "succeeds." So clearly it is only just blindly copying the files out of git.
So next I did a Update-Package -reinstall -ProjectName OpenShift in the Package Manager console, then right-clicked on the solution and chose "Enable NuGet package restore," and committed/pushed those changes.
In the Jeninks manager I went to Configure the build and added xbuild OpenShift.sln after the gear build line in the "Execute shell" area.
Now it actually tries to do a real build, which fails with the error:
+ xbuild OpenShift.sln
XBuild Engine Version 3.0.7.0
Mono, Version 3.0.7.0
Copyright (C) Marek Sieradzki 2005-2008, Novell 2008-2011.
Build started 01/13/2015 20:56:29.
__________________________________________________
/var/lib/openshift/[my ID]/app-root/runtime/repo/OpenShift.sln: warning : /var/lib/openshift/[my ID]/app-root/runtime/repo/OpenShift.csproj: /var/lib/openshift/[my ID]/mono/mono/lib/mono/xbuild/Microsoft/VisualStudio/v10.0/WebApplications/Microsoft.WebApplication.targets: Project file could not be imported, it was being imported by /var/lib/openshift/[my ID]/app-root/runtime/repo/OpenShift.csproj: Access to the path "/var" is denied.
Project "/var/lib/openshift/[my ID]/app-root/runtime/repo/OpenShift.sln" (default target(s)):
Target ValidateSolutionConfiguration:
Building solution configuration "Debug|Any CPU".
Target Build:
/var/lib/openshift/[my ID]/app-root/runtime/repo/OpenShift.csproj: error : /var/lib/openshift/[my ID]/app-root/runtime/repo/OpenShift.csproj: /var/lib/openshift/[my ID]/mono/mono/lib/mono/xbuild/Microsoft/VisualStudio/v10.0/WebApplications/Microsoft.WebApplication.targets: Project file could not be imported, it was being imported by /var/lib/openshift/[my ID]/app-root/runtime/repo/OpenShift.csproj: Access to the path "/var" is denied.
Task "MSBuild" execution -- FAILED
Done building target "Build" in project "/var/lib/openshift/[my ID]/app-root/runtime/repo/OpenShift.sln".-- FAILED
Done building project "/var/lib/openshift/[my ID]/app-root/runtime/repo/OpenShift.sln".-- FAILED
Build FAILED.
Looks like it might be this problem so I made the following manual diff to OpenShift.csproj:
- <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
- <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
+ <Import Project="$(SolutionDir)\MSBuild\Microsoft\VisualStudio\v12.0\WebApplications\Microsoft.WebApplication.targets" />
and copied from Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\WebApplications into the above path in my local project.
After committing/pushing that, now I get this new build error:
Project "/var/lib/openshift/[my id]/app-root/runtime/repo/OpenShift.sln" (default target(s)):
Target ValidateSolutionConfiguration:
Building solution configuration "Debug|Any CPU".
Target Build:
Project "/var/lib/openshift/54b5dc8efcf933bb7300001f/app-root/runtime/repo/OpenShift.csproj" (default target(s)):
Target RestorePackages:
Executing: mono --runtime=v4.0.30319 "/var/lib/openshift/[my id]/app-root/runtime/repo/.nuget/NuGet.exe" install "/var/lib/openshift/[my id]/app-root/runtime/repo/packages.config" -source "" -RequireConsent -solutionDir "/var/lib/openshift/[my id]/app-root/runtime/repo/"
Cannot open assembly '/var/lib/openshift/[my id]/app-root/runtime/repo/.nuget/NuGet.exe': File does not contain a valid CIL image.
Looks like there's a problem running NuGet.exe - Might be this