Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
afd1e6f
Create 15Nov24.md
chilikm4n Nov 15, 2024
eff8e65
Update README.md
chilikm4n Nov 15, 2024
c368d7a
Update README.md
chilikm4n Nov 15, 2024
60ff2c5
Update README.md
chilikm4n Nov 15, 2024
c834dae
Update README.md
chilikm4n Nov 15, 2024
1dcddd2
Update README.md
chilikm4n Nov 15, 2024
40cf275
Update README.md
chilikm4n Nov 15, 2024
8286772
added application info
chiliphrosting Nov 15, 2024
f856342
Merge pull request #1 from chilikm4n/readme
chilikm4n Nov 15, 2024
363d00a
added Jenkinsfile for worker with build job
chiliphrosting Nov 15, 2024
15ff706
line 35 error looking for '}'; added
chiliphrosting Nov 15, 2024
b9ef35d
revisit original Jenkinsfile
chiliphrosting Nov 15, 2024
889181b
revert back to Jenkinsfile_build w/ minor revisions to '}' and text
chiliphrosting Nov 15, 2024
a25d413
per console output capitalize Maven 3.9.8
chiliphrosting Nov 15, 2024
8a8e7b4
added Test and package job for worker pipeline
chiliphrosting Nov 15, 2024
8c17b45
archive artifacts, skip test and package
chiliphrosting Nov 15, 2024
513538d
16Nov24-repairBranch created, Jenkinsfile_16Nov24p24State before edit…
chiliphrosting Nov 16, 2024
eb89bfd
repair-branch: Jenkinsfile for worker with build job
chiliphrosting Nov 16, 2024
9b8b6c1
repair: installed 'missing' Docker plugins: Docker and Docker Pipelin…
chiliphrosting Nov 16, 2024
8439dcd
repair: changed Jenkinsfile Maven => maven version
chiliphrosting Nov 16, 2024
2d50a71
repair: for shits and giggles, commented out build status in proj top…
chiliphrosting Nov 16, 2024
bafbde1
repair: revert Jenkinsfile maven to Maven; notes update of build fail…
chiliphrosting Nov 16, 2024
b48b7c1
before pushing to master
chiliphrosting Nov 16, 2024
45d7e1c
before merge to master
chiliphrosting Nov 16, 2024
4fce9ac
repair: need to do pr before pushing to master
chiliphrosting Nov 16, 2024
f5ca20f
repair: added notes: about Dockerfile; w
chiliphrosting Nov 16, 2024
2257730
rm maven:3.9.8... from Dockerfile
chiliphrosting Nov 16, 2024
95e2201
Merge pull request #2 from chilikm4n/feature/workerpipe
chiliphrosting Nov 16, 2024
5fab445
p23:repaired16Nov25:archive artifacts, skip test and package
chiliphrosting Nov 17, 2024
03a3beb
archiveArtifacts(s) fix in Jenkinsfile
chiliphrosting Nov 17, 2024
fb84dc2
Merge pull request #3 from chilikm4n/feature/workerpipe
chiliphrosting Nov 17, 2024
578e6bf
adding Jenkinsfile for result app
chiliphrosting Nov 17, 2024
78c208a
results:NodeJS cleanup Jenkinsfile charset spacing of quote
chiliphrosting Nov 17, 2024
3b845de
missing quote fix
chiliphrosting Nov 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions 15Nov24.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*test 15Nov24**
webhook test
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
filename: README.md

Example Voting App
=========

This is a sample voting app.

Getting started
---------------

Expand Down Expand Up @@ -57,4 +61,8 @@ Architecture
Note
----

The voting application only accepts one vote per client. It does not register votes if a vote has already been submitted from a client.

