Trigger drone tag event with api? - drone.io

I'm using the drone downstream plugin and it doesn't appear to be able to trigger a tag event in the downstream repo, only push. From there I was looking into the drone api to determine if I can hit the api to trigger a tag, but I'm not seeing it in docs or drone-go code. I'm afraid I'm missing it somewhere obvious, anyone know if you can trigger tag event in drone through api?
drone downstream plugin config:
pipeline:
trigger:
when:
event: [push, tag]
branch: master
image: plugins/downstream
server: https://drone6.company.com
fork: true
repositories:
- org/cars-v1
secrets: [ downstream_token ]

Related

(Gitops Argocd Notification) I want to receive an alarm by detecting only the changes in github What should I do?

I use argocd notification
I'm getting an alarm on Slack.
By the way, the problem is as follows.
New Deploy alarm occurs when github build & manifest update occurs
Alarm occurs when pod change occurs due to scale-in/out
Alarm occurs when pod is regenerated for some reason
I want to receive an alarm by detecting only the changes in github
What should I do?
Trigger in use
triggers:
trigger.on-deployed: |
- description: Application is synced and healthy. Triggered once per commit.
oncePer: app.status.syncResult.revision
send:
- app-deployed
when: app.status.operationState.phase in ['Succeeded'] and app.status.health.status == 'Healthy'

stage is not added to the endpoint when deploy with sls deploy --stage dev

I am using serverless framework. I have set the stage as the dev and deploying using sls deploy --stage dev command. The dev stage is not added to the end point. The endpoints are not like the one given below:
https://****.execute-api.us-east-1.amazonaws.com/users
One of my lambda functions needs an endpoint to submit a post request to a third-party API to post back the result. I need to be sure that the endpoint is rightly sent from the production/dev stage.
postback_url = `https://${process.env.RestApiId}.execute-api.${
process.env.REGION
}.amazonaws.com/${process.env.stage}/dfs-pingback?id=$id&tag=$tag`;
As you can see the above postback url is wrong if I do not get the stage (process.env.stage) added to the endpoint.
serverless.yml
service: lytoolsApi
frameworkVersion: '2 || 3'
configValidationMode: error
provider:
name: aws
runtime: nodejs12.x
region: us-east-1
stage: dev
Serverless Framework does things a bit differently and instead of using stages of APIGW, it creates a totally new APIGW for each stage, that's why you don't see the prefix in your path with the stage name, but if you observe the url, you'll see that the base url will be different across stages. That's how you can differentiate between them.

Connect back to main container from GitlabCI service

I am using Gitlab CI with docker executor and services.
During test I'm starting a server in the main script, and I need the service to make a request back to the main script.
Is there address/alias I can use to connect back to the main build script? Something like host.docker.internal.
Pseudo-example:
test:
services:
name: ping-pong-service
variables:
CALLBACK_ADDRESS: 'http://host.docker.internal:8090/pong'
script:
- "Start a server at 0.0.0.0:8090"
- curl http://ping-pong-service:80/ping
Supose that ping-pong-service is a service that when receiving any http request on :80, performs new request to CALLBACK_ADDRESS. What should I enter into CALLBACK_ADDRESS to connect back to main container?
I tried looking into what containers get started on the runner, but the main container doesn't seem to have predictable name or alias in the docker network.
Env:
Docker: 20.10.12
Gitlab Runner: 14.8.0, self-hosted, FF_NETWORK_PER_BUILD=1
Gitlab: 14.9.2-ee, self-hosted
When using the FF_NETWORK_PER_BUILD feature flag for networks per job, containers started using services: can reach the main job container using the network alias build
Assuming your service is configured as you describe, you would use:
variables:
CALLBACK_ADDRESS: 'http://build:8090/pong'
Note: this does not apply to containers started using docker run in the job container for this scenario.

How to control job scheduling in a better way in gitlab-ci?

I have in my gitlab projects jobs defined and executed via gitlab-ci. However, it doesn't do well with interdependent jobs as there's no management of this case except manual.
The case I have is a service, which is a part of the overall app, takes long time to start. Starting this service is done within a job, while another job have another service, which is also a part of the overall app, querying the former service. Due to interdependence, I have just delayed the execution of this later job so that most probably the former job has its service up and running.
I wanted to use Rundeck as a job scheduler but not sure if this can be done with gitlab? Maybe I am wrong about gitlab, so does gitlab allow better job scheduling?
Here's an example of what I am doing:
.gitlab-ci.yml
deploy:
environment:
name:$CI_ENVIRONMENT
url: http://$CI_ENVIRONMENT.local.net:4999/
allow_failure: true
script:
- sudo dpkg -i myapp.deb
- sleep 30m //here I wait for the service to be ready for later jobs to run successfully
- RESULT=`curl http://localhost:9999/api/test | grep Success'
it looks like it is a typical trigger feature inside gitlab-ci
see gitlab-ci triggers
mostly at the end of the long start-up service job A to use curl to trigger another one
deploy_service_a:
stage: deploy
script:
- "curl --request POST --form token=TOKEN --form ref=master https://gitlab.example.com/api/v4/projects/9/trigger/pipeline"
only:
- tags

Enable Slack on Spinnaker

I have a spinnaker local deployment running on ubuntu 14. I followed the notifications setup guide but its a bit fuzzy. I would appreciate any help in getting this integrated with slack.
Currently, I added a custom echo.yml with the slack configs. But its not picking up. Did not know where to specify custom settings.js (deck) as mentioned in the setup guide (https://www.spinnaker.io/setup/features/notifications/)
I would appreciate any hints/tips. Thanks!
cat /home/user/.hal/default/service-settings/echo.yml
slack: enabled: true token: some-token botName: spinnaker
Distributor ID: Ubuntu
Description: Ubuntu 14.04.5 LTS Release:14.04
echo.yml
slack:
enabled: true
token: some-token
settings.js
notifications: {
slack: {
enabled: true,
botName: 'Spinnaker'
}
},
Under features at the bottom of settings.js make sure notifications is set to true.
Also you must invite the bot into the slack room, don't worry if the bot is shown as offline.
The latest Halyard allows you to do this with hal - no need for file overrides:
https://www.spinnaker.io/reference/halyard/commands/#hal-config-notification-slack