Skip to content

Commit

Permalink
ci: fix chown task not setting permissions properly (et/somenergia-ja…
Browse files Browse the repository at this point in the history
…rdiner!28)

* ci: add new dbt dir as artifact to chown task

* ci: set chown for all files inside CI_PROJECT_DIR in chown task
  • Loading branch information
diegoquintanav committed Nov 17, 2023
1 parent ac033bd commit b04a337
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ variables:
MKDOCS_COMPOSE_FILE: containers/mkdocs/docker-compose.mkdocs.yml
APP_COMPOSE_FILE: containers/app/docker-compose.yml
CI_TRIGGER_TASK_NAME: null


# just run pre-commit hooks on the files that changed, but don't fix them
PRE_COMMIT_AUTO_FIX: 0
Expand Down Expand Up @@ -322,12 +321,8 @@ chown-non-root-artifacts:
script:
- echo "Creating artifacts directory"
- mkdir -p ${CI_PROJECT_DIR}/.artifacts
- echo "Change owner of artifacts directory to 1000:1000"
- chown -R 1000:1000 ${CI_PROJECT_DIR}/.artifacts
- echo "Change ownership of dbt docs requirements"
- chown -R 1000:1000 ${CI_PROJECT_DIR}/${DBT_PROJECT_DIR_NAME}
- echo "Change ownership of mkdocs requirements"
- chown -R 1000:1000 ${CI_PROJECT_DIR}/docs && chown 1000:1000 ${CI_PROJECT_DIR}/mkdocs.yml
- echo "Change ownership of ${CI_PROJECT_DIR} to 1000:1000"
- chown -R 1000:1000 ${CI_PROJECT_DIR}
rules:
- if: $CI_COMMIT_REF_NAME == "main" && $CI_PIPELINE_SOURCE == "push"
when: always
Expand All @@ -339,6 +334,7 @@ chown-non-root-artifacts:
artifacts:
paths:
- .artifacts
- ${CI_PROJECT_DIR}/${DBT_PROJECT_DIR_NAME}
tags:
- somenergia-et

Expand All @@ -354,7 +350,6 @@ generate-dbt-docs:
DBT_DOCS_ARTIFACT_DIR: ${CI_PROJECT_DIR}/${DBT_PROJECT_DIR_NAME}/target
image: ${SOM_HARBOR_DADES_URL}/${SOM_PROJECT_NAME}-dbt-docs:latest
script:
- if [ $CI_PIPELINE_DEBUG_FLAG==true ]; then sleep 1h; fi
- cd ${CI_PROJECT_DIR}/${DBT_PROJECT_DIR_NAME}
- dbt deps --target ${DBT_TARGET_NAME}
- dbt docs generate --target ${DBT_TARGET_NAME}
Expand Down

0 comments on commit b04a337

Please sign in to comment.