codeship / codeship-tool-examples

Examples to get you started using Codeship Pro. Download the local CLI to follow along with these examples locally.
http://bit.ly/codeship-jet-tool
MIT License
52 stars 31 forks source link

Add example for using default env vars as docker build arg #50

Closed markphelps closed 6 years ago

markphelps commented 6 years ago

Adding example on how customers can use default env vars as build arguments

markphelps commented 6 years ago

Will do

markphelps commented 6 years ago

Actually thats not gonna work when run locally because CommitID is only populated in CI.

mlocher commented 6 years ago

Very valid point though having those available locally as well would be great (though a completely different topic).

markphelps commented 6 years ago

Thats not really possible without depending on git or mercural to be installed on the users machine as jet has no view of the commits associated with a project. In production it gets sent that information by the SCM

On Mon, Feb 12, 2018 at 8:57 AM, Marko Locher notifications@github.com wrote:

Very valid point though having those available locally as well would be great (though a completely different topic).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/codeship/codeship-tool-examples/pull/50#issuecomment-364929702, or mute the thread https://github.com/notifications/unsubscribe-auth/AAMyRTJO7TQNCUgosnqwAlhjc88pGqc6ks5tUENKgaJpZM4R5o-4 .

rheinwein commented 6 years ago

@mlocher If a user wants to simulate having the commit ID available, they can populate it manually via --ci-commit-id

markphelps commented 6 years ago

True, but just running jet steps in the base of this project (as most users probably do) will not work since there will be no commit ID for that step

markphelps commented 6 years ago

We could update it to depend on the CI env var instead and do something like:

if CI {
  echo "I'm running in CI environment
} else {
  echo "I'm running locally"
}

or something to that effect