By default, jobs in later stages automatically download all the artifacts created by jobs in earlier stages. You can control artifact download behavior in jobs with dependencies.
So, if your deployment job does not have any dependencies or needs, it will just download the artifacts from the build stage, whether the create-admin-server job has run, or the connect job.
I think your best bet might be to create an artifact in your build stage, then have your deployment jobs check that the artifact exists, and halt if not.
Also, as part of pipeline, we are sending a ssh pem file content as variable and writing that to a file and connecitng to ec2 instance from that.
It seems, pipeline missing the formatting and remvoing all the line endings and replacing with spaces, any script/commadns to fix the formatting for it?
For your PEM file, if you are storing that in the CI/CD variables in your project settings, I would make sure that you use a File type variable, rather than a Variable type.
If you are generating the PEM file within the pipeline, or getting it from somewhere else, it’s worth remembering that your .gitlab-ci.yml file is really just a set of Bash commands with some metadata. So, whatever ssh or Bash would normally do with the whitespace in your file, will happen in your pipeline. You may well need to use a bit of sed or similar to sort out your line endings, but hopefully this is something you can reproduce locally.
When you go to https://gitlab.com/GROUP/PROJECT/-/settings/ci_cd and expand the Variables section, once you click on the Add variable button you will see a dialog box. There is a drop-down with the label Type where you can select File rather than Variable.
Perhaps my answer wasn’t very clear, but there isn’t a way to specify an “or” relationship with either needs or dependencies, the arrays are always “and”-ed together.
yes I got that, but when you select the file, you don’t have option to upload any file as part of that, only value field is there which accepts only text
I replaced the above one with the token I generated to the pipeline jobs from api.
But, it is failing to download, same token is able to trigger the pipeline jobs.
How to fix that?
Also, any option to run the manual steps of previous pipelines using api?
It’s hard to tell what the problem might be, from you have posted, but I would start by checking that your PAT token has the correct permissions. Also, I presume gitlab.example.com is just from the docs, but that will need to be your on-prem URL.