How To Use Shopify CLI In GitLab CI/CD Integration - gitlab

Good day everyone!
I'm very new to Shopify & GitLab platforms and I don't exactly know how to properly integrate the new Shopify CLI with the GitLab CI/CD pipeline.
My goal is when I push the changes from my local theme development to GitLab, the CI/CD pipeline runs and it'll automatically update the Shopify Theme online. Similar to Shopify GitHub integration.
From a number of days of searching, I've only been able to find a single solution to this:
https://medium.com/#gogl.alex/how-to-deploy-shopify-themes-automatically-1ac17ee1229c
and a community discussion about this:
https://community.shopify.com/c/technical-q-a/development-setup-with-gitlab/m-p/1243584
But the problem is this solution is still using the Shopify Theme Kit and not the new Shopify CLI.
I would like to ask if someone has already done this in the community and ask if they don't mind sharing the solution in this discussion.
Thank you for reading, any advice/s and/or solutions would be very helpful!

Related

how to Create a secure CI/CD pipeline using cloud build and GitHub following DevSecOps?

my ideal case is to build a secure CI/CD pipeline using cloud build applying SAST and other security test in order to prevent the developer to deploy code that has a smell or have any vulnerabilities
I currently using Github as my version control platform and hosting my app on google cloud
and with the help of google cloud build i did build a CI/CD pipeline to deploy my app each time we have an update , the current flow is whenever create a pull request in one of the main branches that reflects our environments prod/staging/dev a check status is triggered which is cloud build CI/CD.
the pipeline currently just build, scan and then push the image also starting the managed insatnce group update but its now my focus for this question, i am trying to follow the secure methodologies for DevSecOps by applying some security tests in the early stages like SAST,SCA and image scanning
so the issue is that google does not have the full ecosystem currently and no clear path for DevSecOps using cloud build as the Ci tool for such as what third party tools to integrate with in order to fill the gaps? this was the only clear path i did found until now https://cloud.google.com/blog/products/devops-sre/devsecops-and-cicd-using-google-cloud-built-in-services a blog to follow but not answering all the questions
what i have achieved until now is applying an IDE SAST tool like sonarlint also i found snyk
Although i mainly focused on the free tools as a start in order to test because as i said no clear integrations with cloud build is out there except for snyk.io i did found an integration with cloud build but its even not a native support yet
the reason for using cloud build not github actions that i don't want to store any service account key outside our project because it will be a general behavior in my company and its a more safer to keep our keys inside , so i need some ideas what tools i can integrate with cloud build in order to achieve that and how to apply it and is there a way to use github actions and cloud build at the same time while orchestrating the pull request check status order ? for example check the source code before start building the docker image

Continous deployement to server

I'm building a personal blog website with express.I hosted it on ec2 and also hosted another version at digital ocean .But when it comes to updating my code (like i am changing a few lines or adding or removing a new feature) i have to remove all the files and re-upload and again run it.When i was using www.heroku.com it was easy like git push heroku master.How can i do similar with ec2 or digital ocean server?.(I'm using pem file to login to server)
I recommend looking at Code Pipeline tutorials. You can use this AWS Service to build a CI/CD use case. See:
CodePipeline tutorials
As SMAC mentioned in the comments, you're looking for a CI/CD solution essentially. Heroku does a nice job of automating that for you, as do several other products out in the market. Depending on what Git provider you're using, GitHub and GitLab both provide a native solution (GitHub actions vs GitLab CI).
I'd recommend you combine that with something like AWS's ElasticBeanstalk to get a simple change/push workflow like you're looking for.

Themes in Orchard hosted in Azure

I've been setting up Orchard 1.8 in an Azure Cloud Service. I've got it working, but I'm now confused as to how to use it.
Installing themes via the gallery fails silently. The devs say this is because Orchard on Azure doesn't support the theme gallery, and suggest adding new themes to the project and uploading a new package (https://orchard.codeplex.com/discussions/453688). Ignoring that this requires any designers that want to make minor CSS changes now need Visual Studio, access to the entire source code, and then wait through a 20 minute deploy, this just doesn't seem possible.
This post explains how the Azure emulator doesn't work with Orchard. So now I'm confused; what is the expected workflow for a brand new Orchard site hosted on Azure if I can't make changes to the site in production or staging but cannot run it locally either. I'm aware I could run it without the Azure emulator on regular IIS but that seems to be too far removed from the production environment to be a good test.
I was drawn to Orchard originally because it had great documentation and supports MVC Web API, but this seems so fundamental that now I'm not so sure. I feel like every time something goes wrong they'll always be doubt whether it's working as designed or if there is an Azure idiosyncrasy going on.
I'd love to hear from anyone who's had an Orchard site from scratch in Azure, I'm hoping I've just missed something simple with this.
Thanks,
Tom
You should never install modules or themes on a production server. Instead, install those on your dev machine, build the package and then deploy. If you don't want to deal with the heaviness of cloud services, don't use cloud services. Azure Web Sites are about a million times easier to use, and they work great. They allow for what you're asking for.

Is there a Plunkr-like Web site for node.js applications?

I need to post some node, express, mongoose code online as demo for a StackOverflow discussion. Plunkr does not accept node emulation afaik. Any ideas where to host a demo app with live editor of the code?
You can use http://jsapp.us/ to run sample node code.
I am not familiar with Plunkr sorry but judging from the design goals that are on their front page you can user Heroku to achieve similar results (albeit in a slightly different way).
It's really easy, have a free option, and you push via git repository, so it is a no brainer to upload your code iterations to your instance, just commit and push your changes to whatever repository you use.

how to use web hooks on Buildbot (gitlab integration)

I am quite curious to know how do you actually use the buildbot when you have a repo on gitlab.
From what I understand, there is no way to upload the py files, which are triggered by the post-commit hook, so I am not exactly clear how do you tell gitlab to send the changes in the codebase to the buildbot, and how the buildbot knows about these changes sent.
We are planning to switch soon to gitlab, and I am looking ahead to avoid to get stuck when the real fun will begin.
Does anyone have any pointer about the integration and communication between Gitlab and Buildbot?
The info on the official documentation of Buildbot is not really clear; I have read about web hooks but I am not really getting how they work.
There is a Gitlab Hook
They've added a Gitlab Hook. You can use it the same way as the Github one.
The GitLab hook is as simple as GitHub one and it also takes no
options.
c['www'] = dict(...,
change_hook_dialects={ 'gitlab' : True }
)
The main issue is the incompatibility of the github module for Buildbot; once the Gitlab will make possible to have either Gitlab or Github hooks, it will work without problems.
http://feedback.gitlab.com/forums/176466-general/suggestions/3787958-web-hooks-data-posts-should-be-github-compatible
Hope that this will help people looking for info, so they avoid to bang their head on the wall in search of an answer :)

Resources