Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable multiple parallel calls #152

Merged
merged 2 commits into from
Sep 18, 2023
Merged

Conversation

mbarbero
Copy link
Contributor

@mbarbero mbarbero commented Sep 9, 2023

In a CI/CD environment, it is possible that multiple jobs are running in parallel. In such case, the script will fail because the dmg file is already created by another job.

This commit adds a the PID of the process creating the dmg file to the name of the temporary dmg file. It also uses -mountrandom to mount the dmg file in a random directory. This way, multiple jobs can run in parallel.

In a CI/CD environment, it is possible that multiple jobs are running
in parallel. In such case, the script will fail because the dmg file is
already created by another job.

This commit adds a the PID of the process creating the dmg file to the
name of the temporary dmg file. It also uses -mountrandom to mount the
dmg file in a random directory. This way, multiple jobs can run in
parallel.

Signed-off-by: Mikaël Barbero <mikael.barbero@eclipse-foundation.org>
@aonez
Copy link
Member

aonez commented Sep 9, 2023

This will be a great addition. Happened to me lots of times.

@mly-intuitive
Copy link
Contributor

pr152-fix.patch

@mbarbero - Consider the attached patch as a part of your contribution. I've noticed that hdiutil can sometimes create the temporary disk image with multiple partitions, causing your determination of the mount directory to fail. This seems to occur during the creation of very large disk images (100s of gigs).

The patch implements a function to search for partitions beyond the first /dev/diskNNs1 and returns after awk returns something other than null.

hdiutil can sometimes create the temporary disk image with multiple
partitions, causing your determination of the mount directory to fail.
This seems to occur during the creation of very large disk images
(100s of gigs).

Credits: @mly-intuitive
  * https://github.com/mly-intuitive
  * create-dmg#152 (comment)

Signed-off-by: Mikaël Barbero <mikael.barbero@eclipse-foundation.org>
@mbarbero
Copy link
Contributor Author

@mbarbero - Consider the attached patch as a part of your contribution.

Thanks @mly-intuitive, I've integrated your patch in bca0472

@aonez aonez added this to the 1.2.0 milestone Sep 18, 2023
@aonez aonez merged commit 6cf40bd into create-dmg:master Sep 18, 2023
@mbarbero mbarbero deleted the parallel-calls branch September 18, 2023 16:54
create-dmg Show resolved Hide resolved
aonez added a commit that referenced this pull request Sep 19, 2023
`/Volumes` fails in sandbox environments
#152
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants