Skip to content
Snippets Groups Projects
Commit fbefd56f authored by Lopez de Guereña Caballero, Jon's avatar Lopez de Guereña Caballero, Jon
Browse files

azure jopbs updated

parent 94f6a827
No related branches found
No related tags found
No related merge requests found
# Include jobs from external YAML files
You can include the jobs in this repository's YAML files as follows:
```yml
include:
- 'https://git.code.tecnalia.com/digicon-webxr-store/ci-files/-/raw/master/project-maven-azure-docker/webhook.yml'
- 'https://git.code.tecnalia.com/digicon-webxr-store/ci-files/-/raw/master/project-maven-azure-docker/webhook.yml'
```
## Build job:
You need to create 5 environment variables in GITLAB, most of the times everyone except CONTAINER_IMAGE are extended from the group in which the repository has been created.
- ACR_USERNAME : artifactory username
- ACR_PASSWORD : artifactory password
- ACR_URL : artifactory url
- NPM_TKN : npm token
- CONTAINER_IMAGE : docker container image
## Webhook job:
You need to create 3 environment variables in GITLAB, this vars are taken from the appservice Webhook URL, which can be found at the end of the "Deployment center" panel inside your app service:
Example webhook url (https://$digiconrauman:hdZFs6ZAMlqnic8JB4tRYFQqnjrecdsM0yBHrZgC026Gqs1vp6KG3Dii5uHx@digiconrauman.scm.azurewebsites.net/docker/hook)
- AZURE_PASS: your azure user password for that azure app service : hdZFs6ZAMlqnic8JB4tRYFQqnjrecdsM0yBHrZgC026Gqs1vp6KG3Dii5uHx
- AZURE_USER: your azure user name for that azure app service **with** and extra $ at the begining : $$digiconrauman
- AZURE_URL: the url of the azure app service webhook : digiconrauman.scm.azurewebsites.net/docker/hook
## Example
An example of a valid .gitlab-ci.yml can be:
```yml
stages:
- build
include:
- 'https://git.code.tecnalia.com/digicon-webxr-store/ci-files/-/raw/master/project-maven-azure-docker/build.yml'
- 'https://git.code.tecnalia.com/digicon-webxr-store/ci-files/-/raw/master/project-maven-azure-docker/webhook.yml'
```
......@@ -13,7 +13,3 @@ build:
only:
- master
- main
# rules:
# - if: '$CI_COMMIT_REF_NAME == "master"'
# when: always
# - when: never
build:
image: $ACR_URL/docker:dind
stage: build
services:
- docker:dind
tags:
- docker
script:
- docker login -u $ACR_USERNAME -p $ACR_PASSWORD $ACR_URL
- docker image build --build-arg REG=https://artifact.tecnalia.com/artifactory/api/npm/digicon-npm-dev/ --build-arg NPM_TKN=$NPM_TOKEN --build-arg US=$ACR_USERNAME --build-arg CI_TOKEN=$ACR_PASSWORD -t $CONTAINER_IMAGE ./
- docker push $CONTAINER_IMAGE
only:
- master
- main
- dev
release:
image: registry.gitlab.com/gitlab-org/release-cli
stage: deploy
tags:
- docker
script:
release-cli create --name $CI_COMMIT_TAG --description release
--milestone $CI_COMMIT_TAG
- export COMMIT_TIME=$(git show -s --format=%ct $CI_COMMIT_SHA)
--released-at $COMMIT_TIME
except:
- branches
only:
- tags
# No funciona ===>
# rules:
# - if: $CI_COMMIT_BRANCH == "master" && ('$CI_COMMIT_TAG == /^v\d+.\d+.\d|\d+.\d+/')
# when: always
# - when: never
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment