-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from opendevstack/hotfix/nodejs-agent-name
Fix nodejs agent name
- Loading branch information
Showing
8 changed files
with
123 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,78 @@ | ||
# ods-jenkinsfile-converter | ||
[![build](https://github.com/opendevstack/ods-jenkinsfile-converter/actions/workflows/build.yml/badge.svg)](https://github.com/opendevstack/ods-jenkinsfile-converter/actions/workflows/build.yml) | ||
|
||
## Introduction | ||
|
||
This is a Golang CLI to convert the a Jenkinsfile based on 3.x to 4.x based on the [official required changes](https://www.opendevstack.org/ods-documentation/opendevstack/4.x/update-guides/4x.html). | ||
|
||
## Download | ||
|
||
Target a specific version and platform for the binary. For version `v0.1.1` and linux, you would: | ||
|
||
```cli | ||
curl -L https://github.com/opendevstack/ods-jenkinsfile-converter/releases/download/v0.1.1/converter -o converter | ||
sudo mv converter /usr/local/bin | ||
``` | ||
|
||
For other platforms like Windows or MacOS choose the binary from the links [here](https://github.com/opendevstack/ods-jenkinsfile-converter/releases). | ||
|
||
## Usage | ||
|
||
Given a Jenkinsfile based on 3.x, to preview the changes that will result when migrating to ODS 4.x, use the `--dry-run` flag | ||
|
||
```cli | ||
converter -filename="examples/machine-learning/Jenkinsfile" --dry-run | ||
``` | ||
|
||
or to persist the changes in an output file | ||
|
||
```cli | ||
converter -filename="examples/machine-learning/Jenkinsfile" -out "out/Jenkinsfile" | ||
``` | ||
|
||
The converted Jenkinsfile with the ODS 4.x adopted changes will be under the [out](./out) directory: | ||
|
||
```cli | ||
cat out/Jenkinsfile | ||
``` | ||
|
||
## Building it locally | ||
|
||
Generate the binaries under [bin](./bin) | ||
|
||
```cli | ||
make all | ||
``` | ||
|
||
You can run the binary for your platform. To preview the changes that will be done, use the `--dry-run` flag | ||
|
||
```cli | ||
./bin/converter -filename="examples/machine-learning/Jenkinsfile" --dry-run | ||
``` | ||
|
||
## Run it with `Go` | ||
|
||
```cli | ||
go run . -filename="examples/machine-learning/Jenkinsfile" -out "out/Jenkinsfile" | ||
``` | ||
|
||
## Features | ||
|
||
This tool will carry out the following changes in an ODS 3.x Jenkinsfile: | ||
|
||
- [X] Update `@Library('[email protected]') _` to `@Library('[email protected]') _` | ||
- [X] Point to agent images with the 4.x tag, e.g. change imageStreamTag: `ods/jenkins-agent-golang:3.x` to imageStreamTag: `ods/jenkins-agent-golang:4.x` or imageStreamTag: `ods/jenkins-agent-golang:3.0.0` to imageStreamTag: `ods/jenkins-agent-golang:4.0.0`. | ||
- [X] `odsComponentStageImportOpenShiftImageOrElse` has been deprecated, and is now aliased to the new method, `odsComponentFindOpenShiftImageOrElse`. | ||
- [X] `odsComponentStageRolloutOpenShiftDeployment` rolls out all deployment resources together now. If you had multiple DeploymentConfig resources previously, you had to target each one by specifying the config option resourceName. This is no longer possible - instead the stage iterates over all DeploymentConfig resources with the component label (app=${projectId}-${componentId}). Changes must be made to pipelines that have multiple deployments, such as components based on the ds-jupyter-notebook and ds-rshiny quickstarter. | ||
|
||
For instance, the following must be changed from: | ||
|
||
`odsComponentStageRolloutOpenShiftDeployment(context, [resourceName: "${context.componentId}-auth-proxy"])` | ||
|
||
to: | ||
|
||
`odsComponentStageRolloutOpenShiftDeployment(context)` | ||
|
||
## Limitations | ||
- Only Jenkinsfiles from 3.x are supported. | ||
# ods-jenkinsfile-converter | ||
[![build](https://github.com/opendevstack/ods-jenkinsfile-converter/actions/workflows/build.yml/badge.svg)](https://github.com/opendevstack/ods-jenkinsfile-converter/actions/workflows/build.yml) | ||
|
||
## Introduction | ||
|
||
This is a Golang CLI to convert the a Jenkinsfile based on 3.x to 4.x based on the [official required changes](https://www.opendevstack.org/ods-documentation/opendevstack/4.x/update-guides/4x.html). | ||
|
||
## Download | ||
|
||
Target a specific version and platform for the binary. For version `v0.1.2` and linux, you would: | ||
|
||
```cli | ||
curl -L https://github.com/opendevstack/ods-jenkinsfile-converter/releases/download/v0.1.2/converter -o converter | ||
sudo mv converter /usr/local/bin | ||
``` | ||
|
||
For other platforms like Windows or MacOS choose the binary from the links [here](https://github.com/opendevstack/ods-jenkinsfile-converter/releases). | ||
|
||
## Usage | ||
|
||
Given a Jenkinsfile based on 3.x, to preview the changes that will result when migrating to ODS 4.x, use the `--dry-run` flag | ||
|
||
```cli | ||
converter -filename="examples/machine-learning/Jenkinsfile" --dry-run | ||
``` | ||
|
||
or to persist the changes in an output file | ||
|
||
```cli | ||
converter -filename="examples/machine-learning/Jenkinsfile" -out "out/Jenkinsfile" | ||
``` | ||
|
||
The converted Jenkinsfile with the ODS 4.x adopted changes will be under the [out](./out) directory: | ||
|
||
```cli | ||
cat out/Jenkinsfile | ||
``` | ||
|
||
## Building it locally | ||
|
||
Generate the binaries under [bin](./bin) | ||
|
||
```cli | ||
make all | ||
``` | ||
|
||
You can run the binary for your platform. To preview the changes that will be done, use the `--dry-run` flag | ||
|
||
```cli | ||
./bin/converter -filename="examples/machine-learning/Jenkinsfile" --dry-run | ||
``` | ||
|
||
## Run it with `Go` | ||
|
||
```cli | ||
go run . -filename="examples/machine-learning/Jenkinsfile" -out "out/Jenkinsfile" | ||
``` | ||
|
||
## Features | ||
|
||
This tool will carry out the following changes in an ODS 3.x Jenkinsfile: | ||
|
||
- [X] Update `@Library('[email protected]') _` to `@Library('[email protected]') _` | ||
- [X] Point to agent images with the 4.x tag, e.g. change imageStreamTag: `ods/jenkins-agent-golang:3.x` to imageStreamTag: `ods/jenkins-agent-golang:4.x`. | ||
- [X] NodeJS agent name is going to change in ODS 4. From `jenkins-agent-nodejs10-angular` to `jenkins-agent-nodejs12`. | ||
- [X] `odsComponentStageImportOpenShiftImageOrElse` has been deprecated, and is now aliased to the new method, `odsComponentFindOpenShiftImageOrElse`. | ||
- [X] `odsComponentStageRolloutOpenShiftDeployment` rolls out all deployment resources together now. If you had multiple DeploymentConfig resources previously, you had to target each one by specifying the config option resourceName. This is no longer possible - instead the stage iterates over all DeploymentConfig resources with the component label (app=${projectId}-${componentId}). Changes must be made to pipelines that have multiple deployments, such as components based on the ds-jupyter-notebook and ds-rshiny quickstarter. | ||
|
||
For instance, the following must be changed from: | ||
|
||
`odsComponentStageRolloutOpenShiftDeployment(context, [resourceName: "${context.componentId}-auth-proxy"])` | ||
|
||
to: | ||
|
||
`odsComponentStageRolloutOpenShiftDeployment(context)` | ||
|
||
## Limitations | ||
- Only Jenkinsfiles from 3.x are supported. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// See https://www.opendevstack.org/ods-documentation/ for usage and customization. | ||
|
||
@Library('[email protected]') _ | ||
|
||
odsComponentPipeline( | ||
imageStreamTag: 'ods/jenkins-agent-nodejs10-angular:3.0.0', | ||
branchToEnvironmentMapping: [ | ||
'master': 'dev', | ||
'release/': 'test', | ||
] | ||
) { context -> | ||
// nothing... | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// See https://www.opendevstack.org/ods-documentation/ for usage and customization. | ||
|
||
@Library('[email protected]') _ | ||
|
||
odsComponentPipeline( | ||
imageStreamTag: 'ods/jenkins-agent-nodejs12:4.x', | ||
branchToEnvironmentMapping: [ | ||
'master': 'dev', | ||
'release/': 'test', | ||
] | ||
) { context -> | ||
// nothing... | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
@Library('[email protected]') _ | ||
|
||
odsComponentPipeline( | ||
imageStreamTag: 'ods/jenkins-agent-base:4.0.0', | ||
imageStreamTag: 'ods/jenkins-agent-base:4.x', | ||
openshiftBuildTimeout: 30, | ||
branchToEnvironmentMapping: [ | ||
'master': 'dev', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters