Loading ci-templates/build.yml +13 −2 Original line number Diff line number Diff line .maven_build: extends: .default extends: .default_protected stage: build image: maven:3.9.5-ibm-semeru-17-focal script: Loading @@ -9,7 +9,7 @@ - target/ .docker_build: extends: .default extends: .default_protected stage: build image: name: gcr.io/kaniko-project/executor:debug Loading @@ -21,3 +21,14 @@ echo "Pushing Docker image with tag 'latest'" /kaniko/executor --context "${CI_PROJECT_DIR}" --dockerfile "${CI_PROJECT_DIR}/Dockerfile" --destination "${CI_REGISTRY_IMAGE}:latest" fi .angular_build 2/2: extends: .default_protected stage: build image: node:latest script: - npm install - npm run build -- --prod artifacts: paths: - dist/ ci-templates/build_unprotected.yml 0 → 100644 +29 −0 Original line number Diff line number Diff line .maven_build: extends: .default_unprotected stage: build image: maven:3.9.5-ibm-semeru-17-focal script: - mvn install -s ci_settings.xml -DskipTests artifacts: paths: - target/ .docker_build: extends: .default_unprotected stage: build image: name: gcr.io/kaniko-project/executor:debug entrypoint: [""] script: - /kaniko/executor --context "${CI_PROJECT_DIR}" --dockerfile "${CI_PROJECT_DIR}/Dockerfile" --destination "${CI_REGISTRY_IMAGE}:$APP_VERSION" --no-push .angular_build 2/2: extends: .default_unprotected stage: build image: node:latest script: - npm install - npm run build -- --dev artifacts: paths: - dist/ ci-templates/default.yml +17 −7 Original line number Diff line number Diff line Loading @@ -5,18 +5,28 @@ stages: - post - security # Default configuration for all jobs .default: variables: DEFAULT_TAG: "1.2.0-SNAPSHOT" before_script: - | if [ "$CI_COMMIT_REF_NAME" = "main" ] && [ -n "$CI_COMMIT_TAG" ]; then export APP_VERSION=$CI_COMMIT_TAG elif [ "$CI_COMMIT_REF_NAME" = "develop" ]; then export APP_VERSION="develop" else export APP_VERSION=$DEFAULT_TAG fi # rules: # - if: $CI_COMMIT_REF_NAME == "main" # - if: $CI_COMMIT_REF_NAME == "develop" # Configuration for jobs on protected branches .default_protected: extends: .default rules: - if: $CI_COMMIT_REF_PROTECTED == "true" # Configuration for jobs on unprotected branches .default_unprotected: # extends: .default variables: APP_VERSION: $CI_COMMIT_REF_NAME rules: - if: $CI_COMMIT_REF_PROTECTED != "true" artifacts: expire_in: 1 day ci-templates/dependencies.yml +0 −1 Original line number Diff line number Diff line install_node_dependencies: stage: install image: node:latest script: - npm install Loading
ci-templates/build.yml +13 −2 Original line number Diff line number Diff line .maven_build: extends: .default extends: .default_protected stage: build image: maven:3.9.5-ibm-semeru-17-focal script: Loading @@ -9,7 +9,7 @@ - target/ .docker_build: extends: .default extends: .default_protected stage: build image: name: gcr.io/kaniko-project/executor:debug Loading @@ -21,3 +21,14 @@ echo "Pushing Docker image with tag 'latest'" /kaniko/executor --context "${CI_PROJECT_DIR}" --dockerfile "${CI_PROJECT_DIR}/Dockerfile" --destination "${CI_REGISTRY_IMAGE}:latest" fi .angular_build 2/2: extends: .default_protected stage: build image: node:latest script: - npm install - npm run build -- --prod artifacts: paths: - dist/
ci-templates/build_unprotected.yml 0 → 100644 +29 −0 Original line number Diff line number Diff line .maven_build: extends: .default_unprotected stage: build image: maven:3.9.5-ibm-semeru-17-focal script: - mvn install -s ci_settings.xml -DskipTests artifacts: paths: - target/ .docker_build: extends: .default_unprotected stage: build image: name: gcr.io/kaniko-project/executor:debug entrypoint: [""] script: - /kaniko/executor --context "${CI_PROJECT_DIR}" --dockerfile "${CI_PROJECT_DIR}/Dockerfile" --destination "${CI_REGISTRY_IMAGE}:$APP_VERSION" --no-push .angular_build 2/2: extends: .default_unprotected stage: build image: node:latest script: - npm install - npm run build -- --dev artifacts: paths: - dist/
ci-templates/default.yml +17 −7 Original line number Diff line number Diff line Loading @@ -5,18 +5,28 @@ stages: - post - security # Default configuration for all jobs .default: variables: DEFAULT_TAG: "1.2.0-SNAPSHOT" before_script: - | if [ "$CI_COMMIT_REF_NAME" = "main" ] && [ -n "$CI_COMMIT_TAG" ]; then export APP_VERSION=$CI_COMMIT_TAG elif [ "$CI_COMMIT_REF_NAME" = "develop" ]; then export APP_VERSION="develop" else export APP_VERSION=$DEFAULT_TAG fi # rules: # - if: $CI_COMMIT_REF_NAME == "main" # - if: $CI_COMMIT_REF_NAME == "develop" # Configuration for jobs on protected branches .default_protected: extends: .default rules: - if: $CI_COMMIT_REF_PROTECTED == "true" # Configuration for jobs on unprotected branches .default_unprotected: # extends: .default variables: APP_VERSION: $CI_COMMIT_REF_NAME rules: - if: $CI_COMMIT_REF_PROTECTED != "true" artifacts: expire_in: 1 day
ci-templates/dependencies.yml +0 −1 Original line number Diff line number Diff line install_node_dependencies: stage: install image: node:latest script: - npm install