Skip to content

Instantly share code, notes, and snippets.

{
"variables": {
"aws_access_key": "{{vault `packer/aws_access_key_id` `key`}}",
"aws_secret_key": "{{vault `packer/aws_secret_access_key` `key`}}",
"aws_region": "{{vault `packer/aws_region` `key`}}",
"vault_token": "{{env `VAULT_TOKEN`}}"
},
"builders": [{
"access_key": "{{ user `aws_access_key` }}",
"secret_key": "{{ user `aws_secret_key` }}",
@Amet13
Amet13 / Dockerfile
Last active January 29, 2020 14:45
FROM jenkins/jenkins:2.215
ENV CASC_JENKINS_CONFIG /jenkins_configs
USER root
# Install additional packages
RUN apt update && \
apt install -y python3 python3-pip && \
pip3 install awscli jenkins-job-builder jjb-reactive-choice-param --no-cache-dir
Jenkins.instance.pluginManager.plugins.each{
plugin ->
println ("${plugin.getShortName()}:${plugin.getVersion()}")
}
version: "3"
services:
jenkins:
build: .
container_name: jenkins
restart: always
ports:
- "50000:50000"
- "8080:8080"
volumes:
credentials:
system:
domainCredentials:
- credentials:
- usernamePassword:
description: "AWS credentials"
id: "aws-creds"
password: ${AWS_SECRET_ACCESS_KEY}
scope: GLOBAL
username: ${AWS_ACCESS_KEY_ID}
jenkins:
authorizationStrategy:
projectMatrix:
permissions:
- "Overall/Administer:steve.a@example.org"
- "Credentials/View:john.d@example.org"
...
clouds:
- amazonEC2:
cloudName: "AWS"
@Amet13
Amet13 / tree
Last active February 7, 2020 13:37
.
├── config.ini
├── jobs
│   ├── Job1.yaml
│   | ...
│   └── Job2.yaml
└── scripts
   ├── job1.sh
| ...
   └── job2.sh
@Amet13
Amet13 / Job1.yaml
Last active February 6, 2020 16:21
- job:
name: Job1
project-type: freestyle
auth-token: mytoken
disabled: false
concurrent: false
node: jenkins_agent
triggers:
- timed: '0 3 * * *'
builders:
@Amet13
Amet13 / jjb_run
Last active February 7, 2020 13:37
$ cat config.ini
[job_builder]
ignore_cache=True
exclude=jobs/Job2
[jenkins]
url=https://jenkins.example.org
user=some_user
password=some_password
version: 2.1
jobs:
my-job:
docker:
- image: cimg/base:2020.01
steps:
- run:
name: Debug envs
command: |