Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,556,324
Community Members
 
Community Events
184
Community Groups

I am trying to hose a website using bitbucket that is built through Hugo

Edited

My pipeline succeeds but I when I go to my website url, ir only shows a message saying "repository not available"

 

not sure what the issue is here but  shown below is my .yml file for the pipeline. fyi: running locally with Hugo does produce a website correctly, the issue is when hosting through bitbucket

here is my .yml file for reference:

 

image: klakegg/hugo:0.101.0-ext-ubuntu-onbuild

pipelines:
branches:
hugo:
- step:
script:
# Change working directory to 'hugo-src', a subfolder of root of the current branch (hugo).
- cd "${BITBUCKET_CLONE_DIR}"

# Update/Initialise any submodules in the current branch.
# This will clone the submodule contents into their directories within the pipeline environment.
- git submodule update --init --recursive

# Clone the master branch into the 'public' directory.
# This will enable updates to the master branch; namely the Hugo-generated output.
#- git clone -b main ssh://git@bitbucket.org/himanshu106/himanshudave.bitbucket.io public

# Remove the entire contents of the master branch.
# This ensures that any content that was deleted during the latest commit (hugo branch) is also purged.
#- rm -rf ./public/*

# Remove the '.git' file under any theme submodules.
# This is necessary to ensure that submodule files are also pushed to the master branch.
# Without this step, the Hugo build will fail to generate index.html, and other mandatory files.
#- rm -rf ./themes/*/.git

# Build the Hugo website in the 'public' directory.
- hugo version --verbose
- hugo --baseURL "https://himanshudave.bitbucket.io" --destination public --verbose
- ls -al ./public
# 'Minify' the build (optimize file sizes to improve load times)
#- minify -r -o ./public ./public

# Push the build output to the master branch.
# Authentication is achieved through SSH key generation (pipeline settings) and exchange (Bitbucket account settings).
- git config --global user.email "<email_removed>"
- git config --global user.name "<username_removed>"
- cd public && git status && git add . && git commit -m "Generated from $BITBUCKET_COMMIT" && git push

- echo "Finished!"

 

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Nov 11, 2022

Hi @hdave1 and welcome to the community.

If you want to host a static website on Bitbucket Cloud, the name of the repository with the website must be the same as the workspace id of the workspace that owns the repo. Please have a look at the following documentation:

In your yml file you reference himanshu106/himanshudave.bitbucket.io

If the workspace id is himanshu106, then the repo name needs to be himanshu106.bitbucket.io instead of himanshudave.bitbucket.io

You can always change the workspace-id and in turn the repo name, if the workspace id you want to use is available.

The repository also needs to have a file called index.html in the root directory, in lowercase letters. I'm not sure if your repo already has that, if not, you will need to add it.

If you have any questions, please feel free to let me know.

Just a heads up, I removed the email and username from your post to comply with our privacy policy.

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events