Spinnaker configuration loaded as code from gitlab - spinnaker

It is really good that we have spinnaker pipeline as a code from roer and other tools. But is there a way that we will store these pipelines and as well as configurations on gitlab and restore by just fetching the files from gitlab? without really manually inserting the configurations?

You can use "Save Pipelines" stage.
See related commit for details.

Related

In the gitlab-runner, How can I keep the build/?

When I start a new pipeline, I don't want to repeat make the directory build/. But the gitlab-runner always remove the build/. How can i keep the build/ ?
Thanks:)
Use a cache: https://docs.gitlab.com/ee/ci/caching/
From the docs:
Use cache for dependencies, like packages you download from the internet. Cache is stored where GitLab Runner is installed and uploaded to S3 if distributed cache is enabled.

JavaScript GitHub Action running on windows-latest to upload directory or file into S3

With runs-on: ubuntu-latest, I quickly found a marketplace Docker action to upload a generated directory into S3 and setup a perfectly working pipeline.
But I need to do the same with runs-on: windows-latest, where Docker actions no longer work.
Tried the other available alternative, to build aJavaScript action. But after testing several different npm packages I did not succeed.
I would like also the action to be as much as possible self contained in the .yml file (of course accessing the needed GitHub Secrets for AWS key, id, bucket..).
Anybody has already encountered the same problem and can point me to a possible solution?
Thank you in advance.
Check out stcalica/s3-upload action. It is written in JavaScript and it seems it does the work that you need.

Where can read about available commands i can use as a script in my gitlab CI yml file?

Basically, i'm getting started with gitlab's continuous integration, but having a hard time looking for a guide or documentation that would help me write scripts for the file.
Where can i read about operators, conditionals and instructions i can use for this?
Thanks!
First of all read the Quick start
Here is everything about yml file: Configuration of your jobs with .gitlab-ci.yml
I can recommend to use CI lint which can validates your yml syntax. It can saves your time ;-)

committing to repository as part of CI build

I have a CI pipeline that is likely doing something semi-perverted. Let's not debate that part.
As part of the CI, I will generate an artifact (README.md) which I would like to commit and push back to the same repository. Simply using git push origin ... doesn't work due to authentication error.
Am I constrained to using something like a secret variable and a token, and adding another remote so that it can push?
There are ways to add a ssh token to your build runtime which is able to commit or even do a push to origin.
I think even recently GitLab added a new functionality that for each build a unique token is generated which can be used for same sake.
However in general I dont think you can commit anything on the same git base that build is running on, as the check out is in a detached head mode. This means you will not be able to add to history, specially in a remote.
Next problem to consider is what this means if you were able to commit back for the build system, which can potentially trigger another build and a cycle will be triggered.
So probably either use the artifact system for it or do add the ssh token and clone/checkout/commit/push in a separate directory during the build. Anyway this doc explains how to add the token: https://docs.gitlab.com/ee/ci/ssh_keys/README.html
Gitlab seems to change .git folder after fetching project for CI job. I'm not sure it changes only remote section. So I found only solution is to add gitlab-runner user with sshkeys to gitlab. And in my job make git clone in separate folder, make changes, then commit and push it.

How to restrict runners to a specific branch and lock the .gitlab-ci.yml from changes?

Right now, anyone that creates a branch in my project and adds a .gitlab-ci.yml file to it, can execute commands on my server using the runner. How can I make it so that only masters or owners can upload CI config files and make changes to them?
I'm using https://gitlab.com/gitlab-org/gitlab-ci-multi-runner running on bash.
The GitLab runner wasn't really designed for this scenario and thus you are unable to do this. What you could do instead is have a new project with just your .gitlab-ci.yml file and configure it so that it pulls the original repository. From there you can do all the other things you want to do with your repository.