forked from illuscio-dev/azure-pipelines-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
publish_service.yml
33 lines (26 loc) · 991 Bytes
/
publish_service.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
parameters:
# What the primary language of this build is. Choices are GO | PYTHON | DOCKER.
- name: language
type: string
steps:
# Set service name as build variable.
- script: $(python3 $(BUILD_SCRIPTS_DIR)/python_export_service_name.py)
displayName: Get Service Name
- script: docker -v
displayName: Print docker version info
# Log in to docker.
- script: docker login $REGISTRY_URL -u $DOCKER_ID -p $DOCKER_PASSWORD
env:
DOCKER_ID: $(CONTAINER_REGISTRY_ID)
DOCKER_PASSWORD: $(CONTAINER_REGISTRY_PASSWORD)
REGISTRY_URL: $(CONTAINER_REGISTRY_URL)
displayName: Log into DockerHub
- ${{ if eq( parameters.language, 'PYTHON') }}:
- template: publish_service_build_python.yml
- ${{ if eq( parameters.language, 'GO') }}:
- template: publish_service_build_go.yml
# Push docker image.
- script: docker push $REGISTRY_NAME/$SERVICE_NAME
displayName: Upload image
env:
REGISTRY_NAME: $(CONTAINER_REGISTRY_NAME)