symfonyencore.pipeline 1.12 KB
Newer Older
Carl Schwan's avatar
Carl Schwan committed
1
// Request a node to be allocated to us
2
node( "StaticWeb" ) {
Carl Schwan's avatar
Carl Schwan committed
3 4 5 6 7 8 9 10 11 12 13 14
// We want Timestamps on everything
timestamps {
    // We want to catch any errors that occur to allow us to send out notifications (ie. emails) if needed
    catchError {
        // First Thing: Checkout Sources
        stage('Checkout Sources') {
            // Make sure we have a clean slate to begin with
            deleteDir()
            // Code
            checkout changelog: true, poll: true, scm: [
                $class: 'GitSCM',
                branches: [[name: gitBranch]],
15
                userRemoteConfigs: [[url: repositoryUrl]]
Carl Schwan's avatar
Carl Schwan committed
16 17 18 19
            ]
        }

        // Let's build website now
20
        stage('Build SASS and Javascript') {
Carl Schwan's avatar
Carl Schwan committed
21 22 23 24
            sh """
                export LANG=en_US.UTF-8
                yarn install
                yarn encore production
25
                VERSIONING=true yarn encore production
Carl Schwan's avatar
Carl Schwan committed
26 27 28 29 30 31
            """
        }

        // Deploy the website!
        stage('Publishing to CDN') {
            sh """
32
                rsync -Hav -e "ssh -i ${deploykey}" build/ ${deployuser}@${deployhost}:${deploypath}
Carl Schwan's avatar
Carl Schwan committed
33 34 35 36 37
            """
        }
    }
}
}