Commit 9f23e7c8 authored by FORESTIER Fabien's avatar FORESTIER Fabien
Browse files

Remove deployment jobs as a dedicated project as been created

parent 0816f4be
Pipeline #4203 failed with stages
in 3 seconds
variables:
GHOST_API: https://ghost-intothesky.alpha.grandlyon.com/ghost/api
#GHOST_ADMIN_API_KEY:
INDEXER__ES_URL: https://elastic2.alpha.grandlyon.com
INDEXER__ES_POSTS_INDEX: posts.ingest.v5
INDEXER__ES_PAGES_INDEX: pages.ingest.v5
REINDEXER__ES_SOURCE_URL: https://elastic2.alpha.grandlyon.com:443
REINDEXER__ES_DESTINATION_URL: https://elastic2.alpha.grandlyon.com
REINDEXER__SOURCE_POSTS_INDEX: posts.ingest.v5
REINDEXER__SOURCE_PAGES_INDEX: pages.ingest.v5
REINDEXER__DESTINATION_POSTS_INDEX: posts.v5
REINDEXER__DESTINATION_PAGES_INDEX: pages.v5
REINDEXER__POSTS_TEMPLATE_NAME: ghost-posts-template
REINDEXER__PAGES_TEMPLATE_NAME: ghost-pages-template
SONAR_URL: https://sonarqube.forge.grandlyon.com
stages:
- sonar-analysis
- build
- deploy
sonarqube:
stage: sonar-analysis
......@@ -40,53 +23,20 @@ build_development:
only:
- development
script:
- export TAG=dev
- export TAG=$CI_COMMIT_SHORT_SHA
- export CONTENT_INDEXER_BIND_PORT=4000
- docker-compose build
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker-compose push
- "curl -X POST -F token=$CI_JOB_TOKEN -F ref=master -F variables[TAG]=${TAG} https://forge.grandlyon.com/api/v4/projects/348/trigger/pipeline"
build_release:
stage: build
only:
- tags
#except:
#- /^(?!master).+@/
script:
- export TAG=$(echo $CI_COMMIT_TAG | sed 's/v//g')
- export CONTENT_INDEXER_BIND_PORT=4000
- docker-compose build
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker-compose push
deploy_development:
stage: deploy
only:
- development
script:
- export TAG=dev
- export CONTENT_INDEXER_BIND_PORT=4000
- envsubst < config.template.yaml > config.yaml
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker-compose pull
- docker-compose --project-name content-indexer-${TAG} up -d --force-recreate
environment:
name: development
deploy_staging:
stage: deploy
only:
- development
when: manual
script:
- export TAG=staging
- export CONTENT_INDEXER_BIND_PORT=4100
- envsubst < config.template.yml > config.yml
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- TAG=dev docker-compose pull
- export REGISTRY_PATH=web-et-numerique/web-et-numerique-internet/data.grandlyon.com/web-portal/components/indexers/editorial-content
- docker tag $CI_REGISTRY/$REGISTRY_PATH:dev $CI_REGISTRY/$REGISTRY_PATH:${TAG}
- docker push $CI_REGISTRY/$REGISTRY_PATH:${TAG}
- docker-compose --project-name content-indexer-${TAG} up -d --force-recreate
environment:
name: staging
# Editorial content indexer
## Environment variable
In order to run the code, some environment variables are needed. They are specified in the `template.env` file at the root of the project.
For a local deployment:
1. `cp env-template.sh env.sh`
2. Edit env.sh according to the chosen configuration
3. `source env.sh`
## Running the app with docker
1. `envsubst < config.template.yaml > config.yaml`
2. `docker-compose up [-d]`
export TAG=<the_docker_image_tag>
export CONTENT_INDEXER_BIND_PORT=<the_port_to_bind_to>
export GHOST_API=<the_ghost_api_url, ex. https://your-domain/ghost/api>
export GHOST_ADMIN_API_KEY=<the_ghost_admin_api_key>
export INDEXER__ES_URL=<the_elasticsearch_url>
export INDEXER__ES_POSTS_INDEX=<the_elasticsearch_index_for_posts>
export INDEXER__ES_PAGES_INDEX=<the_elasticsearch_index_for_pages>
export REINDEXER__ES_SOURCE_URL=<the_source_elasticsearch_url>
export REINDEXER__ES_DESTINATION_URL=<the_destination_elasticsearch_url>
export REINDEXER__SOURCE_POSTS_INDEX=<the_source_elasticsearch_index_for_posts>
export REINDEXER__SOURCE_PAGES_INDEX=<the_source_elasticsearch_index_for_pages>
export REINDEXER__DESTINATION_POSTS_INDEX=<the_destination_elasticsearch_index_for_posts>
export REINDEXER__DESTINATION_PAGES_INDEX=<the_destination_elasticsearch_index_for_pages>
export REINDEXER__POSTS_TEMPLATE_NAME=<the_name_to_use_for_the_elasticsearch_dynamic_template_for_posts>
export REINDEXER__PAGES_TEMPLATE_NAME=<the_name_to_use_for_the_elasticsearch_dynamic_template_for_pages>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment