This is a docker image to build imgpoller container.
-
Pre-Required image: ubuntu:18.04
-
Required Container: Vault. The access tokens for GIT and Slack are taken from the environment variables, these environment variables refer the vault secret for the values. So, the vault container should be set-up first.
-
Follow the steps to create access token for Git.
- Open your github account and go to settings under the profile section on the top right corner.
- Now select Developer settings then Personal Access Tokens from the next windows
- Then select sufficient privileges and generate token. Secure this token in the Vault as variable GIT_ACCESS_TOKEN
-
Follow the steps to create a slack app to receive build notifications from imgpoller.
- Go to https://api.slack.com/ and login to your slack account.
- Click on start building
- Click on "Create a Slack App" and and create yourown app with suitable name.
- Now add "Incoming webhook" --> "Activate Incoming Webhooks" to "ON" --> "Add new webhook to workspace" --> Select the Channel
- Now check "OAuth & Permissions" tab for access token for the newly created App. (Add scopes if needed)
- Secure this token in the Vault as variable SLACK_TOKEN
-
Sample env file
#source /root/imgpoller.confENV=' -e VAULT_ADDR=https://vault:8200'ENV+=' -e VAULT_ROLE_ID='$VAULT_ROLE_IDENV+=' -e VAULT_SECRET_ID='$VAULT_SECRET_IDENV+=' -e VAULT_APPROLE='$VAULT_APPROLEENV+=' -e GIT_BASE_URL=https://api.github.com -e GIT_POLL_INTERVAL=60 -e GIT_BASE_URL=https://api.github.com -e USER_ID=1000'ENV+=' -e GIT_ACCESS_TOKEN='VAULT:GIT_ACCESS_TOKENENV+=' -e GIT_REPOS=AncyPaul/newnew/master:/root/newnew'ENV+=' -e SLACK_TOKEN='VAULT:SLACK_TOKENENV+=' -e SLACK_CHANNEL=business'ENV+=' -e SLACK_ICON_URL=https://www.ecloudcontrol.com/wp-content/uploads/2020/09/appz-images-icon-v2.png'ENV+=' -e SLACK_USER=appz-bot'ENV+=' -e APPZ_ENV=s2shape-dev' -
GIT_ACCESS_TOKEN is the token from github
-
GIT_REPOS is the location of remote repo
-
SLACK_TOKEN is the token from slack
-
SLACK_CHANNEL is the slack channel name
-
SLACK_ICON_URL is the url of the image to set the slack icon
-
SLACK_USER is the name of bot user displayed on each notification
-
SLACK_USER is the name of bot user displayed on each notifications