Adding Google cocoapods to Artifactory - cocoapods

Currently we are working in a project that must be developed in an environment behind a firewall and we don't have access to internet so, we are not able to install de pods in the iOS project.
We have the opportunity to use Artifactory to cache the pods, but currently it only works for the ones that are stored in github, so for example GooglePlace, GoogleMaps pods cannot be installed as they are distributed as tgz.
Do you know a way to install those pods in Artifactory? As we have seen, in order to publish them in a Cocoapod repository we will need to
a) download the .tgz
b) create a specfile in groovy, cause at least we are not able to make use of the .json podspec of google to let it index and recognize the pod.
Maybe the problem is that we are not using the json file properly. As far as we know, the spec file has to be inside the tgz file, but it didn't recognize the file as I mention before.

We were able to make it work. It was just a problem with the tar.gz file. The steps we follow was in a osx:
Download the json spec file with curl
Download the tar.gz source that we can locate in the json spec the pod file
Uncompress the tar.gz
Add the json spec file to the root folder of the uncompressed data
Compress with the gnu-tar (that can be installed with brew) the file, with tar.gz extension
Upload to artifactory
With those steps, and using jfrog repo-art plugin we can use the pods without internet connection

Related

Is there a way to get the filename of a file from its download link in Ansible

I'm writing some ansible code to update a project from gitlab so I need to first check if the host computer and the version I'm trying to install are different from one another. I find the version on Gitlab from the file at
https://gitlab.example.com/api/v4/projects/1/jobs/artifacts/master/download?job=test
using the uri module in ansible. The file downloaded has the version number in its name. "CompanyName-VersionNumber.zip"
But this has the effect of downloading the file as well. I want to be able to check what file would be downloaded before actually downloading it so I can do a version check.
This code will be run on both windows and linux machines, so if possible something that works on both would be preferred.

Swagger Editor offline installation

Our company is using swagger to document their API's, currently a couple of developers are using the online swagger editor on their PC's.
I want to move this piece of the design process into our standard development environment, which is in a walled garden without internet access.
How do I go about installing npm and the swagger editor in an offline environment?
There are options to use either RHEL or Windows machines, although Windows is preferable as developers have local admin rights
In short answer is https://swagger.io/docs/swagger-tools/#swagger-editor
git clone https://github.com/swagger-api/swagger-editor.git
cd swagger-editor
npm install
npm run build
npm start
And it will works in your Intranet OK.
npm is not required, you can download the compiled files from the Swagger Editor repository:
index.html
dist\*
and open index.html locally (from the file system) or put the files onto a web server in your network.
With one command with npm/npx:
npx swagger-editor-binary
Download the one of the source releases from swagger-editor's github page (click releases link on the page)
unzip the downloaded source release zip/tar file.
cd into the extracted source dir, type 'npm install' (or if you have some npm mirror module installed, such as cnpm, use 'cnpm install' instead)
Use a browser to open index.html file in the source dir. Or, follow official guide the 'Setup with http-server module from GitHub' section to serve from a local static web server.
PS. You don't need to build the source code unless you want to contribute as written in the 'Contribute' section of the official document.

Manually download from github

Is it possible to download any github project manually?
That is, I do not want to clone the project from repo. Just install project if it exists in directory.
E.g., download here and use:
/Users/admin/Library/Caches/CocoaPods/Pods/Release/EasyPeasy/1.2.1-b39f8 . is it possible to setup suffix?
the question is redirected from github
You can download any project as a zip file and then unzip in your local and use it. Are you looking for any other thing??

Differences between RPM created with rpmbuild and Os-nebula-rpm plugin

I am trying to use the Nebula rpm plugin for Gradle to build RPMs. I am finding the following discrepancy between RPMs built this way and RPMs built the traditional way, with spec files and rpmbuild.
In a spec file, you might have something like this:
%dir /usr/local/myapp/logs
This would create the directory /usr/local/myapp/logs when the rpm is installed. Once myapp starts to run it would write logs to this directory. When the app is uninstalled, rpm would understand that the files under /usr/local/myapp/logs were not created by the rpm installation process and therefore not delete this directory or the files within it. If the directory were empty at the time of uninstallation, then the directory would be removed.
There is a similar directive with the Gradle plugin. If you include
directory('/usr/local/myapp/logs')
in the build script, this directory will be created similar to the rpm process. However, in this instance, when the rpm is uninstalled, the directory and any files that have been added within it since installation will be removed.
I am trying to account for this difference. The RPM plugin is based on the redline-rpm java package, and from looking at the source, and the usual RedHat rpm documentation, I cannot find any setting that governs this behavior.
Can anyone hazard a guess what might be going on here to create this difference in behavior?
Update: this post has some pretty good information on how this works, but I still don't know the name of any directive that alters this behavior.
Update 2 Now this starts to get very interesting. If I run rpm -evv myapp on the rpm built with the Gradle plugin, after installation, and after having added a file to /usr/local/myapp/logs, I see the following:
D: fini 040755 2 (7007, 500) 4096 /usr/local/myapp/logs
D: erase rmdir of /usr/local/myapp/logs failed: Directory not empty
and yet and still, after the operation is complete, the directory is gone!
How can this be? Could there be some configuration of the rpm executable itself that allows the deletion to take place?

How to automatically download .gem files, including dependencies, and save .gem's to one folder?

I work behind a firewall and I need some gems to automate some processes at work.
Problem:
Rubygems cannot automatically download gem dependencies so I have to manually download each gem from rubygems.org and install using the local copies. As you can imagine, this could take a very long time to find each gem dependency and manually download.
Ideal Solution:
I would like to automatically download all of these gems on another computer not behind a firewall, package the entire collection into one folder (no need to install, just download .gem files), and make that folder available to myself to download at work. The file just needs to contain every .gem file including dependencies.
Notes:
location: A solution in Ruby would be ideal! Remember, I can use gems on the secondary computer to create the solution for the primary computer where I cannot download gems remotely.
attempts: I have poured over documentation at rubygems.org, google searched, and more, but cannot find a solution. I can't seem to access the downloaded .gem files, they are unpacked and installed before I have a chance to incercept the file and save them elsewhere.
Bundler has a great way to do this: bundle package.
http://bundler.io/v1.2/bundle_package.html
The package command will put all your gems in the bundle into ./vendor/cache. You can then do whatever you want with that directory, such as copying it to another machine, or checking it into version control, or torrenting it. etc.

Resources