coin3d / simage

Image file loading
ISC License
7 stars 9 forks source link

cpack.d with pipelines #11

Closed VolkerEnderlein closed 4 years ago

VolkerEnderlein commented 4 years ago

Original pull request by Giampiero Gabbiani (Bitbucket: ggabbiani, GitHub: ggabbiani).


This release of the cpack.d drop-in directory supports automatical creation and artifacts upload of new package releases for the following distro / os:

For each of the aforementioned distros, two sets of two packages each will be produced and uploaded in the Downloads directory after a successfull commit to the repo:

They share same contents but differ in the build number:

The first set will have a build number equals to the number of commits in the default branch.

The second one with build number equal to ‘last’ is representing the last successful package production, is replaced at every build and is used in the automatic build of the Docker images needed for other part of the Coin 3D collection.

Example:

libsimage-dev-1.7.1a-714_amd64.deb
libsimage-1.7.1a-714_amd64.deb
libsimage-dev-1.7.1a-last_amd64.deb
libsimage-1.7.1a-last_amd64.deb

NOTE:

Before approving the pull request, the following steps must be performed for the Coin3D user:

  1. create an application password with write capabilities on the BitBucket project repo
  2. define a secured environment variable named BB_AUTH_STRING containing the user credentials in the format: :

Without these the upload of the generated rpm and deb files into the repository Downloads directory will fail.

Best regards

Giampiero

VolkerEnderlein commented 4 years ago

Original comment by Coin3D (Bitbucket: Coin3Dold, ).


I hope I did everything correctly. We’ll see if it works!

VolkerEnderlein commented 4 years ago

Original comment by Bastiaan Veelo (Bitbucket: veelo, GitHub: veelo).


It looks like the pipeline succeeded, but I cannot find any files in Downloads.

https://bitbucket.org/Coin3D/simage/addon/pipelines/home#!/results/1

https://bitbucket.org/Coin3D/simage/downloads/

VolkerEnderlein commented 4 years ago

Original comment by Giampiero Gabbiani (Bitbucket: ggabbiani, GitHub: ggabbiani).


Yes I see …. it seems that the packages were not uploaded ... maybe we should insert a preliminary echo of the generated packages and curl command:

            # duplicates the artifacts with a build number equal to 'last'

            - for i in $(cat cpack.d/artifacts.list); do cp $i $(echo $i|sed -e 's/[0-9]\+_amd64/last_amd64/g'); done

# **** TEST FOR DEBUG ****

            - ls *.deb

            - ls *.deb | sed -e "s/libsimage/--form files=\@\"libsimage/g" -e "s/\.deb/\.deb\"/g"|xargs echo curl -X POST --user "${BB_AUTH_STRING}" "https://api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads"

# **** END TEST FOR DEBUG ****

            # uploads artifacts to the download area

            - ls *.deb | sed -e "s/libsimage/--form files=\@\"libsimage/g" -e "s/\.deb/\.deb\"/g"|xargs curl -X POST --user "${BB_AUTH_STRING}" "https://api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads"

Regard

Giampiero

VolkerEnderlein commented 4 years ago

Original comment by Giampiero Gabbiani (Bitbucket: ggabbiani, GitHub: ggabbiani).


If you think I can try to run it directly …

Regards

Giampiero

VolkerEnderlein commented 4 years ago

Original comment by Bastiaan Veelo (Bitbucket: veelo, GitHub: veelo).


Shouldn’t there be more steps also? I only see 2. The image: ggabbiani/fedora-simage:latest etc. has your name in it; is that correct?

VolkerEnderlein commented 4 years ago

Original comment by Bastiaan Veelo (Bitbucket: veelo, GitHub: veelo).


I don’t understand what you mean by trying to run it directly. I’ll just pull any PR you make, maybe you are able to debug it. Until we run out of build minutes :wink:

VolkerEnderlein commented 4 years ago

Original comment by Bastiaan Veelo (Bitbucket: veelo, GitHub: veelo).


It’s past midnight here though, I’ll check back later. Thanks for doing the work!

VolkerEnderlein commented 4 years ago

Original comment by Giampiero Gabbiani (Bitbucket: ggabbiani, GitHub: ggabbiani).


The step are one for each package produced

1 - for fedora 27

2 - for ubuntu 18

Each of them run roughly the same commands but in a different image (fedora:27 or ubuntu:18) with all the pre-requisites inside .

The two images have my name because part of my public repos on Docker Hub so it’s ok, and actually you can see that the pipeline produced the packages, it seems that what is not working is the upload (as you wrote initially).

I just make a local test and soon after I’ll pull another request.

Ciao

Giampiero