# Artifact

    # Type

    Artifacts can be classified from different dimensions.

    # Application and Project

    An application artifact contains everything you need to deploy an application, including images, dependent addons, and various configuration information.

    A project artifact contains one or more deployment modes, each consisting of one or more application artifacts in a specific grouping order. These deployment modes can depend on each other. When deploying a project artifact, you can select the deployment mode you define and the platform will deploy the application artifacts in the given order. The modes that are depended on will be deployed first, and application artifacts within the same group will be deployed simultaneously.

    For example, the figure below shows a project artifact consisting of ten application artifacts.

    modeA, modeB and modeC are custom deployment modes, and modeA and modeB depend on modeC, so if you choose to deploy modeA or modeB when deploying this project artifact, the platform will deploy modeC first and then deploy modeA or modeB.

    # Temporary and Non-Temporary

    When an application artifact is created via pipeline, it is a non-temporary artifact if the artifact version or code branch meets one of the following conditions, otherwise, it is a temporary artifact:

    • Fill in tag_version in the release action.

    • The code branch conforms to the following format (i.e., prefixed with release/ and the suffix meeting the Semantic Versioning 2.0.0 (opens new window) specification).

      release/{[v]major version}.{minor version}[.patch version][-pre-release][+build metadata]
      

    The platform carries out daily garbage collection and collects temporary artifacts and their images that are created 72 hours ago and are not currently referenced, while non-temporary artifacts will not be collected.

    When creating a project artifact, only non-temporary artifacts can be referenced, and the project artifact is also a non-temporary artifact.

    Go to DevOps Platform > Projects > App Center > Artifact to view and manage all non-temporary artifacts under the project.

    Temporary artifacts can only be viewed through the release action link on the pipeline where the artifact is created.

    # Formal and Informal

    All artifacts are created as informal and can be converted to formal in App Center > Artifacts. The converted artifact is the formal artifact.

    Formal artifact means that the artifact is a formal version and cannot be modified (including edited, deleted, or converted).

    # Creation

    Please complete the cluster setting and branch rule configuration of the project before creating an artifact.

    • Go to DevOps Platform > Projects > Settings > General Settings > Project Info to set up the cluster.

    • Go to DevOps Platform > Projects > Settings > Files > Branch Rule to create branch rules.

    # Create Application Artifact

    Currently, application artifacts can only be created by release action.

    1. Go to App Center > App > Source, create a pipeline file, add an action (task type > package and release artifact) and fill in the configuration parameters.

    2. Go to App Center > App > Pipeline, select the branch and pipeline, click Add Pipeline, and execute the pipeline after completing the build.

    3. The successful execution of the pipeline means the successful creation of the artifact.

    The pipeline will match the branch rules according to the branch and select the artifact deployment environment.

    # Create Project Artifact

    Project artifacts can be created by selecting application artifacts, by uploading files and by project artifact addon.

    Go to DevOps Platform > Projects > App Center > Artifact > Project Artifacts, click Add in the upper right corner and select the creation method.

    • Select App Artifact

    Tips

    Custom mode is currently not supported for this method. Project artifacts created using this method will contain a deployment mode named default, which contains the application artifact group you selected.

    1. Enter the version. The version is a unique identifier of the project artifact under the project, and cannot be duplicated with others, composed of English letters, numbers, underscores (_), hyphens (-), and periods (.) .

    2. Select application artifacts (which need to be created in advance under the application of this project). You can group application artifacts. During deployment, application artifacts in the same group are not sequential, and that in different groups are deployed according to the numbering order.

      For example, if application artifact A depends on application artifact B, then you can set B as the first group and A as the second, so that B will be deployed before A. In addition, artifacts under the same application cannot be selected repeatedly.

    3. Fill in the content. It is a description of the project artifact, which can be a changelog or remarks, and supports markdown syntax.

    4. Click Submit to complete the project artifact creation.

    • Upload File

    This method is used to meet the scenario of importing project artifacts from one project to another. If you choose to upload a file, you need to download the project artifact package (in ZIP format) to the local (see Download for details) in advance, and then upload the file in the target project.

    The platform will automatically resolve the version of the project artifact and the information of related application artifacts.

    Tips

    • The application corresponding to the application artifact referenced in the uploaded project artifact must exist in the project, otherwise the upload will fail.
    • If there is no application artifact referenced by the uploaded project artifact in this project, the platform will automatically create an application artifact based on the artifact package. If an application artifact with the same version already exists, it will be referenced directly rather than create a new one. If the dice.yml of the application artifact in the artifact package is different from that of the existing application artifact with the same name, the former will be ignored.
    • Create via Project Artifacts Action
    1. Add an action for artifact packaging and releasing in the pipeline.

    1. Edit the action in code edit mode.

      There are two ways of YAML description for project artifacts action:

      • Mode not specified
      version: "1.1"
      stages:
        - stage:
            - project-artifacts:
                alias: project-artifacts
                description: release application artifact to project artifact
                version: "1.0"
                params:
                  changeLog: auto compose from applications // project artifact content
                  groups:                                   // application artifact group, consisting of an application description list
                    - applications:                         // application list
                        - branch: release/1.0               // applicaiton artifact branch and choose the lastest for release
                          name: applicationA                // application name
                        - releaseID: a9af810ebd884107a3b9a  // specified application artifact ID, with a higher priority than branch
                    - applications:
                        - branch: release/1.0
                          name: applicationB
                        - branch: master
                          name: applicationC
                  version: 1.0.0+${{ random.date }}         // project release version
      

      Project artifacts created in this way will contain a deployment mode named default, which contains all the application artifacts you specify in the groups field. The project artifact described in the YAML above is as follows:

      • Mode specified
      version: "1.1"
      stages:
        - stage:
            - project-artifacts:
                alias: project-artifacts
                description: release application artifact to project artifact
                version: "1.0"
                params:
                  changeLog: auto compose from applications // project artifact content
                  modes:                                    // deployment mode, with a higher priority than groups
                    modeA:
                      dependOn:                             // dependency mode
                        - modeB
                      expose: true                          // display or not
                      groups:
                        - applications:                         
                            - branch: release/1.0               
                              name: applicationA
                            - releaseID: a9af810ebd884107a3b9a
                        - applications:
                            - branch: release/1.0
                              name: applicationB
                    modeB:
                      expose: false
                      groups:
                        - applications:
                            - branch: release/1.0
                              name: applicationC
                    modeC:
                      expose: true
                      groups:
                        - applications:
                            - branch: master
                              name: applicaitonD
                  version: 1.0.0+${{ random.date }}         // project release version
      

      This allows you to specify the mode name and customize the group in each mode, which has a higher priority than the first method, that is, if both the groups and modes fields are specified in the YAML description of the action, only the modes field will take effect and the groups field will be ignored. The project artifact described in the YAML above is as follows:

      modeB specifies expose: false, indicating that the mode cannot be displayed in the project artifact details page and cannot be selected during deployment. Only when modeA is selected will modeB be deployed.

    # Operations

    On the artifact page, you can perform operations such as delete, download, edit, and more.

    Informal artifacts support batch operations of conversion to formal version and deletion.

    # Delete

    • Application artifact

      The application artifact to be deleted must meet the following conditions:

      • No runtime deployed by the application artifact.
      • Not referenced by any project artifact.
      • The application artifact is informal.

      When an application artifact is deleted, its image will also be deleted from the image repository.

    • Project artifact

      Informal project artifacts can all be deleted.

    # Download

    For project artifacts only.

    Click Download and you will get a ZIP file containing information about the project artifact and the application artifact it references. You can upload the artifact package in another project environment on the platform to create a new project artifact.

    # Edit

    For non-temporary and informal artifacts only.

    • Application artifact: Version and content are editable.
    • Project artifact: Version, application artifact and content are editable.

    # Convert to Formal

    For non-temporary and informal artifacts only.

    Once an application artifact or project artifact is converted to formal, it cannot be modified (including edited, deleted, or converted).

    If a project artifact is converted to formal, its referenced informal application artifacts will also be automatically converted formal.

    # View Referenced Artifacts

    For project artifacts only.

    When you click View Referenced Releases, the page will jump to application artifact and show all application artifacts referenced by the project artifact.

    # Artifact Deployment

    There are two ways for artifact deployment, one by pipeline and the other by deployment sheet (see Deploy via Pipeline and Deploy via Deployment Order for details).

    Currently, deployment via pipeline does not support mode selection for project artifact, but only the default mode in project artifact is supported.