diff --git a/project-maven-azure-docker/README.md b/project-maven-azure-docker/README.md new file mode 100644 index 0000000000000000000000000000000000000000..f54795872503ee84c4a95186fbc66b6f7f996696 --- /dev/null +++ b/project-maven-azure-docker/README.md @@ -0,0 +1,37 @@ +# 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' + +``` diff --git a/project-maven-azure-docker/build.yml b/project-maven-azure-docker/build.yml index 852f0fdc7c28f3ec3e0cfb9a2917a7e8c4e4ea0e..d8ad54317d83b432e8adef1afc04d92a9b894bb9 100644 --- a/project-maven-azure-docker/build.yml +++ b/project-maven-azure-docker/build.yml @@ -13,7 +13,3 @@ build: only: - master - main - # rules: - # - if: '$CI_COMMIT_REF_NAME == "master"' - # when: always - # - when: never diff --git a/project-maven-azure-docker/gitlab-ci.yml b/project-maven-azure-docker/gitlab-ci.yml deleted file mode 100644 index dc3ae5b9f643ede26232f7c7de0396bb8c510b22..0000000000000000000000000000000000000000 --- a/project-maven-azure-docker/gitlab-ci.yml +++ /dev/null @@ -1,16 +0,0 @@ -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 diff --git a/project-maven-azure-docker/release.yml b/project-maven-azure-docker/release.yml deleted file mode 100644 index 954f4ea2e38536debed3ae05c3704e87a6f9ade6..0000000000000000000000000000000000000000 --- a/project-maven-azure-docker/release.yml +++ /dev/null @@ -1,25 +0,0 @@ - - - -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 diff --git a/azure/webhook.yml b/project-maven-azure-docker/webhook.yml similarity index 100% rename from azure/webhook.yml rename to project-maven-azure-docker/webhook.yml