<!-- [![Build Status](http://34.48.26.32:8080/buildStatus/icon?job=instavote%2Fworker-build)](http://34.48.26.32:8080/job/instavote/job/worker-build/) -->

<!-- [![Build Status](http://34.48.26.32:8080/buildStatus/icon?job=instavote&subject=Unittest%2Fworker-test)](http://34.48.26.32:8080/job/instavote/job/worker-test/) -->

167 changes: 167 additions & 0 deletions notes_repair_16Nov24.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
Sat Nov 16 09:46:06 EST 2024

http://34.48.26.32:8080/job/instavote/job/worker-pipe/job/master/3/console
```
Started by user admin
15:07:59 Connecting to https://api.github.com using chilikm4n/******
Obtained worker/Jenkinsfile from f85634240458a7a200a702176755ee2149e35bd8
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
WorkflowScript: 3: Invalid agent type "docker" specified. Must be one of [any, label, none] @ line 3, column 8.
docker{
^

1 error

at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:309)
at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1107)
at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:624)
at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:602)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:579)
at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:323)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:293)
at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox$Scope.parse(GroovySandbox.java:163)
at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.doParse(CpsGroovyShell.java:190)
at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:175)
at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:652)
at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:598)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:335)
at hudson.model.ResourceController.execute(ResourceController.java:101)
at hudson.model.Executor.run(Executor.java:442)

GitHub has been notified of this commit’s build result

Finished: FAILURE

```
**POTENTIAL SOLUTIONS**:
https://www.theserverside.com/blog/Coffee-Talk-Java-News-Stories-and-Opinions/Fix-Jenkins-Invalid-agent-type-Docker-specified-any-label-none-error
- **MAIN POINTS**: missing...
- Jenkins Docker Plugin
- Jenkins Docker Pipeline plugini
+ **INSTALLED**
- [x] Docker Pipeline 580.vc0c340686b_54
- [x] Docker plugin 1.6.2
+ [ ] resolves issue?
+ [x] feature/workpipe builds (#14)
- [ ] master: fail [x] attempt: (#4)
+ [?] `Jenkinsfile` "Maven" => "maven"
- [x] attempted fail (#5)
- [x] check: `docker inspect -f . maven:3.9.8-sapmachine-21`
- [x] they both failed (#16/17) complaining about "Maven"
- [ ] attempt update master: get merge first
- [16Nov24 15:45] requires a pull request; pr made
- [x] pulled images maven:3.9.8; results still show not able to do
- [ ] change Dockerfile
- [ ] change Jenkinsfile
```
chilikm4n/LFS261-example-voting-app.git master
Enumerating objects: 8, done.
Counting objects: 100% (8/8), done.
Delta compression using up to 2 threads
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 600 bytes | 600.00 KiB/s, done.
Total 6 (delta 4), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (4/4), completed with 2 local objects.
remote: error: GH006: Protected branch update failed for refs/heads/master.
remote:
remote: - Changes must be made through a pull request.
To https://github.com/chilikm4n/LFS261-example-voting-app.git
! [remote rejected] master -> master (protected branch hook declined)
error: failed to push some refs to 'https://github.com/chilikm4n/LFS261-example-voting-app.git'

```

____

```
avirtualrealitystory@ci-4nov24:~/06/lfx261/15Nov24a$ sudo docker inspect -f . mav
en:3.9.8-sapmachine-21
Error: No such object: maven:3.9.8-sapmachine-21

```
____

```
Started by user admin
15:21:52 Connecting to https://api.github.com using chilikm4n/******
Obtained worker/Jenkinsfile from f85634240458a7a200a702176755ee2149e35bd8
[Pipeline] Start of Pipeline
[Pipeline] node
Running on Jenkins in /var/jenkins_home/workspace/instavote_worker-pipe_master
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Declarative: Checkout SCM)
[Pipeline] checkout
The recommended git tool is: NONE
using credential 7447b235-b3ee-4c12-b034-b133cb332a41
Cloning the remote Git repository
Cloning with configured refspecs honoured and without tags
Cloning repository https://github.com/chilikm4n/LFS261-example-voting-app.git
> git init /var/jenkins_home/workspace/instavote_worker-pipe_master # timeout=10
Fetching upstream changes from https://github.com/chilikm4n/LFS261-example-voting-app.git
> git --version # timeout=10
> git --version # 'git version 2.39.2'
using GIT_ASKPASS to set credentials
> git fetch --no-tags --force --progress -- https://github.com/chilikm4n/LFS261-example-voting-app.git +refs/heads/master:refs/remotes/origin/master # timeout=10
> git config remote.origin.url https://github.com/chilikm4n/LFS261-example-voting-app.git # timeout=10
> git config --add remote.origin.fetch +refs/heads/master:refs/remotes/origin/master # timeout=10
Avoid second fetch
Checking out Revision f85634240458a7a200a702176755ee2149e35bd8 (master)
> git config core.sparsecheckout # timeout=10
> git checkout -f f85634240458a7a200a702176755ee2149e35bd8 # timeout=10
Commit message: "Merge pull request #1 from chilikm4n/readme"
First time build. Skipping changelog.
[Pipeline] }
[Pipeline] // stage
[Pipeline] withEnv
[Pipeline] {
[Pipeline] isUnix
[Pipeline] withEnv
[Pipeline] {
[Pipeline] sh
+ docker inspect -f . maven:3.9.8-sapmachine-21

error during connect: Get "https://docker:2376/v1.47/containers/maven:3.9.8-sapmachine-21/json": dial tcp: lookup docker on 127.0.0.11:53: server misbehaving
[Pipeline] isUnix
[Pipeline] withEnv
[Pipeline] {
[Pipeline] sh
+ docker pull maven:3.9.8-sapmachine-21
error during connect: Post "https://docker:2376/v1.47/images/create?fromImage=maven&tag=3.9.8-sapmachine-21": dial tcp: lookup docker on 127.0.0.11:53: server misbehaving
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] stage
[Pipeline] { (Declarative: Post Actions)
[Pipeline] echo
the job is complete
[Pipeline] }
[Pipeline] // stage
[Pipeline] End of Pipeline
ERROR: script returned exit code 1

GitHub has been notified of this commit’s build result

Finished: FAILURE

```


____
+ [x] determine where to revert back to
- lab7-1:p10
+ [x] create repair branch
+ [x] git directory to push: this directory
- contains commits from the lab
- the only main differences between each directories were the:
- Jenkinsfile(s)
- README.md
- All other files were alike
*to the best of my knowledge*
+ [x] Jenkins setup already done
+ [x] git setup already done
34 changes: 34 additions & 0 deletions result/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
pipeline {
agent any

tools{
nodejs 'NodeJS 22.4.0'
}

stages{
stage(build){
when{
changeset "**/result**"
}
steps{
echo 'Compiling result app..'
dir('worker'){
sh 'npm install'
}
}
}
stage(test){
when{
changeset "**/result/**"
}
steps{
echo 'Running Unit Tests on results app..'
dir('result'){
sh 'npm install'
sh 'npm test'
}
}
}
}

}
2 changes: 1 addition & 1 deletion worker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM maven:3.9.8-sapmachine-21
FROM maven:3.9.8
WORKDIR /app
COPY . .
RUN mvn package && \
Expand Down
78 changes: 40 additions & 38 deletions worker/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,41 +1,43 @@
pipeline {
agent{
docker{
image 'maven:3.9.8-sapmachine-21'
args '-v $HOME/.m2:/root/.m2'
}
}
stages{
stage('build'){
steps{
echo 'building worker app'
dir('worker'){
sh 'mvn compile'
}
}
}
stage('test'){
steps{
echo 'running unit tests on worker app'
dir('worker'){
sh 'mvn clean test'
}
}
}
stage('package'){
steps{
echo 'packaging worker app into a jarfile'
dir('worker'){
sh 'mvn package -DskipTests'
archiveArtifacts artifacts: '**/target/*.jar', fingerprint: true
}
}
}
pipeline {
agent any

tools{
maven 'Maven 3.9.8'
}
post{
always{
echo 'the job is complete'

stages{
stage("build"){
steps{
echo 'Compiling worker app'
dir('worker'){
sh 'mvn compile'
}
}
}
stage("test"){
steps{
echo 'Running Unit Test on worker app'
dir('worker'){
sh 'mvn clean test'
}
}
}

stage("package"){
steps{
echo 'Packaging worker app'
dir('worker'){
sh 'mvn package -DskipTests'
}
}
}
}
post{
always{
archiveArtifacts artifacts: '**/target/*.jar', fingerprint: true

echo 'Building multibranch pipeline for worker is completed..'
}
}
}
}
}

43 changes: 43 additions & 0 deletions worker/Jenkinsfile_16Nov24p24State
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
pipeline {
agent any

tools{
maven 'Maven 3.9.8'
}

stages{
stage("build"){
steps{
echo 'Compiling worker app'
dir('worker'){
sh 'mvn compile'
}
}
}
stage("test"){
steps{
echo 'Running Unit Test on worker app'
dir('worker'){
sh 'mvn clean test'
}
}
}

stage("package"){
steps{
echo 'Packaging worker app'
dir('worker'){
sh 'mvn package -DskipTests'
}
}
}
}
post{
always{
archiveArtifactss artifacts: '**/target/*.jar', fingerprint: true

echo 'Building multibranch pipeline for worker is completed..'
}
}
}

34 changes: 34 additions & 0 deletions worker/Jenkinsfile_build
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
pipeline {
agent any

tools{
maven 'maven 3.9.8'
}

stages{
stage("build"){
steps{
echo 'Compiling worker app'
dir('worker'){
sh 'mvn compile'
}
}
}
stage("test"){
steps{
echo 'Running Unit Test on worker app'
}

stage("packaging"){
steps{
echo 'Packaging worker app'
}
}
}
post{
always{
echo 'Building multibranch pipeline for worker is completed..'
}
}
}
}
Loading