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

Load_Platform: Using ADOP_PLATFORM_MANAGEMENT_VERSION if specified #41

Merged
merged 1 commit into from
Oct 13, 2017

Conversation

nickdgriffin
Copy link
Contributor

@nickdgriffin nickdgriffin commented Mar 31, 2017

This PR enables Load_Platform to use the value of ADOP_PLATFORM_MANAGEMENT_VERSION if specified in Jenkins. This is part of Accenture/adop-platform-management#11 and maintains the current behaviour of using master (as defined in the SCM section) if the value is not provided or invalid in some way for backwards compatibility.

It follows the same rules as Accenture/adop-platform-management#11 in that it only allows a valid Git commit ID, although it goes further in that it tests if it is actually present in the repository.

I'll create the adop-docker-compose PR once the release exists.

@dsingh07
Copy link
Contributor

dsingh07 commented Sep 22, 2017

Managed to build this image successfully and push it to Docker Hub. Deployed a fresh adop instance with this image successfully and the changes in the job came through properly.

Going through the following test cases now:

  • Test case 1 - Specify the environment variable ADOP_PLATFORM_MANAGEMENT_VERSION with a valid commit ID for adop-platform-management in docker-compose.yml for adop-jenkins
  • Test case 2 - Specify the environment variable ADOP_PLATFORM_MANAGEMENT_VERSION with an invalid commit ID for adop-platform-management in docker-compose.yml for adop-jenkins
  • Test case 3 - Do not specify the environment variable ADOP_PLATFORM_MANAGEMENT_VERSION in docker-compose.yml for adop-jenkins
  • Test case 4 - Specify the environment variable ADOP_PLATFORM_MANAGEMENT_VERSION with an invalid string (not a commit hash) in docker-compose.yml for adop-jenkins
  • Test case 5 - Specify the environment variable ADOP_PLATFORM_MANAGEMENT_VERSION with an empty string in docker-compose.yml for adop-jenkins

@dsingh07
Copy link
Contributor

dsingh07 commented Sep 22, 2017

Test case 1 passed successfully:

14:44:19 INFO - Checking out specified ADOP_PLATFORM_MANAGEMENT_VERSION 'd2bd6c467d66bd4b456c0bcaacf1d646cae07185'
14:44:19 + git checkout d2bd6c467d66bd4b456c0bcaacf1d646cae07185
14:44:19 HEAD is now at d2bd6c4... Merge pull request #44 from dsingh07/feature/pluggable```

@dsingh07
Copy link
Contributor

Test case 2 passed successfully with an invalid commit ID:

15:54:40 + [[ d2bd6c467d66bd4b456c0bcaacf1d646cae07180 =~ ^[a-fA-F0-9]{8,40}$ ]]
15:54:40 ++ git cat-file -t d2bd6c467d66bd4b456c0bcaacf1d646cae07180
15:54:40 fatal: git cat-file d2bd6c467d66bd4b456c0bcaacf1d646cae07180: bad file
15:54:40 + '[' '' = commit ']'
15:54:40 + echo 'WARNING - ADOP_PLATFORM_MANAGEMENT_VERSION is set to '\''d2bd6c467d66bd4b456c0bcaacf1d646cae07180'\'' which is not a valid Git commit hash - defaulting to '\''master'\'''
15:54:40 WARNING - ADOP_PLATFORM_MANAGEMENT_VERSION is set to 'd2bd6c467d66bd4b456c0bcaacf1d646cae07180' which is not a valid Git commit hash - defaulting to 'master'```

@dsingh07
Copy link
Contributor

dsingh07 commented Oct 13, 2017

Test case 3 passed where I haven't set the ADOP_PLATFORM_MANAGEMENT_VERSION env variable:

16:26:22 + '[' '!' -z '' ']'
16:26:22 + echo 'WARNING - ADOP_PLATFORM_MANAGEMENT_VERSION is set to '\'''\'' which is not a valid Git commit hash - defaulting to '\''master'\'''
16:26:22 WARNING - ADOP_PLATFORM_MANAGEMENT_VERSION is set to '' which is not a valid Git commit hash - defaulting to 'master'

@dsingh07
Copy link
Contributor

Test case 4 passes successfully where I've set ADOP_PLATFORM_MANAGEMENT_VERSION to an invalid string:

16:38:23 + '[' '!' -z this_is_not_a_commit_hash ']'
16:38:23 + [[ this_is_not_a_commit_hash =~ ^[a-fA-F0-9]{8,40}$ ]]
16:38:23 + echo 'WARNING - ADOP_PLATFORM_MANAGEMENT_VERSION is set to '\''this_is_not_a_commit_hash'\'' which is not a valid Git commit hash - defaulting to '\''master'\'''
16:38:23 WARNING - ADOP_PLATFORM_MANAGEMENT_VERSION is set to 'this_is_not_a_commit_hash' which is not a valid Git commit hash - defaulting to 'master'

@dsingh07
Copy link
Contributor

dsingh07 commented Oct 13, 2017

Test case 5 passed successfully as well where I've set ADOP_PLATFORM_MANAGEMENT_VERSION to a blank string:

16:48:50 + '[' '!' -z '' ']'
16:48:50 + echo 'WARNING - ADOP_PLATFORM_MANAGEMENT_VERSION is set to '\'''\'' which is not a valid Git commit hash - defaulting to '\''master'\'''
16:48:50 WARNING - ADOP_PLATFORM_MANAGEMENT_VERSION is set to '' which is not a valid Git commit hash - defaulting to 'master'

@dsingh07
Copy link
Contributor

Performed a further test by specifying a really old commit hash and verifying that the appropriate features added afterwards were not present:

16:55:49 + '[' '!' -z 09cb3b1f22fd40ea44475fe4d7361351468a283e ']'
16:55:49 + [[ 09cb3b1f22fd40ea44475fe4d7361351468a283e =~ ^[a-fA-F0-9]{8,40}$ ]]
16:55:49 ++ git cat-file -t 09cb3b1f22fd40ea44475fe4d7361351468a283e
16:55:49 + '[' commit = commit ']'
16:55:49 + echo 'INFO - Checking out specified ADOP_PLATFORM_MANAGEMENT_VERSION '\''09cb3b1f22fd40ea44475fe4d7361351468a283e'\'''
16:55:49 INFO - Checking out specified ADOP_PLATFORM_MANAGEMENT_VERSION '09cb3b1f22fd40ea44475fe4d7361351468a283e'
16:55:49 + git checkout 09cb3b1f22fd40ea44475fe4d7361351468a283e

@dsingh07
Copy link
Contributor

LGTM, thanks for the PR @nickdgriffin
Merging and creating a new 0.2.7 release.
Will await accompanying PR to adop-docker-compose.

@dsingh07 dsingh07 merged commit d493bff into Accenture:master Oct 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants