Skip to content

Buildpiper_Lab_07: Publish Apk

taranopstree edited this page Jul 21, 2023 · 1 revision

Apk Publishing

Now we have generated the apk file lets publish that in our workspace

Prerequisites

  • Successful completion of lab 6.

Step 1:- Go to Your Job Template. Click on Edit Icon and then click on Add Step.

Screenshot 2023-07-22 004228 

Step 2:- Search for Workspace_Publisher. Add the Workspace_Publisher steps in our job template.

image

Step 3:- Let's configure the Workspace_Publisher Step and to do so add the following instructions and click on Save.

FOLDER_TO_BE_COPIED=build/app/outputs/flutter-apk/app-release.apk

image

Step 4:- Search for Slack Notify and add the Slack Notify steps in our job template.

Slack Notify: We are using it for notification.

image 

Step 5:- Let's configure the Slack Notify step and to do so add the following instructions. For adding new variables click on Add Custom Variable and then click on Save.

BODY: {     "blocks": [         {             "type": "divider"         },         {             "type": "section",             "text": {                 "type": "mrkdwn",                 "text": "Your build has been *{{LAST_ACTIVITY_SUB_TASK_STATUS}}*"             }         },         {             "type": "divider"         },         {             "type": "section",             "text": {                 "type": "mrkdwn",                 "text": "*Build Status*"             }         },         {             "type": "section",             "text": {                 "type": "mrkdwn",                 "text": "*Service Name*: {{COMPONENT_NAME}}"             }         },         {             "type": "section",             "text": {                 "type": "mrkdwn",                 "text": "*Service Environment*: {{PROJECT_ENV_NAME}}"             }         },         {             "type": "section",             "text": {                 "type": "mrkdwn",                 "text": "*Task Status*: {{LAST_ACTIVITY_SUB_TASK_STATUS}}"             }         },         {             "type": "section",             "text": {                 "type": "mrkdwn",                 "text": "*Image Tag*: {{BUILD_IMAGE_NAME}}:{{BUILD_REPOSITORY_TAG}}"             }         },         {             "type": "section",             "text": {                 "type": "mrkdwn",                 "text": "*View Logs*"             },             "accessory": {                 "type": "button",                 "text": {                     "type": "plain_text",                     "text": "Click Here",                     "emoji": true                 },                 "value": "click_me_123",                 "url": "{{DNS_URI}}/logs?global_task_id={{GLOBAL_TASK_ID}}",                 "action_id": "button-action"             }         }     ] }
{     "blocks": [         {             "type": "divider"         },         {             "type": "section",             "text": {                 "type": "mrkdwn",                 "text": "Your build has been *{{LAST_ACTIVITY_SUB_TASK_STATUS}}*"             }         },         {             "type": "divider"         },         {             "type": "section",             "text": {                 "type": "mrkdwn",                 "text": "*Build Status*"             }         },         {             "type": "section",             "text": {                 "type": "mrkdwn",                 "text": "*Service Name*: {{COMPONENT_NAME}}"             }         },         {             "type": "section",             "text": {                 "type": "mrkdwn",                 "text": "*Service Environment*: {{PROJECT_ENV_NAME}}"             }         },         {             "type": "section",             "text": {                 "type": "mrkdwn",                 "text": "*Task Status*: {{LAST_ACTIVITY_SUB_TASK_STATUS}}"             }         },         {             "type": "section",             "text": {                 "type": "mrkdwn",                 "text": "*Image Tag*: {{BUILD_IMAGE_NAME}}:{{BUILD_REPOSITORY_TAG}}"             }         },         {             "type": "section",             "text": {                 "type": "mrkdwn",                 "text": "*View Logs*"             },             "accessory": {                 "type": "button",                 "text": {                     "type": "plain_text",                     "text": "Click Here",                     "emoji": true                 },                 "value": "click_me_123",                 "url": "{{DNS_URI}}/logs?global_task_id={{GLOBAL_TASK_ID}}",                 "action_id": "button-action"             }         }     ] }​

SLACK_HOOK_URL: <Enter your Incoming Webhook URL>

DNS_URI: https://app.buildpiper.io

COMPONENT_NAME: $COMPONENT_NAME

BUILD_IMAGE_NAME: BUILD_IMAGE_NAME

PROJECT_ENV_NAME: $PROJECT_ENV_NAME

BUILD_REPOSITORY_TAG: BUILD_REPOSITORY_TAG

LAST_ACTIVITY_SUB_TASK_STATUS: $LAST_ACTIVITY_SUB_TASK_STATUS

image 

After saving the steps. Your Job template would look like this.

Screenshot 2023-07-22 003926 

Step 4:- Now trigger the build.

image 

Step 5:- Let's see the published Artifact. Go to Service Overview and click on workspace.

image 

Here you can see the Published apk

image 

WooHoo!!! Lab Successfully Completed....