Openshift github status result - openshift

I've managed to get openshift to download my github commits and fire on a webhook without issue. What I'd love to be able to do though is make use of the Github Status API to be able to mark builds as good or bad.
Has anyone had any success in doing this? If so how do you do it? I was thinking of doing it via the postBuild hook in openshift however I don't think I have access to the SHA nor would I be albe to post on failure.

The OPENSHIFT_BUILD_COMMIT environment variable, along with a few others, will be set in the image and provide details about the remote repo used.
https://docs.openshift.org/3.9/dev_guide/builds/build_output.html#output-image-environment-variables
You should be able to see those from the hook you run in the image as part of the postCommit hook.

Related

Update a github repository secret from a github action

I have a website fetching the facebook events of one of my webpage thanks to a ruby script.
The script is executed within a github action before the build.
Unfortunately, the facebook token has a limited validity. I managed to find a way to renew it but I'm wondering if it is possible to update my FACEBOOK_TOKEN repository secret from a Github action ?
Of course I'm open to alternative like finding a way to have a permanent token!

pull api, create file, push to netlify with Gitlab CI

So I have a Gitlab CI that will, currently, queue up every Monday at 6am and run. All it does is push a build command to Netlify using a build hook.
My current set up is Gitlab for VC, Netlify for deployment, HUGO as my static site generator.
No problem.
Here's what I'm trying to do: I have access to an API that shows me all of the items on a particular website (podcast) as JSON.
I want to write a Gitlab CI that will fetch the API, grab the newest thing, and then create a new page with hugo new content/{title}.md, and fill that file's front matter with something from the JSON object.
I'm not even sure this is possible, or that this is the best route to go.
But basically, every time I upload a new podcast, I want Gitlab and Netlify to rebuild my website with a dedicated page for that episode.
The easiest route is to parse the JSON with javascript and NOT create a seperate page, but I guess you figured that out already.
The way you describe is also possible. Any server-side script can fetch the API and run the hugo new command (as long as it is on the same/deployment server). I would do it in PHP on my server, but I am kind of old-fashioned. Gitlab CI can probably do this too, but I have never tried it.
You did not really ask a question, but did I answer it anyway?

Why does my AWS Codestar application endpoint not show code changes?

I made my first Codestar project with the web service template for node and lambda.
I pushed code changes and all 3 steps finished green. I even checked Pipeline and the comment from my latest code push showed there. However, when I click on my endpoint in my dashboard (it ends in /Prod), it shows as if nothing happened. I'm still seeing the Hello World output from the project's original code.
Just as a guess, I clicked Release Change after this, and still no change.
It's been hours since I made the change. I am new and totally stumped.
Also, when I use AWS SAM to start a local endpoint, everything works perfectly. My newest changes appear, and all is good.
Why does my AWS Codestar application endpoint not show code changes?
It sounds like it could be that the api is not being deployed. Whenever you make a change to Apigateway you have to re-deploy the api. Codestar should be doing that. You can go to the api itself in Apigateway and take a look at 'Stage'. There the deployed api url is shown.
Also, make sure your browser isn't caching the url.

Using Github login with a Django project

I'm working on making a site that allows login with Github and I'm using Django for this. I've gotten as far as redirecting the user to the github authorization page, and then redirecting the user to another part of my project after successful authorization. My question is then: How do i extract such things as the users username and other values? I imagine that a JSON object is sent to me, but how do I use it and where do I get it? I have never done anything like this before, so it might be obvious but if anyone could help me it would be appreciated. Bear in mind that I'm a newbie in Django.
Github login is just OAuth. There is full documentation on Github's dev site on how to do it manually, but you probably want to use one of the many Python libraries which make the process easier such as python-social-auth or django-allauth.
Check out:
https://developer.github.com/guides/basics-of-authentication/
But there is package with this functionality:
python-social-auth

How can i share a wirecloud marketplace between users

I built some widgets and uploaded on my local marketplace, is there a way to share that?
And better is it possible to share a Mashup (the widget composition) without giving the
possibility to wiring to the user?
I mean the user should use an application layout without change anything.
You can make public your workspaces/dashboards following the steps documented in the user guide. Only the owner of a workspace will be able to modify it. I think this is what are you searching for.
Another option is to create a packaged mashup using the "Upload to my resources" option in the editor view:
Take a look to the "Advanced" tab, where you can block widgets (make them unremovable), block connections (make wiring connections unremovable) and embed used widgets/operator (by default packaged mashups depends on the user having installed all the required widgets/operators. This way you can distribute the widgets and operators used by the mashup in the same package).
However, take into account that this method is meant for sharing mashup templates, the user will always be able to add additional widgets and create new connections in the wiring view.
Once packaged, mashups/dashboards (and widgets and operators) can be uploaded to a WStore server (e.g. to the Store portal provided on FIWARE Lab) for sharing them with other users. The steps for making this is also described in the WireCloud's user guide.
I have the problem, revisited.
I have set up a working Marketplace instance (v2.3) but am unable to integrate it with Wirecloud. The marketplace is correctly registered but all the requests i am making to this Marketplace are throwing 502 error, even though i am actually able to see some results when querying the Marketplace server through a browser.
Indicatively, i can issue a GET command at http://:8080/FiwareMarketplace/v1/registration/stores/ and get an answer, but Wirecloud's internal APIs return a 502 (Bad Gateway).
Any idea on what might have gone wrong?
PS: This happens for WC v0.6.5. When upgrading to a newer (Beta) version of WC, everything seems to be performing as expected, i.e. the marketplace is correctly inserted and the stores are correctly retrieved and processed.