SA4101 sa56 CICD workshop2

Page 1 of 5
DipSA CICD Workshop
Due: 0900 Monday May 08 2023 Total marks: 16% of SA4101
This is an individual workshop.
1. Createthefollowingaccountsifyoudon’talreadyhavethem
a. GitHub-https://github.com/
b. Railway-https://railway.app/
c. Join Slack channel https://join.slack.com/t/dipsa56-cicd/shared_invite/zt-
1txsjegdd-y6ZhPmjCSk7P~lAgZElHkA if you have not
2. DownloadtheGolangapplicationsource.Youwillbeusingthiscodebasefor
the workshop. The lecturer will provide you with the download link during class.
Create a git repository with this code. The initial visibility of your Git repository must be PRIVATE viz. no one else can access it except you. This is to prevent others from copying your work. If your assignment is plagiarized before 0900 May 08 2023, you will be considered as a willing party in the aiding and abetting of this dishonest act. You will be reported IMMEDIATELY to ISS for plagiarism.
Make your repository PUBLIC after 0900 Monday May 08 2023. Note: YAML file is a structured file; it is very easy to check if 2 files are
structurally the same
3. ProvisionaRailwayproject.Createaservicewithinyourproject.Addthe following environment variables to your service: INSTANCE_NAME (case sensitive). Set the value of this environment variable to by your name.
You will also need to expose the service to the Internet by creating a domain.

Code Help
Version 2 Page 2 of 5
Assignment
In this assignment, you will be writing a CI/CD pipeline to deploy a Golang application to Railway and publish the deployment URL on Slack. Your pipeline is to perform the following tasks:
1. Thepipelineshouldbetriggeredwhenabranchnamewiththefollowing format release/v.. For example, if you push a branch with the following names release/v1.0, release/v15.3 or release/v7.09, it should trigger your workflow but not release/v0.1- release/beta, v0.1.1 or feature-01.
2. DeploytheapplicationtotheRailwayservicewhichyouhaveprovisionedin the Setup section above
3. Oncetheapplicationhasbeenprovisioned,sendanotificationtoSlack.The notification should include all the following information in the following order.
a. Name-asperyourNRICorpassport.Thisshouldbeyourofficialname.I
will be using this name to match your registration. No marks will be
awarded if I cannot find your name.
b. Matriculationnumber–theexactformatthatyouusewhenyousitforyour
NUS ISS examination. The matriculation number should correspond with
your name in item a.
c. Email – you can be your NUS or your personal email
d. Repository–thisistherepositoryofyourwork;theURLshouldbederived
from github context and not hard coded into the workflow.
e. DeploymentURL–yourRailwayserviceURL.Youshouldnothardcodethis
into your workflow.
The Slack notification should include a clickable link of your application’s domain and a button Go that opens your application on the browser with the deployment URL.
You can build the Slack message with https://app.slack.com/block-kit-builder An example of this notification is shown in Figure 1 below

Page 3 of 5
4. Thepipelineshouldnotrunifthecommitmessagestartswith#NORUNevenif the branch name has the correct pattern. For example, the following push will not trigger your workflow
git commit -m “#NORUN fixed typo in README.md”
git push origin release/v1.0
The Slack workspace dipsa56-cicd is set up to receive notifications as Incoming Webhook. The following two webhook have been set up in the dipsa56-cicd Slack workspace and is associated with the following channels.
test-submission
submission
Use test-submission channel when you are testing your workflow.
When you are ready to submit your work, change your workflow to send the notification to the submission channel. If you accidentally posted to submission channel, please delete the notification or it can be erroneously used as your workshop submission.
https://hooks.slack.com/services/T054JE2KFTM/B0555BH6JKU/FeehYLH
jwy7qkLVAlJm99hCG
https://hooks.slack.com/services/T03GM3SK215/B054YP61W8N/aSarFo
wxf271lA51RMwuiVsC

Programming Help, Add QQ: 749389476
Version 2 Page 4 of 5 Note: The above 2 Slack Incoming webhook will be disabled after the submission
time: 0900 Monday May 08 2023.
Important: Do not expose the above 2 webhook URL in your git repository by hardcoding them into the workflow. If you do that, Slack will disable the webhooks. When you try to send the notification, you will get an unauthorized message. Disabled webhooks will not be re-enable1.
All sensitive information should be configured and used as GitHub secrets.
Git Actions
The following is a list of minimum git actions you will be using. Feel free to use alternatives or other git actions that you believe are more suited for your requirements.
• Checkout – https://github.com/marketplace/actions/checkout
• Setup Node – https://github.com/marketplace/actions/setup-node-js-
environment
• Deploy to Railway – https://github.com/bervProject/railway-deploy or you can
use run: railway up once you have installed the CLI
• Slack notification – https://github.com/marketplace/actions/slack-send. See
the following document for creating and formatting Slack notifications
https://api.slack.com/messaging/composing/layouts
1 The purpose of this is to impress on you the consequences of bad software development habits when it comes to handling sensitive information. If you adopt bad habits, the repercussions can be felt not only by you, but your coworkers as well.

Version 2 Page 5 of 5
Submission
Submit the workshop by pushing it to your GitHub repository; this should be the same repository as your Slack notification.
Don’t forget to merge your release branch back to main (or master). Instructors will only mark main (or master) branch.
Only git commits on or before 0900 Monday May 08 2023 in GitHub will be accepted. No other form of submission will be accepted (eg. ZIP file, uploading to Canvas). Your pleas and reasons will be redirected to /dev/null.
Your Slack notification on submission should not be later than 0920 Monday May 08 2023.
Remember to make your GitHub repository public after 0900 May 08 2023 so the lecturers can review your submission. Merge your final work in the release branch back to main (or master).
Academic Integrity
This workshop must be your own work.
You cannot ask a third party to write any part of this assessment or use AI tools such as ChatGPT to generate output and submit it as part of your assessment. This will result in an automatic disqualification from the assessment.

程序代写 CS代考 加微信: cstutorcs