replacing vsts with azurepipelines
This commit is contained in:
Родитель
dbc1ec057d
Коммит
49de6f7fdd
|
@ -3,7 +3,7 @@
|
|||
set -e
|
||||
|
||||
AGENT_FOLDER="agent"
|
||||
AZP_AGENT_VERSION="$(cat /vsts/agent/.agentVersion)"
|
||||
AZP_AGENT_VERSION="$(cat /azurepipelines/agent/.agentVersion)"
|
||||
AGENTVERSION="$(curl -s "https://api.github.com/repos/microsoft/azure-pipelines-agent/releases/latest" | jq -r .tag_name[1:])"
|
||||
|
||||
echo "Latest agent release version $AGENTVERSION"
|
||||
|
@ -22,7 +22,7 @@ if [ $AGENTVERSION != $AZP_AGENT_VERSION ]; then
|
|||
cd /azp/$AGENT_FOLDER
|
||||
|
||||
# Read download URL from the secret
|
||||
AZP_DOWNLOAD_URL="$(cat /vsts/agent/.url)"
|
||||
AZP_DOWNLOAD_URL="$(cat /azurepipelines/agent/.url)"
|
||||
|
||||
# Download the requested agent, else fall back to the version that was default when this was released
|
||||
if [ -z "$AZP_DOWNLOAD_URL" ]; then
|
||||
|
@ -45,8 +45,8 @@ trap 'cleanup; exit 143' TERM
|
|||
|
||||
echo "Mounting the .agent and .credentials files from a different source"
|
||||
# /azurepipelines/agent is the default path change below lines if something else is set as mount path in CRD.
|
||||
ln -fs /vsts/agent/.agent /azp/$AGENT_FOLDER/.agent
|
||||
ln -fs /vsts/agent/.credentials /azp/$AGENT_FOLDER/.credentials
|
||||
ln -fs /azurepipelines/agent/.agent /azp/$AGENT_FOLDER/.agent
|
||||
ln -fs /azurepipelines/agent/.credentials /azp/$AGENT_FOLDER/.credentials
|
||||
|
||||
echo "Running Azure Pipelines agent..."
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
kind: Secret
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: vsts
|
||||
name: azurepipelines
|
||||
namespace: {{ .Values.app.namespace }}
|
||||
labels:
|
||||
app: {{ .Values.app.name }}
|
||||
|
|
|
@ -16,5 +16,5 @@ image:
|
|||
tag: v1.25s
|
||||
pullPolicy: IfNotPresent
|
||||
|
||||
vsts:
|
||||
azurepipelines:
|
||||
VSTS_SECRET: ""
|
||||
|
|
|
@ -44,7 +44,7 @@ func (c *AzurePipelinesPoolclient) AddNewPodForCR(obj *AzurePipelinesPool, label
|
|||
spec := FetchPodSpec(obj, poolname)
|
||||
|
||||
// check if VolumeMounts is not present in the spec; then add the default one
|
||||
if spec!=nil && len(spec.Containers) > 0 && spec.Containers[0].VolumeMounts == nil {
|
||||
if spec != nil && len(spec.Containers) > 0 && spec.Containers[0].VolumeMounts == nil {
|
||||
spec.Containers[0].VolumeMounts = append(spec.Containers[0].VolumeMounts, *getDefaultVolumeMount())
|
||||
}
|
||||
|
||||
|
@ -70,7 +70,7 @@ func (c *AzurePipelinesPoolclient) AddNewPodForCRTest(obj *AzurePipelinesPool, l
|
|||
GenerateName: "azure-pipelines-agent-",
|
||||
},
|
||||
Spec: v1.PodSpec{
|
||||
Containers: []v1.Container {
|
||||
Containers: []v1.Container{
|
||||
{
|
||||
Name: "vsts-agent",
|
||||
Image: "prebansa/myagent:v1",
|
||||
|
@ -98,7 +98,7 @@ func getDefaultVolumeMount() *v1.VolumeMount {
|
|||
|
||||
return &v1.VolumeMount{
|
||||
Name: "agent-creds",
|
||||
MountPath: "/vsts/agent",
|
||||
MountPath: "/azurepipelines/agent",
|
||||
ReadOnly: true,
|
||||
}
|
||||
|
||||
|
|
|
@ -334,7 +334,7 @@ func AddnewPodForCR(cr *devv1alpha1.AzurePipelinesPool) *corev1.Pod {
|
|||
Name: "VSTS_SECRET",
|
||||
ValueFrom: &corev1.EnvVarSource{
|
||||
SecretKeyRef: &corev1.SecretKeySelector{
|
||||
LocalObjectReference: corev1.LocalObjectReference{Name: "vsts"},
|
||||
LocalObjectReference: corev1.LocalObjectReference{Name: "azurepipelines"},
|
||||
Key: "VSTS_SECRET",
|
||||
},
|
||||
},
|
||||
|
|
Загрузка…
Ссылка в новой задаче