JavaScript GitHub Action running on windows-latest to upload directory or file into S3 - amazon-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.

Related

How to manually upload baseline screenshots in Percy for base branch

I am currently working on a react-native application and want to use Percy, a visual testing service to catch UI changes in my app.
I don't go the storybook way.
Currently, we use detox for testing, it generates screenshots artifacts which we directly upload to Percy.
But the test comparison always fails right now because we don't have corresponding baseline snapshots for the base branch, develop.
So, I want to be able to upload those baseline snapshots for the default branch manually and change them when I want.
I need help with that.
I have already checked the #percy/cli docs, I only see a way to upload manually but I don't see how to do it for the base branch.
Thanks
You can use PERCY_BRANCH to change the builds git branch and run a build to upload a set of screenshots you'd like to use for a baseline. https://docs.percy.io/docs/environment-variables#optional Something like:
PERCY_BRANCH="your-baseline-branch-name-here" npx percy upload ./screenshots (or whatever the CLI command you're running -- if it's the CLI the PERCY_BRANCH env var will work)

Does gitlab-ci have a way to download a script and store it on the local file system so it could be run?

Does gitlab-ci have a way to download a script and store it on the local file system so it could be run? Looks like other's have asked similar questions (see below).
One way to do it would be to use curl (but curl has to exist in the CI runner):
curl -o ./myscript -k https://example.com/myscript.sh
This was from https://stackoverflow.com/a/22800194/3281336.
If I have a script that I would like to use in multiple CI-pipelines, I'd like to have a way to download the script to the local file system to use in the pipeline. NOTE: I don't have the ability to create a custom runner or docker image in my given situation.
If the script were available via git or an https website, what are my alternatives?
Some search results
https://docs.gitlab.com/ee/ci/yaml/includes.html - Gitlab supports a way to include files, even from GIT repos. This might work I just haven't read how.
How to run a script from file in another project using include in GitLab CI? - Similar but the answer uses a multi-project pipeline and a trigger which is really (I think) a different answer.
.gitlab-ci.yml to include multiple shell functions from multiple yml files - Similar but the question is dealing with scripts in YAML files and I'm dealing with a stand alone script.
How to include a PowerShell script file in a GitLab CI YAML file - So far this is the closest to my question and some might consider it the same even though the question is asking about a powershell script. The answer said this wasn't possible to include a script (so maybe this is not possible using the GitLab CI syntax).
If it is possible, please let me know how to do this.

Spinnaker configuration loaded as code from gitlab

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.

Are phantomjs binary artifacts hosted on some repository?

I would like to download phantomjs binary within a Gradle build script.
Where are they hosted ?
There is an official download repository for PhantomJS: https://bitbucket.org/ariya/phantomjs/downloads/
No.
They are only hosted on bitbucket: https://bitbucket.org/ariya/phantomjs/downloads/
To use them with Gradle, the only option found to be working so far is to use the gradle-download-task plugin. To implement caching, you can copy paste this code.
Otherwise, another potential option is to declare a custom ivy dependency, but so far I haven't found a way to get it to work. The issue is that bitbucket redirects to an Amazon S3 location, and the HEAD request that Gradle first issues to get the file size fails, probably because of a request signature problem.

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.