summaryrefslogtreecommitdiff
path: root/tests/ci-stack/docker-compose.yml
blob: 177c1d260b76020f1a74289019b4285755087b1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
version: '3'
services:
  ci.linaro.org:
    image: 'linaro/ci-x86_64-jenkins-master-debian:lts'
    container_name: ci.linaro.org
    environment:
        JAVA_OPTS: "-Djava.awt.headless=true -Dhudson.slaves.WorkspaceList='_' -Dhudson.model.ParametersAction.keepUndefinedParameters=true -Dorg.jenkinsci.plugins.gitclient.Git.timeOut=30 -Dorg.eclipse.jetty.server.Request.maxFormContentSize=1000000 -Djenkins.install.runSetupWizard=false"
        ANSIBLE_GROUP: jenkins_master
        JENKINS_GROOVY: |
            #!groovy \n

            import jenkins.model.* \n
            import hudson.security.* \n
            import jenkins.install.InstallState \n
            import com.cloudbees.plugins.credentials.* \n
            import com.cloudbees.plugins.credentials.domains.Domain \n
            import com.cloudbees.plugins.credentials.impl.* \n
            import hudson.util.Secret \n

            def instance = Jenkins.getInstance() \n
            println "--> creating local user 'admin'" \n

            def hudsonRealm = new HudsonPrivateSecurityRealm(false) \n
            hudsonRealm.createAccount('admin','hunter2') \n
            instance.setSecurityRealm(hudsonRealm) \n

            def strategy = new FullControlOnceLoggedInAuthorizationStrategy() \n
            instance.setAuthorizationStrategy(strategy) \n
            instance.setCrumbIssuer(null) \n

            if (!instance.installState.isSetupComplete()) { \n
                InstallState.INITIAL_SETUP_COMPLETED.initializeState() \n
            } \n

            def jenkinsKeyUsernameWithPasswordParameters = [ \n
              description:  'Docker access password', \n
              id:           '88434794-118e-40e4-9cd9-be1ae5d70eec', \n
              secret:       'hunter2', \n
              userName:     'buildslave' \n
            ] \n

            def domain = Domain.global() \n
            def store = instance.getExtensionList('com.cloudbees.plugins.credentials.SystemCredentialsProvider')[0].getStore() \n
            def jenkinsKeyUsernameWithPassword = new UsernamePasswordCredentialsImpl( \n
              CredentialsScope.GLOBAL, \n
              jenkinsKeyUsernameWithPasswordParameters.id, \n
              jenkinsKeyUsernameWithPasswordParameters.description, \n
              jenkinsKeyUsernameWithPasswordParameters.userName, \n
              jenkinsKeyUsernameWithPasswordParameters.secret \n
            ) \n
            store.addCredentials(domain, jenkinsKeyUsernameWithPassword) \n

            instance.save()
            \n
    command:
        /bin/sh -c "mkdir -p /var/jenkins_home/init.groovy.d; echo $$JENKINS_GROOVY > /var/jenkins_home/init.groovy.d/skip-firstwizard.groovy; /usr/bin/tini -- /usr/local/bin/jenkins.sh"
    logging:
      driver: journald
    ports:
      - "2222:2222"
      - "2233:2233"
      - "8080:8080"
      - "50000:50000"
    networks:
      jenkins_net:
    volumes:
      - jenkins-home:/var/jenkins_home
  review.linaro.org:
    image: 'gerritcodereview/gerrit:3.0.2'
    container_name: review.linaro.org
    environment:
        ANSIBLE_GROUP: gerrit
    logging:
      driver: journald
    ports:
      - "29418:29418"
      - "8081:8080"
    volumes:
      - etc-volume:/var/gerrit/etc
      - git-volume:/var/gerrit/git
      - db-volume:/var/gerrit/db
      - index-volume:/var/gerrit/index
      - cache-volume:/var/gerrit/cache
    networks:
      jenkins_net:
  swarm-manager:
    image: swarm
    container_name: swarm-manager
    ports:
        - 2375:2375
    entrypoint: /swarm manage file://etc/swarm.txt
    volumes:
       - "${CI_DATA}/swarm.txt:/etc/swarm.txt:ro"
    networks:
      jenkins_net:

networks:
  jenkins_net:
    driver: bridge
    ipam:
     config:
       - subnet: 10.50.0.0/24

volumes:
  etc-volume:
  git-volume:
  db-volume:
  index-volume:
  cache-volume:
  jenkins-home: