I read the documentation about Action Hook Scripts for OpenShift and created a pre_build action hook with the following commands on my OpenShift gear:
rhc ssh jbosswildfly
cd $OPENSHIFT_REPO_DIR/.openshift/action_hooks
touch pre_build
chmod a+x pre_build
Afterwards I created the pre_build file in the Git repository of my OpenShift application and pushed it to the repo. My deployments to OpenShift are performed by Travis CI and I got the following response:
remote: NOTE: The .openshift/action_hooks/pre_build hook is not executable, to make it executable:
remote: On Windows run: git update-index --chmod=+x .openshift/action_hooks/pre_build
remote: On Linux/OSX run: chmod +x .openshift/action_hooks/pre_build
So I executed git update-index --chmod=+x .openshift/action_hooks/pre_build (because I am running on Windows) and pushed that pre_build file again to my remote Git repository.
Now I get the following message:
remote: No such file or directory - /var/lib/openshift/54e8f8984382ecc9a1000047/app-root/runtime/repo/.openshift/action_hooks/pre_build
Why does it tell me now that it cannot find the pre_build file? If I login (via SSH) to my OpenShift gear, then it's there:
This is my pre_build file:
#!/bin/bash
echo Hello World
Related
I am running the command
podman machine init
in the /entrypoint.sh script which I reference in my Dockerfile:
# Container image that runs your code
FROM ubuntu:latest
# Copies your code file from your action repository to the filesystem path `/` of the container
COPY entrypoint.sh /entrypoint.sh
RUN apt-get update -y
RUN apt-get install -y git gcc python3-dev musl-dev libffi-dev podman
# Code file to execute when the docker container starts up (`entrypoint.sh`)
ENTRYPOINT ["/entrypoint.sh"]
The Dockerfile and the entrypoint.sh scripts are in my github repo where I have github actions configured. The problem I see my my log output from the Github action is this ...
2022-11-29T04:56:58.6855699Z + podman machine init
2022-11-29T04:56:59.1867174Z Downloading VM image: fedora-coreos-37.20221106.2.1-qemu.x8…
2022-11-29T04:56:59.3660034Z [1A[JDownloading VM image: fedora-coreos-37.20221106.2.1-qemu.x8…
...
2022-11-29T04:57:06.5082410Z [1A[JDownloading VM image: fedora-coreos-37.20221106.2.1-qemu.x8…
2022-11-29T04:57:06.9133659Z Extracting compressed file
2022-11-29T04:57:36.0586753Z Error: exit status 1
Extracting compressed file? Did I run out of disk space? What? I am not even sure where to begin to debug this.
I'm trying to pull code with gitlab-runner with a shell executor.
$ git pull origin master
error: cannot open .git/FETCH_HEAD: Permission denied
ERROR: Job failed: exit status 1
git status seems to work fine but when I try git fetch
$ git fetch
error: cannot open .git/FETCH_HEAD: Permission denied
ERROR: Job failed: exit status 1
This could be because you did not add a deploy key for your gitlab-runner user in your gitlab project, so the runner user does not have access to your gitlab repository.
You should follow theses steps to create the keypair for gitlab-runner user (the shell executor user) https://docs.gitlab.com/ee/ci/ssh_keys/#ssh-keys-when-using-the-shell-executor
Then copy the created public key in /home/gitlab-runner/.ssh/id_rsa.pub
And add it to your gitlab project's deploy key :
Go to you gitlab project
Settings => Repository
Deploy keys
Add a title, past the public key and click "Add key"
Trigger you CI again and the shell executor runner should be able to pull the repository.
I just solved this problem by running this command
sudo chown -R $(whoami) .git/ in my project directory.
You can change $(whoami) to the username of your server. For example sudo chown -R gitlab-runner .git/
Changing the permissions helped!
sudo chown -R .git/
I try to install OpenFaaS on OpenShift.
What I do :
I clone "https://github.com/openfaas/faas-netes"
I build the dockerfile. (docker build .)
I tag and push the image on my docker hub repository
In Openshift, I deploy this image and I create a route. But the route does not run... I try kubectl in pod terminal but command does not exist.
Any ideas?
I have a PHP application with MySQL, which is the root directory to deploy the files ($ git clone "git_url" "directory_to_create")? Thanks.
When I enter throw putty I see these directories:
app-deployments
app-root
git
mysql
php
My Jenkins server has stopped being able to build a maven project hosted at bitbucket.org. The build works locally but Jenkins reports this error:
[workspace] $ hg incoming --quiet --bundle hg.bundle --template "<changeset node='{node}' author='{author|xmlescape}' rev='{rev}' date='{date}'><msg>{desc|xmlescape}</msg><added>{file_adds|stringify|xmlescape}</added><deleted>{file_dels|stringify|xmlescape}</deleted><files>{files|stringify|xmlescape}</files><parents>{parents}</parents></changeset>\n" --rev default
abort: no suitable response from remote hg!
ERROR: Failed to determine incoming changes
[workspace] $ hg log --rev . --template {node}
Any ideas what's going on?
[edit]
So, I ran hg paths and got a response that the tomcat user was untrusted:
Not trusting file /usr/local/tomcat/.jenkins/jobs/Test/workspace/.hg/hgrc from untrusted user tomcat, group tomcat
After running hg incoming as the tomcat user
cd /usr/local/tomcat/.jenkins/jobs/Test/workspace
sudo -u tomcat hg incoming
I got an error saying the permissions on my ssh key were too open:
remote: ###########################################################
remote: # WARNING: UNPROTECTED PRIVATE KEY FILE! #
remote: ###########################################################
remote: Permissions 0620 for '/usr/local/tomcat/.ssh/id_rsa' are too open.
remote: It is recommended that your private key files are NOT accessible by others.
remote: This private key will be ignored.
remote: bad permissions: ignore key: /usr/local/tomcat/.ssh/id_rsa
remote: Permission denied (publickey).
abort: no suitable response from remote hg!
and thanks to this SO question
I set the permissions and now Jenkins can successfully build.
Since your hg incoming is based on whatever your 'default' path is in the repository's hgrc (use hg paths to see them, or open the file), maybe you should make sure the address of the remote repository is still correct and that the project is still accessible.