You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 13, 2020. It is now read-only.
This PR focuses around ironing out the flow of running `spk project init` or
`spk project init -m`, creating pipelines via the generated
`azure-pipelines.yaml` files, and ensuring the pipeline can create appropriately
named/tagged docker images in ACR.
In order to allow for flexibility in how SRE's choose to deploy the pipelines,
this PR does not automate the actual deployment of the pipeline. Instead, `info`
level instructions have been added specifying how to run the
`spk service create-pipeline` to deploy the `azure-pipelines.yaml` generated; If
the the user has configured the spk config correctly, the outputted command is
copy/paste ready to deploy the generated pipelines yaml:
If ran on a mono-repo:
`spk service create-pipeline --project-dir packages my-service` will be logged.
If ran on a standard repo: `spk service create-pipeline my-service` will be
logged.
The `azure-pipelines.yaml` expects 4 environment variables to be present in
order to login to `az` cli and build and push an image to ACR:
- `ACR_NAME` - name of the target ACR
- `SP_APP_ID` - service principal ID
- `SP_PASS` - service principal password
- `SP_TENANT` - service principal tenant
These requirements are also `info` logged to the end user upon
`azure-pipelines.yaml` generation.
Previously `spk service create-pipeline` only worked for mono-repositories and
the code has been refactored such that the existence of the `--packages-dir`
options implies whether or not the repository is a mono-repository or a standard
one.
closesmicrosoft/bedrock#646
-l, --packages-dir <packages-dir> The monorepository directory containing this service definition. ie. '--packages-dir packages' if my-service is located under ./packages/my-service.
74
+
-l, --packages-dir <packages-dir> The mono-repository directory containing this service definition. ie. '--packages-dir packages' if my-service is located under ./packages/my-service. Omitting this option implies this is a not a mono-repository.
"The monorepository directory containing this service definition. ie. '--packages-dir packages' if my-service is located under ./packages/my-service."
40
+
"The mono-repository directory containing this service definition. ie. '--packages-dir packages' if my-service is located under ./packages/my-service. Omitting this option implies this is a not a mono-repository."
* Install a pipeline for the service in an azure devops org.
135
-
* @param serviceName
128
+
*
129
+
* @param serviceName Name of the service this pipeline belongs to; this is only used when `packagesDir` is defined as a means to locate the azure-pipelines.yaml file
136
130
* @param orgName
137
131
* @param personalAccessToken
138
132
* @param pipelineName
139
-
* @paramrepoName
140
-
* @paramrepoUrl
133
+
* @paramrepositoryName
134
+
* @paramrepositoryUrl
141
135
* @param project
136
+
* @param packagesDir The directory containing the services for a mono-repo. If undefined; implies that we are operating on a standard service repository
yamlFilePath: path.join(packagesDir,serviceName,"azure-pipelines.yaml")// This may not work if we're using a non-mono repository and azure-pipelines.yaml is in the root directory.
169
+
yamlFilePath: packagesDir// if a packages dir is supplied, its a mono-repo
170
+
? path.join(packagesDir,serviceName,"azure-pipelines.yaml")// if a packages dir is supplied, its a mono-repo; concat <packages-dir>/<service-name>
171
+
: "azure-pipelines.yaml"// if no packages dir, its a standard repo; so the azure-pipelines.yaml is in the root
174
172
});
175
173
176
174
try{
175
+
logger.debug(
176
+
`Creating pipeline for project '${project}' with definition '${JSON.stringify(
"spk service create-pipeline "+packagesOption+serviceName;
172
+
logger.info(
173
+
`Generated azure-pipelines.yaml for service in path '${relPath}'. Commit and push this file to master before attempting to deploy via the command '${spkServiceCreatePipelineCmd}'; before running the pipeline ensure the following environment variables are available to your pipeline: ${requiredPipelineVariables}`
0 commit comments