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?
Related
We would like to adopt GitBook to create our documentation, and integrate it with our GitLab repo. I understand the integration is bi-directional, but I want to find out whether, when we update GitBook, the new information is pushed to our Gitlab repo automatically or we first get a merge request.
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.
I'm trying to write a program for myself using Spotify's api. I have no intention of my software being public, I just need access to my own playlist data. The issue is, in order to actually get this information, I need to go through Spotify's authentication process. Part of this process is a redirect URL which it sends you back to once you've logged on. The issue is, I don't actually have my code/site online, its just on my local file system. How can I open up an html file on my local filesystem using spotify's redirect url?
Note:
I tried entering a path like I would for a cmd run command such as C://Users/Me/file.html but this did not appear to work.
I'm not sure about how Spotify's API works, but there are two options that I see.
For the url, you could use file:///my-path but this might not work
Use a localhost url. An easy way to do this is python's python -m SimpleHTTPServer.
According to Spotify api you can start a server by using nodejs and assigning http://localhost:8888/callback in the white-list of the api.developer portal
remember to save after you have added it to the white list
I have some data for a webapp that I would like to store on the server. What would be a good location to put those files?
I have a couple of static HTML pages that contain instance specific information. They need to survive a re-deploy of the webapp. They need to be editable by the server's administrator. They are included in other HTML pages using the html object tag.
I want to store preferences on the server, but cannot use a database. I am using JSP to write and read the preferences. There is no sensitive data in the preferences. Currently I am using the log directory. But obviously that is not a great choice.
I am using Tomcat. I thought of creating an appdata/myapp directory under the webapp directory. Is that good or bad?
If the server's administrator can also deploy the app, I would add the data file itself into the source control for the app, and deploy it all together. This way you get revision control of the data, and you get the ability to revert to known good data if the server fails.
If the administrator can't deploy the app, but can only edit the file, then you need plans to back up that file in the case that the server or server filesystem dies.
A third solution would be a hybrid: put the app in one source code repository. Put the data in a second source code repository. The administrator can edit the data and deploy the data. The developer can edit the app source code, and deploy the source code. This way, both are revision controlled, but you've separated responsibility for who maintains what.
i have been going around in circles here and have totally confused myself. I need some help.
I am (trying to) writing an application for a client that in concept is simple. he want a google write document with a button. the google drive account has several folders, each shared with several people. when he drops a new file in one of the folders, he wants to be able to open this write file, this file is the template for his email. he clicks the button, the system calls the changes service in the Google Drive SDK https://developers.google.com/drive/manage-changes, gets the list of files that have been added since the last time it was checked, then pull the list of people that the file has been shared with, and use the write file as a template to send that list of people an email saying their file is ready.
SO, easy enough, right?
I started by looking at the built in functions in the Google App Script API. I found this method, https://developers.google.com/apps-script/class_docslist#find in the DocsList class. problem is the description for the query simply says "the query string". So at first i tried the Drive SDK query parameters, which are
var files = DocsList.find("modifiedDate > 2012-12-20T12:00:00-08:00.");
it didn't work. that leads me to believe it is a simple full text search on the content. Thats not good enough.
That lead me into trying to call a Drive SDK method from within an App Script application. Great, we need an OLap 2 authentication. easy enough. found the objects in the script reference and hit my wall.
Client ID and Client Secret.
you see, when i create what this really is, a service account, the olap control in apps script doesn't know how to handle the encrypted json and pass it back and forth. Then when i tried to create and use an installed applications key, i get authentication errors because the controls again, don't know what to do with the workflow. and finally, when i try to create a web app key, i can't because i don't have the site host name or redirect URI. And i can't use the application key ability because since im working with files OLap 2 is required.
i used the anonymous olap for a while, but hit the limit of anonymous calls per day in the effort of trying to figure out the code a bit, thats not going to work because the guy is going to be pushing this button constantly thru the day.
i have been pounding my head on the desk over this for 5 hours now. i need some help here, can anyone give me a direction to go?
PS, yes, i know i can use the database controls and load the entire list of files into memory and compare it to the list of files in the database. problem being, we are talking tens of thousands of files. bad idea.
I wouldn't use DocsList anymore - DriveApp is supposed to be a more reliable replacement. Some of the commands have changed, so instead of find, use searchFiles. This should work more effectively (they even use a query like yours as an example).